TUI: use Esc Esc to cancel, and Esc Esc to clear prompt when input is non empty
Open 💬 5 comments Opened Mar 12, 2026 by CreepyGnome
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What variant of Codex are you using?
CLIwhat
What feature would you like to see?
Summary
In Codex CLI, single Esc is too easy to trigger accidentally and can cancel MCP startup, generation, or other in progress work.
Requested behavior
- If the prompt is empty:
Esc Esc cancels the current in progress action.
- If the prompt contains text:
Esc Esc clears the whole prompt.
Why this matters
- Single
Escis easy to hit by accident. - It can interrupt agent work or startup unexpectedly.
- It prevents shell level
Escsequences from working naturally. Esc Escis a safer interaction pattern for terminal UIs.
Current behavior
A single Esc cancels work such as MCP loading or agent thinking.
Expected behavior
Use double tap Esc for interrupt behavior.
Use the same Esc Esc gesture to clear the current prompt when the input field is non empty.
Environment
- OS: macOS 26.2
- Terminal: iTerm.app 3.6.6
- Codex version: codex-cli 0.114.0
Additional information
_No response_
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I reviewed those before posting this, and I do not think they are duplicates. This is a feature request, while those are closed bug reports.
They are still related, though, since this feature could address the behavior described in those reports by changing how ESC works. Linking them makes sense for that reason, but it should not impact the feature request itself.
I've implemented part of this (double-Esc to clear composer input) in my fork:
Happy to open a PR against this issue
if it helps.
Fully agree. I’ve run into this more than once: I want to clear the edit box, but end up cancelling the task instead. At first I didn’t even understand what Esc was doing — I pressed it several times and cancelled several queued tasks.
The current behavior is very inconvenient. I don’t want any hotkey for cancelling a task at all — not Esc, not any other single key. If I occasionally need to cancel something, I’ll do it with a click.
Alternatively, it could be some deliberately hard-to-press shortcut involving two or three keys at once. But definitely not a single Esc key.
At the very least, we should be able to configure hotkeys in the settings.
needed feature like their shall be either esc esc or long press esc to cancel