[BUG] Esc key has no effect anywhere in TUI — does not clear input line or close fullscreen views (macOS, 2.1.170)
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?
The Esc key has no effect anywhere in Claude Code's TUI. It does not clear the input line at the normal prompt, and it does not close any fullscreen view (/config, /model, etc.). Ctrl+[ (which sends the same byte, 0x1B) also has no effect, confirming the issue is not a remapped physical Esc key.
The escape byte is confirmed to be arriving from the terminal: running cat -v in a plain shell and pressing Esc correctly emits ^[. So the terminal is sending a clean 0x1B; Claude Code's TUI is not acting on it.
This has persisted across many Claude Code restarts and multiple versions, including the current 2.1.170. It is a plain local iTerm2 session — no tmux, no screen, no SSH, no IDE-integrated terminal or other wrapper.
---
Byte confirmed arriving, reproduces in two terminals, clean config
What Should Happen?
Esc should clear the input line at the prompt and close fullscreen views, returning to the normal prompt.
Error Messages/Logs
n/a
Steps to Reproduce
- Open a local iTerm2 session and run
claude - At the normal prompt, type some characters and press Esc — line is NOT cleared
- Run
/model(or/config), press Esc — fullscreen view does NOT close - Press
Ctrl+[in the same views — also no effect
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.170
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Environment
- Claude Code version: 2.1.170 (native install,
~/.local/bin/claude→~/.local/share/claude/versions/2.1.170) - OS: macOS (Apple Silicon)
- Terminal: iTerm2 (local, no multiplexer)
- TERM: xterm-256color
- Shell: zsh
- Config: clean — no vim mode, no custom keybindings, no input-related env vars (verified
~/.claude/settings.json, project.claude/settings.json, andenv | grep -i claude)
Cross-terminal check
Reproduces identically in both iTerm2 and Terminal.app, which rules out any terminal-specific cause. TERM=xterm-256color. Confirmed via cat -v that the terminal emits a clean ^[ (0x1B) on Esc, so the byte reaches Claude Code but the TUI does not act on it. Config verified clean — no vim mode, no custom keybindings, no input-related env vars.
Is this a regression?
Unknown — has been present across many versions for this user.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗