[BUG] Numpad arrow keys (NumLock off) don't work in chat/lists on Kitty-protocol terminals (Ghostty); fine in Konsole
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?
On a keyboard with no separate arrow-key cluster, the numpad arrows (NumLock off) do nothing in Claude Code when running in a terminal that negotiates the Kitty keyboard protocol — tested in Ghostty. No cursor movement, no text inserted, no error. Affects the chat input and list views (--resume, claude agents). Same keys work normally in Konsole, which doesn't negotiate the Kitty protocol by default, and in other applications in the same Ghostty session, including bash and Helix.
This appears to be the same underlying bug as #22739, which described regular arrow keys leaking literal [57319u text into the input on v2.1.29. That issue was auto-closed for inactivity, not because it was fixed. On current versions the failure mode is different — nothing prints and nothing happens, instead of garbled text appearing — so either there's been a partial fix that suppresses unrecognized codes instead of leaking them as text, or this is a related but distinct gap in the same area. This report can only confirm the numpad-as-arrow case, since the test keyboard has no separate arrow cluster to check whether regular arrow keys are still affected too.
What Should Happen?
Numpad arrows with NumLock off should function as normal arrow keys, regardless of terminal or keyboard protocol in use.
Error Messages/Logs
None. No crash, no error output, no warning — the keypress is silently dropped with no visible reaction.
The only relevant byte-level evidence is from cat -v in Ghostty, confirming the terminal sends standard, correctly-formed input for these keys:
$ cat -v
^[[A^[[B^[[D^[[C
(Up, Down, Left, Right — numpad, NumLock off)
Steps to Reproduce
- Run claude directly in Ghostty (Kitty-protocol terminal), no tmux/screen/zellij.
- Type a multi-line prompt, move the cursor with the numpad arrows (NumLock off). No effect.
- Run claude --resume or claude agents, navigate the list with the same keys. No effect.
- Run cat -v, press the same keys, confirm output matches the log above.
- Run claude in Konsole (no Kitty protocol by default) and repeat steps 2–3. Numpad arrows work normally.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.183 (Claude Code)
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
Tested in a second terminal, Konsole (KDE's default), which doesn't negotiate the Kitty keyboard protocol by default. Numpad arrows work normally there. This isolates the bug to terminals where the protocol is actually active — it doesn't reproduce when Claude Code stays in legacy key encoding.
Also ruled out:
Version — same result on 2.1.170 (stable) and 2.1.183 (latest), both in Ghostty.
Multiplexer — process tree confirms bash is a direct child of ghostty, no tmux/screen/zellij in between.
Plugins/hooks/config — same result in --safe-mode. No keybindings.json, default editor mode.
Ghostty's own encoding — Helix, in the same Ghostty session, also uses the Kitty keyboard protocol and handles these same keys correctly. Ghostty is sending something usable; Claude Code isn't reading it correctly.
Suspected cause: Claude Code enables the Kitty keyboard protocol on terminals that support it (Ghostty; not Konsole by default). Under that protocol, numpad-origin arrow keys (KP_Up/KP_Down/etc.) are distinct key identities from the main arrow keys, with their own codepoints — they only collapse to identical plain bytes in legacy mode, which is why Konsole and cat -v both show normal behavior. #22739 shows this same class of decoding problem affecting the main arrow keys directly, on an older version. Two other open issues describe the same kind of gap for other keypad keys: KP_Enter (#18480) and Shift+Space (#17400).
Environment
Claude Code 2.1.183 (native), also tested on 2.1.170
CachyOS, kernel 7.1.1-2-cachyos
Ghostty 1.3.1-arch2.1, TERM=xterm-ghostty — bug reproduces here
Konsole — bug does not reproduce here
bash, no multiplexer
Related: #22739, #18480, #17400