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
Commit c08a59d
Browse filesBrowse the repository at this point in the historyBrowse files
fix: keep 8-bit color codes, strip them, and drop other 8-bit sequences whole (sirmalloc#704)
* fix(ansi): strip 8-bit color codes as well as ESC [ ones
The ANSI parser reads the 8-bit CSI (0x9b) as an escape sequence, but
stripSgrCodes only matched color codes written with ESC [. Text colored
with \x9b31m kept its colors where they should go: a global foreground
override left a preserveColors widget's own colors in place, and a
Custom Command cut by its max width never got its closing reset, so its
color ran into the separators and widgets after it.
Match both introducers. restoreBackgroundAfterResets shares the pattern,
so an 8-bit reset now gets the background re-applied after it too; its
parameter parsing skips a one-character introducer for those.
* fix(sanitize): keep 8-bit color codes and drop other 8-bit sequences whole
The terminal sanitizer dropped 8-bit C1 controls one character at a time.
For a sequence started by one, that removed only the introducer and left
the rest as text: a command printing \x9b31mred\x9b39m showed "31mred39m",
and an 8-bit hyperlink or title string showed its URL or payload.
Read each 8-bit introducer as the ESC sequence it stands for: CSI (0x9b)
as ESC [, OSC (0x9d) as ESC ], and DCS, SOS, PM and APC likewise, with
ST (0x9c) ending strings. Color codes and safe hyperlinks are kept, in
their 7-bit form, which every terminal reads and the rest of the
renderer parses; any other sequence is dropped whole. Lone 8-bit
controls that start no sequence, such as NEL or a stray ST, are still
dropped.
0 commit comments