[BUG] Terminal left in Kitty keyboard protocol mode after exit (Ghostty)
Resolved 💬 3 comments Opened Mar 26, 2026 by lusxvr Closed Mar 30, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
After exiting Claude Code, the terminal is left in an extended keyboard encoding mode (Kitty keyboard protocol). This causes Ctrl+C to send ^[[9 instead of SIGINT, breaking normal terminal usage until a full terminal reset (printf '\ec') is performed.
Environment
- Terminal: Ghostty
- Shell: Zsh + Oh My Zsh
Workaround: printf '\ec' or wrapping the binary in a shell function that runs it on exit
What Should Happen?
Claude Code resets the keyboard protocol on exit
Error Messages/Logs
Steps to Reproduce
- Launch
claudein Ghostty - Exit Claude Code
- Press Ctrl+C — outputs
^[[9instead of interrupting
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.84
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗