Closed egmontkob closed 1 year ago
As far as I know, CSI 0m is typically used to reset the decoration only (colors and such), and it's unexpected to reset anything else.
One of the reasons is that, for legacy reasons, there's no terminfo entry to reset bold. There is a way to reset italic, underline, fg or bg color, etc., but not bold. Folks who rely on terminfo and wish to reset bold have to resort to whichever capabilitty that ends up printing CSI 0m and thus resetting everything (and then re-enable the modes that they wished to keep).
First and foremost, it should be checked whether CSI 0m resets the stack in terminals that supports stacking, I believe xterm added this a few years ago. I haven't checked it. But I'd be really surprised if it reset the stack -- then it wouldn't be possible to reset bold (for terminfo-based apps) while preserving the stacked values.
If xterm resets the stack on CSI 0m then I do have a problem with xterm's behavior here.
If xterm doesn't reset the stack (which I hope for) then my understanding of the "exception of exception" becoming and inclusion in your propsal doesn't match this.
I probably misunderstood that long sentence, apologies in that case.
If I understand it correctly now, the sentence
Resets all, except [...] to the default setting and closes all nesting layout features like [...] but not explicit stacking of SGR settings.
should be interpreted as
Resets all, except [...] to the default setting. Closes all nesting layout features like [...] but not explicit stacking of SGR settings.
Splitting into two sentences like this would IMO greatly improve readability, as it would clarify the scope of those "except" and "but not" parts.
Since this control sequence (CSI 0m) is (mainly) intended for terminal emulators, it seems reasonable to let the extent of "reset" be implementation defined.
4.1 says:
So, does it reset explicit stacking? It's an exception within an exception, so it should be included?
May I suggest to reword in a way that's more obvious to interpret?