Describe the bug
After exiting Claude Code, the terminal remains in an enhanced keyboard input mode (modifyOtherKeys / kitty keyboard protocol). Ctrl-C, Ctrl-D, and other control key combinations stop working — they produce escape sequences like 9;5u instead of sending the expected signals (SIGINT, EOF, etc.).
To reproduce
- Open Ghostty inside tmux
- Run
claude
- Use Claude Code normally
- Exit Claude Code (Escape, or /exit)
- Press Ctrl-C or Ctrl-D in the shell
Expected: Ctrl-C sends SIGINT, Ctrl-D sends EOF — normal shell behavior.
Actual: Ctrl-C produces 9;5u, Ctrl-D produces 0;5u, etc. Terminal is stuck in enhanced key mode.
Workaround
Running reset or printf '\e[>4;0m\e[>0m' restores normal terminal behavior.
Environment
- Claude Code version: latest (issue started in last 1-2 releases)
- OS: macOS (Darwin 24.6.0)
- Terminal: Ghostty
- Multiplexer: tmux
- Shell: zsh
Additional context
Describe the bug
After exiting Claude Code, the terminal remains in an enhanced keyboard input mode (
modifyOtherKeys/ kitty keyboard protocol). Ctrl-C, Ctrl-D, and other control key combinations stop working — they produce escape sequences like9;5uinstead of sending the expected signals (SIGINT, EOF, etc.).To reproduce
claudeExpected: Ctrl-C sends SIGINT, Ctrl-D sends EOF — normal shell behavior.
Actual: Ctrl-C produces
9;5u, Ctrl-D produces0;5u, etc. Terminal is stuck in enhanced key mode.Workaround
Running
resetorprintf '\e[>4;0m\e[>0m'restores normal terminal behavior.Environment
Additional context
modifyOtherKeysor the kitty keyboard protocol for enhanced input, but does not properly restore terminal state on exit.