opencode
opencode copied to clipboard
feat: add double-ESC keybind to clear input field
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
The following comment was made by an LLM, it may be inaccurate:
No duplicate PRs found
Thanks for your contribution!
This PR doesn't have a linked issue. All PRs must reference an existing issue.
Please:
- Open an issue describing the bug/feature (if one doesn't exist)
- Add
Fixes #<number>orCloses #<number>to this PR description
See CONTRIBUTING.md for details.