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 month 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

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

github-actions[bot] avatar Jan 08 '26 11:01 github-actions[bot]

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

github-actions[bot] avatar Jan 09 '26 02:01 github-actions[bot]