Feature Request: Double Escape to Clear Input
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
- User types some text in the input field
- User presses Escape once → Shows "Press Escape again to clear" message
- If user presses Escape again within 1 second → Clears all input and hides message
- If user waits >1 second → Message disappears, input remains unchanged
- 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.