What to build
Control sequences still leak as visible text — most visibly a stray 0; (and window-title / color payloads) printed at the start of prompt lines when running the GitHub Copilot CLI and other apps.
Root cause to address: the SSH read path decodes bytes to a UTF-8 String before the ANSI parser runs. Raw 8-bit C1 control bytes (OSC introducer 0x9D, CSI 0x9B, ST 0x9C, DCS 0x90, etc.) are not valid standalone UTF-8 and get turned into replacement characters by the decoder, so the parser never recognizes them and the payload (0;title, color specs) prints as text. The 7-bit ESC ] path is consumed, but the byte-level forms are lost.
Fix: feed raw bytes to the terminal parser (do the UTF-8 decoding for display inside the parser/emulator, where control bytes have already been handled), and ensure OSC (title 0;/2;, color set/query 4;/10;/11;) and other string sequences (DCS/PM/APC/SOS) are fully consumed for both 7-bit and 8-bit forms and across chunk boundaries.
Acceptance criteria
Blocked by
None - can start immediately.
Agent workflow
Work test-first (/tdd): reproduce the 0; leak as a failing byte-level test, switch the read path to raw bytes, and iterate (/fleet) until no fragments leak and Korean/UTF-8 still renders. Validate with ./run-tests.sh. Do not release/build the APK from untested code.
What to build
Control sequences still leak as visible text — most visibly a stray
0;(and window-title / color payloads) printed at the start of prompt lines when running the GitHub Copilot CLI and other apps.Root cause to address: the SSH read path decodes bytes to a UTF-8
Stringbefore the ANSI parser runs. Raw 8-bit C1 control bytes (OSC introducer0x9D, CSI0x9B, ST0x9C, DCS0x90, etc.) are not valid standalone UTF-8 and get turned into replacement characters by the decoder, so the parser never recognizes them and the payload (0;title, color specs) prints as text. The 7-bitESC ]path is consumed, but the byte-level forms are lost.Fix: feed raw bytes to the terminal parser (do the UTF-8 decoding for display inside the parser/emulator, where control bytes have already been handled), and ensure OSC (title
0;/2;, color set/query4;/10;/11;) and other string sequences (DCS/PM/APC/SOS) are fully consumed for both 7-bit and 8-bit forms and across chunk boundaries.Acceptance criteria
0;/ window-title OSC never appears as visible text (7-bitESC ]and 8-bit0x9Dforms, BEL- or ST-terminated).10;?,11;#RRGGBB,4;n;?) and DCS/PM/APC/SOS strings are consumed, not printed.Blocked by
None - can start immediately.
Agent workflow
Work test-first (
/tdd): reproduce the0;leak as a failing byte-level test, switch the read path to raw bytes, and iterate (/fleet) until no fragments leak and Korean/UTF-8 still renders. Validate with./run-tests.sh. Do not release/build the APK from untested code.