I would like to add a few more points here, not to prolong the discussion but rather for future reference and for myself.
On 2024-02-21 07:06 +0100, Adam Borowski wrote: > On Tue, Feb 20, 2024 at 07:41:42PM +0100, Sven Joachim wrote: >> The reason for including \E(B here is that sgr0 should cancel the >> effects of a previous smacs (start alternate character set) sequence and >> thus includes the rmacs (end alternate character set) escape sequence. This has been the case from the early days of ncurses when ESR started to maintain the terminfo collection. On archive.debian.org I found a version on ncurses 1.9.4 with the terminfo.src file version 9.8[1]. The ncurses manpages do not seem to explicitly mention this detail, but implicitly it appears a few times, for instance in termcap(3ncurses): ,---- | termcap has nothing analogous to terminfo's set_attributes (sgr) | capability. One consequence is that termcap applications assume that | “me” (equivalent to terminfo's exit_attribute_mode (sgr0) capability) | does not reset the alternate character set. ncurses checks for, and | modifies the data shared with, the termcap interface to accommodate the | latter's limitation in this respect. `---- > Then it combines two completely different concepts in one label. SGR is > for character attributes, G0/G1 are for encoding. You might think of it that way, but in (n)curses A_ALTCHARSET is just another video attribute, the concepts are not that different. >> Closing the bug, because everything works as intended. > > Well, I'm not going to fight a BTS war, but I don't agree with your > decision. If you want to see changes, please propose them upstream. If Thomas follows your reasoning, great for you. Otherwise nothing is ever going to happen anyway, because there is no way I am going to deviate from upstream here (and patch sgr0 in a gazillion terminfo entries). Cheers, Sven 1. https://archive.debian.org/debian/dists/Debian-0.93R6/source/devel/ncurses-1.9.4-0.tar.gz