anomalyco / anomalyco/opencode
Dialog prompts (API key in /connect, etc.) have no ctrl+v paste fallback — cannot paste when the terminal doesn't send bracketed paste
@kommander is already working on this.
Since Jul 31, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
The TUI's clipboard-reading ctrl+v fallback (prompt.paste) is bound only to the main session prompt: component/prompt/index.tsx registers it with target: inputTarget. Dialog text fields (ui/dialog-prompt.tsx — the API key / base URL prompts in /connect, workspace names, …) rely entirely on the terminal performing a bracketed paste.
On terminals that deliver ctrl+v as a plain key event instead (common on Windows: cmd, Git Bash, some ConPTY setups), the keypress is silently dropped in dialogs: the prompt.paste binding doesn't apply there, opentui's textarea handleKeyPress ignores ctrl-modified keys, and its default keybindings have no paste entry. So there is no way to paste an API key into /connect.
This is distinct from #35258 / #32851 / #26283 (main-prompt paste in specific terminals): even where the main prompt works via prompt.paste, dialogs still can't paste, because the fallback was never wired to them. #9922 reported this exact /connect symptom and was closed without the dialog path changing.
Suggested fix: register a dialog.prompt.paste command (default ctrl+v, mirroring input_paste) in DialogPrompt's existing priority-1 binding layer that reads the clipboard and inserts text/plain content (normalizing CRLF/CR). Bracketed paste keeps flowing through the textarea's built-in handler, and there's no double-paste risk since a terminal either intercepts ctrl+v or passes the key through, never both. I have this working in a fork (quickbeard/codev-code#145, incl. a view test) and am happy to send a PR.
Plugins
None
OpenCode version
1.18.4 (code paths unchanged on current dev)
Steps to reproduce
- Open opencode in cmd or Git Bash on Windows (any terminal that doesn't translate ctrl+v into a bracketed paste)
- Run
/connect, pick a provider, reach the "API key" prompt - Copy a key to the clipboard and press ctrl+v
- Expected: key appears in the field; Actual: nothing happens (typing works fine)
Operating System
Windows 10
Terminal
cmd, Git Bash (also reproducible in any terminal with its paste keybinding removed)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.