[BUG] Ghostty: after exiting vim mode, Ctrl+C prints ;5u / 9;5u instead of interrupting

Resolved 💬 3 comments Opened Mar 26, 2026 by BumaldaOverTheWater94 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?

In Ghostty, after using vim mode in Claude Code and then exiting vim mode, Ctrl+C no longer behaves normally. Instead of sending an interrupt, it prints raw text like:

;5u
or
9;5u

This only happens after the vim-mode transition inside Claude Code. I do not see the issue in iTerm2 under the same workflow.

This looks like Claude Code is leaving the terminal in an enhanced keyboard-reporting mode (kitty keyboard protocol / CSI-u) or not restoring the previous keyboard state correctly when exiting vim mode.

What Should Happen?

After exiting vim mode, terminal input handling should return to normal. Pressing Ctrl+C should interrupt the current command/process, not print raw CSI-u fragments like ;5u or 9;5u.

Error Messages/Logs

Steps to Reproduce

  1. Open Ghostty
  2. Start Claude Code
  3. Enter vim mode inside Claude Code
  4. Exit vim mode
  5. Press Ctrl+C
  6. Observe that raw text such as ;5u or 9;5u is printed instead of Ctrl+C acting normally

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.84 (Claude Code)

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗