mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 13:55:50 +00:00
The earlyInput capture's escape sequence detection was too simplistic — it only checked if the byte after ESC fell in 0x40-0x7E range, treating it as a terminator. This caused DCS sequences (e.g. XTVERSION `\x1bP>|iTerm2 3.6.4\x1b\\`) and CSI parameter sequences (e.g. DA1 `\x1b[?64;...c`) to partially leak into the input buffer as `>|iTerm2 3.6.4?64;1;2;4;6;17;18;21;22c`. Fix by handling each escape sequence type per ECMA-48: - CSI (`ESC [`): skip parameter + intermediate bytes, then final byte - DCS/OSC/SOS/PM (`ESC P/]/X/^`): scan to BEL or ST terminator - Other: keep single-byte skip Closes #171 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
6.3 KiB
6.3 KiB