Feature Request: Double Escape to Clear Input

Resolved 💬 0 comments Opened Aug 8, 2025 by ajanraj Closed Nov 27, 2025

Summary

Add a double escape to clear input feature similar to Claude Code's functionality, allowing users to quickly clear text input by pressing Escape twice within a 1-second window.

Motivation

Currently, users need to manually select and delete all text to clear the input field, which can be tedious for long prompts or when switching contexts quickly. A double escape shortcut would significantly improve the user experience by providing a fast, keyboard-only way to clear input.

Proposed Solution

Implement a double escape mechanism that:

  • Detects when Escape is pressed twice within 1 second
  • Shows visual feedback "Press Escape again to clear" after first escape
  • Clears all input state (text, selections, popups, etc.) on second escape
  • Automatically hides the feedback message after timeout

Expected Behavior

  1. User types some text in the input field
  2. User presses Escape once → Shows "Press Escape again to clear" message
  3. If user presses Escape again within 1 second → Clears all input and hides message
  4. If user waits >1 second → Message disappears, input remains unchanged
  5. If input field is empty → Escape behaves normally (no double escape logic)

Implementation Notes

This should work consistently across both:

  • TypeScript build (codex-cli/)
  • Rust build (codex-rs/)

Additional Context

This feature exists in Claude Code and provides an excellent user experience for quickly clearing input without mouse interaction. It would be particularly valuable for power users who prefer keyboard-only workflows.

View original on GitHub ↗