opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: add double-ESC keybind to clear input field

Open lifefloating opened this issue 1 week ago • 2 comments

Summary

  • Add double-ESC keyboard shortcut to clear input field content
  • Add documentation for the new shortcut

Motivation

Many popular CLI tools have adopted this pattern:

  • Claude Code - supports double-ESC to clear input
  • Gemini CLI - supports double-ESC to clear input

This has become a common UX pattern that users expect in terminal-based AI assistants.

Changes

  • packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx: Implement double-ESC detection (300ms threshold) to clear input
  • packages/web/src/content/docs/keybinds.mdx: Add documentation under "Desktop prompt shortcuts"

Proofs

https://github.com/user-attachments/assets/a1360c79-aeb9-4e81-834a-afdd198d3bbf

closes

7319

lifefloating avatar Jan 08 '26 11:01 lifefloating