[BUG] Shift modifier ignored for letter keys under kitty keyboard protocol (xterm)
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 the kitty keyboard protocol was introduced (v2.1.83+), typing Shift+letter in Claude Code under xterm produces the lowercase letter instead of uppercase. For example, Shift+A produces a instead of A.
Under the kitty keyboard protocol, the terminal sends keypresses as CSI codepoint;modifier u — e.g., Shift+A is sent as CSI 97;2u (base codepoint 97 = a, modifier 2 = Shift). It is the application's responsibility to apply the Shift modifier to produce the uppercase character. Claude Code appears to be reading the base codepoint but discarding the Shift modifier flag for letter keys.
Copy-pasting uppercase characters from another terminal works correctly, confirming the issue is in keyboard input decoding, not rendering.
This is distinct from the post-exit terminal corruption in #38761 and the modifier-only key leaks in #38624. The problem occurs during the session — Shift is silently dropped from letter input.
What Should Happen?
Pressing Shift+A should produce A in the input field.
Steps to Reproduce
- Open xterm (v398)
- Run
claude(v2.1.84) - Press Shift+A
- Expected:
Aappears in the input - Actual:
aappears — Shift modifier is silently ignored
Capital letters can be typed normally in xterm outside of Claude Code.
Confirmed Regression
Tested v2.1.79 in the same xterm environment via npx @anthropic-ai/claude-code@2.1.79 — capital letters work correctly. The regression was introduced in v2.1.83 with the kitty keyboard protocol.
Workarounds Attempted (none worked)
XTerm*modifyOtherKeys: 0(via-xrm) — no effectXTerm*keyboardType: default(via-xrm) — no effectXTerm*modifyKeyboard: 0+XTerm*formatOtherKeys: 0(via-xrm) — no effectTERM=vt100 claude— no effect- Copy-pasting uppercase characters from another terminal does work
Related Issues
- #38761 — Terminal left in enhanced keyboard mode after exit
- #38624 — Caps Lock keycode leaks as raw
[57358u - #39330 — Kitty keyboard protocol escape sequences leak into input
Claude Code Version
2.1.84
Claude Model
Opus
Platform
Anthropic API
Operating System
Debian trixie (Linux 6.12.74+deb13+1-arm64, aarch64)
Terminal/Shell
xterm(398) / bash 5.2.37
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗