Skip to content

[FEATURE]: Implement Double-ESC to trigger 'Restore/Undo' menu (Claude Code parity) #14037

@liony-hyh

Description

@liony-hyh

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:

  1. Discoverability: Users often forget slash commands like /undo. A visual menu triggered by a common "exit/back" key pattern is intuitive.
  2. 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").
  3. UX Consistency: As developers switch between AI CLI tools, adopting successful interaction patterns (like double-ESC) reduces cognitive load.

Current Behavior vs. Proposed

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.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions