[BUG] Kitty keyboard protocol: Numpad Enter and Shift+Space not decoded (Ghostty + German keymap)
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?
Since updating to Claude Code 2.1.x (the version that added native Kitty keyboard protocol support for Shift+Enter), two keys no longer work correctly in Ghostty:
1. Numpad Enter outputs the literal string [57414;129u instead of submitting/newline
2. Shift+Space outputs the literal word space instead of a space character
These keys work fine outside of Claude Code (in the same terminal, same session). The issue started immediately after the update that enabled native Kitty keyboard protocol support.
What Should Happen?
- Numpad Enter should behave like regular Enter (submit message or insert newline depending on context)
- Shift+Space should insert a space character
Error Messages/Logs
Steps to Reproduce
- Use Ghostty terminal on Linux
- Use German keyboard layout (
de-latin1-nodeadkeys) - Run
claude - In the input field, press Numpad Enter → observe
[57414;129uappears as literal text - In the input field, hold Shift and press Spacebar → observe
spaceappears as literal text
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.0.x (before Kitty keyboard protocol was enabled in 2.1.0)
Claude Code Version
claude --version 2.1.1 (Claude Code)
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
The escape sequences being sent are valid Kitty keyboard protocol:
57414is the Kitty protocol keycode forKP_ENTER(numpad enter)- The
[<keycode>;<modifiers>uformat is the CSI u encoding
Ghostty is correctly sending these sequences. Claude Code enabled Kitty keyboard protocol in 2.1.0 to make Shift+Enter work natively, but the decoder doesn't handle all keycodes - specifically numpad keys and the shift+space combo.
https://sw.kovidgoyal.net/kitty/keyboard-protocol/#functional-key-definitions
Workaround
Adding these keybinds to Ghostty config (~/.config/ghostty/config) forces legacy sequences for these specific keys:
keybind = shift+space=text:\x20
keybind = kp_enter=text:\r
This works but shouldn't be necessary.
Related Issues
- #5757 - Similar issue with Shift+Enter sending
[27;2;13~(marked as duplicate, supposedly fixed in 2.1.0) - #1758 - Original feature request for Kitty protocol support
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗