Enter key intermittently stops working in Ghostty terminal

Resolved 💬 3 comments Opened Mar 26, 2026 by Bougerous Closed Apr 25, 2026

Bug Description

The Enter key intermittently stops registering as chat:submit when running Claude Code inside Ghostty. When it fails, pressing Fn+Enter (which sends KP_Enter) works as a workaround. The issue is non-deterministic — Enter works in some sessions/moments and not in others.

Environment

  • Claude Code: 2.1.84
  • Terminal: Ghostty 1.3.1 (stable)
  • OS: macOS 26.3 (Tahoe)
  • Shell: zsh

Ghostty Config (relevant)

keybind = shift+enter=text:\x1b\r

No other custom keybinds. No custom keybindings.json for Claude Code exists.

Steps to Reproduce

  1. Open Ghostty
  2. Launch claude
  3. Type a message and press Enter
  4. Sometimes it submits, sometimes nothing happens
  5. When Enter fails, Fn+Enter always works

Expected Behavior

Enter should always submit the chat message (trigger chat:submit).

Actual Behavior

Enter intermittently fails to register. Fn+Enter works as a workaround.

Investigation

  • No ~/.claude/keybindings.json exists (all defaults)
  • Default binding for chat:submit is enter
  • Adding keybind = enter=text:\r to Ghostty config did not resolve the issue
  • Suspect this may be related to Ghostty's Kitty keyboard protocol support — when the protocol is negotiated, Enter may be encoded as a CSI sequence rather than raw \r, and Claude Code may not always handle that encoding correctly

Possible Root Cause

Ghostty implements the Kitty keyboard protocol. When Claude Code's terminal UI framework (Ink) negotiates this protocol, the Enter key gets encoded differently (CSI u sequence instead of plain CR \r). If the key input handler doesn't account for both encodings, Enter works only when the protocol isn't active and fails when it is — explaining the intermittent nature.

View original on GitHub ↗

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