qwen-code/packages
顾盼 2aad7c0617
fix(cli): disable Kitty keyboard protocol on SIGINT to prevent garbled 9;5u output (#3544)
* fix(cli): disable Kitty keyboard protocol on SIGINT to prevent garbled 9;5u output

When a Kitty-capable terminal (iTerm2, Kitty, WezTerm) is used, the CLI
enables the Kitty keyboard protocol at startup via ESC[>1u. On exit, the
protocol must be disabled with ESC[<u to restore the terminal's default
key encoding. Failing to do so leaves the terminal in Kitty mode: any
subsequent Ctrl+C press is encoded as ESC[99;5u, and since the shell does
not understand this sequence, it echoes the trailing '9;5u' as garbled
text.

Root cause: kittyProtocolDetector registered cleanup handlers for 'exit'
and 'SIGTERM', but omitted SIGINT. A process terminated via SIGINT (e.g.
kill -INT <pid>, a parent process sending SIGINT, or certain process
managers) would exit without disabling the protocol.

Fix:
1. Add process.on('SIGINT', disableProtocol) alongside the existing
   'exit' and 'SIGTERM' handlers in kittyProtocolDetector.ts.
2. Export a new disableKittyProtocol() function for explicit call sites.
3. Call disableKittyProtocol() in the registerCleanup callback in
   gemini.tsx before instance.unmount(), so the disable sequence is
   written while stdout is fully operational regardless of exit path.

Fixes #3528

* fix(test): add disableKittyProtocol to kittyProtocolDetector mock
2026-04-24 15:27:55 +08:00
..
channels chore: bump version to 0.15.1 (#3541) 2026-04-23 11:06:07 +08:00
cli fix(cli): disable Kitty keyboard protocol on SIGINT to prevent garbled 9;5u output (#3544) 2026-04-24 15:27:55 +08:00
core fix: Strengthen error handling in qwenOAuth2.ts to prevent unhandled 'error' event (#3481) 2026-04-24 14:43:13 +08:00
sdk-java fix(sdk-java): pass custom env to CLI process (#3543) 2026-04-24 10:37:52 +08:00
sdk-typescript feat(web-search): remove built-in web_search tool, replace with MCP-based approach (#3502) 2026-04-24 11:29:02 +08:00
vscode-ide-companion feat(web-search): remove built-in web_search tool, replace with MCP-based approach (#3502) 2026-04-24 11:29:02 +08:00
web-templates chore: bump version to 0.15.1 (#3541) 2026-04-23 11:06:07 +08:00
webui feat(web-search): remove built-in web_search tool, replace with MCP-based approach (#3502) 2026-04-24 11:29:02 +08:00
zed-extension chore(zed-extension): update package version to 0.10.0 2026-02-06 14:26:01 +08:00