You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
stripSgrCodes leaves C1 SGR styling already supported by the ANSI parser #690
At main 3b602348afbbe082eb919b576b55926bbf8d19d6, stripSgrCodes removes ESC-prefixed SGR styling but leaves the C1 CSI form (\x9b) that the ANSI parser already supports.
Reproduction using the actual source module with the repository dependencies installed:
The existing C1 ANSI support was added in #660. The mismatch affects consumers of stripSgrCodes: foreground overrides can retain C1 foreground styling, and a truncated CustomCommand with preserveColors can miss its trailing reset.
A native reproduction against unchanged production source failed the equality assertion. Focused regressions also fail for C1-only and mixed ESC/C1 SGR removal and for the truncated CustomCommand reset. Ordinary ESC-prefixed SGR, unrelated CSI controls, and OSC sequences should retain their existing behavior.
Thanks for the report. I have a fix in my fork, eric-engberg#78, and will open it here once I've reviewed it.
It also covers a worse case that arrived with the terminal sanitizer in v2.2.31: the sanitizer drops only the \x9b introducer and keeps the rest, so \x9b31mred\x9b39m now prints as 31mred39m in any widget. The fix keeps 8-bit color codes, written as ESC [, drops other 8-bit sequences whole, and makes stripSgrCodes match both forms.
Activity
eric-engberg commentedon Oct 9, 2026
Thanks for the report. I have a fix in my fork, eric-engberg#78, and will open it here once I've reviewed it.
It also covers a worse case that arrived with the terminal sanitizer in v2.2.31: the sanitizer drops only the
\x9bintroducer and keeps the rest, so\x9b31mred\x9b39mnow prints as31mred39min any widget. The fix keeps 8-bit color codes, written asESC [, drops other 8-bit sequences whole, and makesstripSgrCodesmatch both forms.