[BUG] Kitty keyboard protocol: Ctrl shortcuts fail on non-Latin keyboard layouts (e.g. Russian/Cyrillic)
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?
When using Claude Code in kitty terminal with a non-Latin keyboard layout (Russian/Cyrillic), all Ctrl-based readline shortcuts stop working: Ctrl+A, Ctrl+E, Ctrl+U, Ctrl+K, Ctrl+W, Ctrl+B, Ctrl+F.
The shortcuts work fine on the English layout in the same terminal session.
Root Cause
The kitty keyboard protocol reports key events as CSI sequences with the Unicode codepoint of the current layout's character. On English layout, Ctrl+A sends CSI 97;5u (97 = 'a'). On Russian layout, the same physical key sends CSI 1092;5u (1092 = 'ф'). Claude Code matches keybindings against the primary key codepoint and doesn't recognize 'ф' as 'a'.
The kitty keyboard protocol has a mechanism for this — the "report alternate keys" enhancement flag (bit 0b1000), which makes the terminal report both the layout-specific key and the base (US layout) key. Claude Code should either:
- Request the alternate keys flag and use the base layout key for keybinding matching, or
- Map Ctrl + non-Latin codepoints to their physical-key equivalents internally.
This is different from #32087 (Ghostty/fixterms) — kitty terminal correctly implements the protocol, the issue is purely in how Claude Code consumes it.
What Should Happen?
Ctrl+A/E/U/K/W/B/F should work identically on any keyboard layout, as they do in every readline-based application and in legacy terminal mode (where Ctrl+key always produces a layout-independent control code like \x01).
Workaround
Adding explicit kitty mappings that send raw control codes for Russian Ctrl combinations:
# in kitty.conf
map ctrl+ф send_text all \x01 # Ctrl+A
map ctrl+у send_text all \x05 # Ctrl+E
map ctrl+ц send_text all \x17 # Ctrl+W
map ctrl+г send_text all \x15 # Ctrl+U
map ctrl+л send_text all \x0b # Ctrl+K
map ctrl+и send_text all \x02 # Ctrl+B
map ctrl+а send_text all \x06 # Ctrl+F
This works but is a per-user, per-layout hack. The proper fix should be in Claude Code's keyboard protocol handling.
Error Messages/Logs
No errors — keys are silently ignored.
Steps to Reproduce
- Open kitty terminal on macOS
- Switch to a non-Latin keyboard layout (e.g. Russian)
- Launch Claude Code
- Type some text in the input field
- Press Ctrl+A — cursor does not move to beginning of line
- Switch to English layout — Ctrl+A works
Claude Model
Opus
Is this a regression?
Unknown — may have started when kitty keyboard protocol support was added (v2.1.0+)
Claude Code Version
2.2.16
Platform
Anthropic API
Operating System
macOS (Darwin 25.3.0)
Terminal/Shell
kitty 0.41.1 / bash
Additional Information
Related issues: #32087, #17400, #18221, #11997
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗