-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)
Description
Summary
Implement a feature where double-pressing the ESC key opens a "Restore / Undo" interactive menu, similar to the behavior in Claude Code.
Motivation
In Claude Code, double-pressing ESC activates a Restore the code and/or conversation menu. This is a highly ergonomic feature for several reasons:
- Discoverability: Users often forget slash commands like
/undo. A visual menu triggered by a common "exit/back" key pattern is intuitive. - Granularity: Instead of immediately executing a rollback (which might be destructive or confusing), a menu allows the user to choose what to undo (e.g., "Undo last message", "Revert file changes", "Clear context").
- UX Consistency: As developers switch between AI CLI tools, adopting successful interaction patterns (like double-ESC) reduces cognitive load.
Current Behavior vs. Proposed
- Current: Users must type
/undomanually. Double-ESC is currently being discussed for "Clear Input" or "Interrupt" (PR feat: add double-ESC keybind to clear input field #7320, Add configurable double-Esc interrupt window #5787). - Proposed:
- If an operation is running -> Double-ESC interrupts (existing/planned).
- If input is populated -> Double-ESC clears input (planned).
- If input is empty (idle state) -> Double-ESC opens the Restore/Undo menu.
Desired UX
When the user is in the idle state and presses ESC twice quickly:
A TUI modal appears with options such as:
- ↩️ Undo last message
- ⏪ Revert changes to files
- ❌ Cancel
This would greatly enhance the safety and control users feel when interacting with the agent.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)