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

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

  1. If the prompt is empty:

Esc Esc cancels the current in progress action.

  1. If the prompt contains text:

Esc Esc clears the whole prompt.

Why this matters

  • Single Esc is easy to hit by accident.
  • It can interrupt agent work or startup unexpectedly.
  • It prevents shell level Esc sequences from working naturally.
  • Esc Esc is 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_

View original on GitHub ↗

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