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:
import { stripSgrCodes } from './src/utils/ansi.ts';
stripSgrCodes('\x9b31mred\x9b39m');
// Actual: '\x9b31mred\x9b39m'
// Expected: 'red'
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.
At main
3b602348afbbe082eb919b576b55926bbf8d19d6,stripSgrCodesremoves 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 withpreserveColorscan 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.