[BUG] Numpad Enter key not recognized in Ghostty terminal (CSI u sequence 57414)

Resolved 💬 3 comments Opened Jan 16, 2026 by victorysightsound Closed Jan 19, 2026

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 running Claude Code in Ghostty terminal, pressing the numpad Enter key inserts the literal characters [57414u instead of submitting input. The regular Enter key works correctly.

This happens because Ghostty implements the Kitty keyboard protocol. When Claude Code requests enhanced keyboard mode, Ghostty encodes the numpad Enter key as the CSI u sequence ^[[57414u (where 57414 is the Unicode codepoint for KP_Enter). Claude Code does not recognize this sequence and passes it through as literal text.

Environment:

  • OS: macOS (Darwin 25.2.0)
  • Terminal: Ghostty
  • Claude Code version: 2.1.5

What Should Happen?

The numpad Enter key should submit the input, identical to the main Enter key.

Claude Code's input handling should recognize the CSI u sequence for KP_Enter (keycode 57414) and treat it as equivalent to the regular Enter key.

Error Messages/Logs

No error message. The literal characters `[57414u` appear in the input field when the numpad Enter key is pressed.

Example: typing "echo hello" and pressing numpad Enter results in:
echo hello[57414u

Steps to Reproduce

  1. Install Ghostty terminal on macOS
  2. Open Ghostty terminal
  3. Run claude to start Claude Code
  4. Type any text (e.g., "hello")
  5. Press the numpad Enter key (the Enter key on the numeric keypad, not the main Enter key above right Shift)
  6. Observe that [57414u is inserted instead of submitting the input

Note: The same numpad Enter key works correctly in Claude Code when run from macOS Terminal.app, which does not use the Kitty keyboard protocol.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.5 (Claude Code)

Platform

Other

Operating System

macOS

Terminal/Shell

Other

Additional Information

Root Cause: Ghostty implements the Kitty keyboard protocol (CSI u encoding). Per the Kitty protocol spec, the regular Enter key is exempt from CSI u encoding for shell compatibility, but KP_Enter (numpad Enter) is not exempt and gets encoded as sequence 57414.

Workaround attempted: Ghostty keybind remapping (keybind = all:kp_enter=text:\x0d) does not intercept the key when an application has requested the Kitty keyboard protocol.

References:

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗