Skip to content

[BUG] Terminal left in enhanced keyboard mode after exit — Ctrl-C/Ctrl-D broken #38761

@dashorst

Description

@dashorst

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

  1. Open Ghostty inside tmux
  2. Run claude
  3. Use Claude Code normally
  4. Exit Claude Code (Escape, or /exit)
  5. 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

Metadata

Metadata

Assignees

Labels

area:tuibugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions