opencode icon indicating copy to clipboard operation
opencode copied to clipboard

I can't paste text with CTRL+V or right mouse click when running inside WSL

Open dliedke opened this issue 3 months ago • 14 comments

When running opencode inside WSL, I can't paste text with CTRL+V or right mouse click. The only option that works is in the menu

Image

dliedke avatar Oct 10 '25 18:10 dliedke

This issue might be a duplicate of existing issues. Please check:

  • #2878: Pasting images doesn't work on WSL2 Wezterm (similar WSL paste issues with Ctrl+V)
  • #1202: Attachements do not work on WSL (general WSL paste/attachment problems)
  • #2948: copy-paste does not work (general paste functionality issues - closed)
  • #909: Can't Paste content from clipboard (Ctrl+V not working - closed)

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Oct 10 '25 18:10 github-actions[bot]

@dliedke can u try: Ctrl-Shift-V

rekram1-node avatar Oct 10 '25 19:10 rekram1-node

Did not work. Not even WIN+V and paste with Windows clipboard.

Right click works with any coding agent inside WSL except opencode.

dliedke avatar Oct 10 '25 20:10 dliedke

Hm okay thx for raising, we will look into this cc @itsrainingmani

rekram1-node avatar Oct 10 '25 20:10 rekram1-node

Thanks, really appreciate it. I plan to integrate opencode into my Claude Code Visual Studio extension once the paste is fixed.

dliedke avatar Oct 10 '25 20:10 dliedke

so idk if this is fixed?, but maybe try restarting your pc , using another terminal , replugging your keyboard. anything, or its a software bug

ermaxlu avatar Oct 29 '25 18:10 ermaxlu

Retested in version v0.15.26 and not working. Even in more than one machine. It is a software bug.

dliedke avatar Oct 29 '25 18:10 dliedke

It works for Claude Code, Codex and Cursor. Right click should paste the text inside WSL. Thank you!

dliedke avatar Oct 29 '25 18:10 dliedke

ctrl + v and paste from raycast worked for me for text in v1.0.10 with windows terminal + wsl arch whats still bugging for me is unability to paste a photo/image/attachment into text input

althafdemiandra avatar Nov 02 '25 05:11 althafdemiandra

I tested opencode v1.0.11 in WSL (Windows 11 25H2) and paste with CTRL+V or right mouse click is still not working. If I select a text in opencode then it is copied to the clipboard. But pasting is still not working.

dliedke avatar Nov 02 '25 12:11 dliedke

I tried here with Claude Code with no luck.

The Real Problem

The paste issue you're experiencing with bun dev is a known bug in opentui itself, not in the Go input code: Issue #3397: Multi-line paste with Ctrl+Shift+V pastes as single line; Ctrl+V doesn't work Issue #3343: Pasting multi-line snippets in Windows Terminal fails Issue #3081: The issue you asked me to fix (WSL paste)

All three are the same underlying opentui bug affecting Windows, WSL, and various Linux terminals.

Recent opentui Fixes PR #239 (merged Oct 27): "Pass Paste Event Instead of Just Pasted Text" - changed how paste events are handled Version 0.1.32 (published Nov 2): Should include the paste fix, but apparently it's not complete

Solutions Option 1: Report to opentui team The paste bug needs to be fixed in opentui itself. Even though v0.1.32 includes PR #239, the issue persists. Option 2: Wait for the next opentui release The team is aware and actively working on paste-related issues. Option 3: Use the Edit -> Paste menu workaround You mentioned this works - it uses Clipboard.read() directly instead of relying on bracketed paste events.

dliedke avatar Nov 02 '25 16:11 dliedke

Still an issue - Opencode 1.0.129, Windows 10, wsl kali-linux, ctrl-v, ctrl-shft-v, right-click over cursor... :/

LaughterOnWater avatar Dec 03 '25 18:12 LaughterOnWater

I ran into the same issue, and ctrl+shift+v worked for me (even though regular ctrl+v doesn't work) when using Windows Terminal

SebastienGllmt avatar Dec 17 '25 02:12 SebastienGllmt

ctrl+shift+v and ctrl+v still does not work... v1.0.174

gliatti avatar Dec 20 '25 10:12 gliatti