Ghostty: number key selection in option menus falls back to line input (works in iTerm2)
Bug Description
When Claude Code presents numbered options (e.g. from AskUserQuestion), pressing a number key should immediately select that option. In iTerm2 this works correctly — pressing 2 instantly selects option 2. In Ghostty, pressing 2 just appends the character to the input line, requiring a separate Enter keypress to submit.
Steps to Reproduce
- Open Claude Code in Ghostty terminal
- Trigger any numbered option menu (e.g. a question with multiple choices)
- Press a number key (e.g.
2)
Expected: Option 2 is immediately selected
Actual: 2 is appended to the input line; requires pressing Enter to confirm
Environment
- Terminal: Ghostty
- TERM:
xterm-ghostty - Claude Code version: 2.1.59
- Works in: iTerm2 (same Claude Code version)
Notes
Since this works in iTerm2 but not Ghostty, the issue appears to be in terminal capability detection — Claude Code likely checks for a capability to decide whether to use raw mode (single keypress) vs cooked/line-buffered mode, and xterm-ghostty may not satisfy that check.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗