[BUG] Claude Code uses legacy XTMODKEYS even when terminal advertises the kitty keyboard protocol
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?
Environment
- Claude Code: 2.1.150
- Terminal: kitty 0.41.1
- OS: Debian 13 (trixie), x86_64
- Shell: bash
Summary
When Claude Code runs inside kitty, it negotiates input handling via xterm's legacy modifyOtherKeys (XTMODKEYS — CSI > 4 ; 2 m) instead of using kitty's
enhanced keyboard protocol. Kitty advertises support for its own protocol and emits a diagnostic recommending the app switch.
Observed
Kitty prints, repeatedly:
The application is trying to use xterm's modifyOtherKeys. This is superseded
by the kitty keyboard protocol https://sw.kovidgoyal.net/kitty/keyboard-protocol.
The application should be updated to use that.[PARSE ERROR] CSI code m has 2 > 1 parameters
The pattern correlates with focus/input re-initialisation, suggesting Claude Code re-asserts input modes after focus-in or idle wake.
What Should Happen?
Expected
When the terminal responds positively to the kitty keyboard protocol query (CSI ? u), Claude Code should use it instead of falling back to / additionally
sending XTMODKEYS, eliminating both the kitty diagnostic and the CSI parse warning.
Error Messages/Logs
[PARSE ERROR] CSI code m has 2 > 1 parameters
Steps to Reproduce
- Launch kitty (0.41.x).
- Run claude (2.1.150) inside it.
- Interact normally, then either:
- move focus away and back (focus-follows-mouse setups will trigger it just by mousing over another window), or
- leave the window idle for a few seconds and resume typing.
- Observe ~/.xsession-errors.
Impact
Cosmetic — input still works correctly. Reporting because (a) it pollutes .xsession-errors and any session log file, and (b) it indicates Claude Code isn't
taking advantage of the richer key-event reporting that kitty's protocol provides (Ctrl+letter disambiguation, key-release events, etc.).
References
- Kitty keyboard protocol: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
- XTMODKEYS spec: https://invisible-island.net/xterm/manpage/xterm.html (search modifyOtherKeys)
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Claude Code: 2.1.150
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗