Kitty keyboard protocol not restored on Ctrl+C exit in Ghostty
Status Fixed / completed
Reported on v2.1.84
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
Activity 5 comments · opened Mar 26, 2026 · closed Mar 26, 2026
Description
When exiting Claude Code via Ctrl+C in Ghostty terminal, the kitty keyboard protocol is not properly disabled/restored. This leaves the terminal in a broken state where subsequent keypresses are rendered as raw CSI u escape sequences in the prompt.
Reproduction
- Open Ghostty terminal
- Run
claude - Press Ctrl+C to exit
- Try typing anything — raw escape sequences appear instead of normal characters:
````
9;5u9;5u9;5u9;5u9;5ul9;5u22;5u
- The prompt is unusable until
resetis run
Expected behavior
Claude Code's SIGINT handler should pop/disable the kitty keyboard protocol mode (CSI < u) before the process exits, restoring the terminal to its previous keyboard state.
Workaround
Blindly type reset and press Enter to restore terminal state.
Environment
- Claude Code: 2.1.84
- Ghostty: 1.3.1 (stable)
- macOS (Darwin 25.3.0)
- Shell: zsh
5 Comments
Closing — needs more investigation before filing. May be a local config or Ghostty interaction issue rather than a Claude Code bug.
No, I see this too. And a bunch of others #39112, #39132, etc in just the last few hours.
I see the same with zsh in alacritty.
From the 2.1.85 release notes:
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.