You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tui: v2.4.1 on WSL2 shows "Copied to clipboard" on select, but Ctrl+V paste does nothing; disabling mouse breaks scrollback #65913
After upgrading to OpenCode v2.4.1 on WSL2 (Windows Terminal), selecting text in the TUI displays the "Copied to clipboard" toast, but pasting with Ctrl+V does not work (this worked in the immediately preceding release used an hour earlier). Disabling mouse capture ("mouse": false) as a workaround makes mouse-wheel scrolling unusable because the wheel cycles through prompt command history instead of scrolling the session transcript.
Environment
opencode version: 2.4.1
OS: Linux 6.18.58.1-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC x86_64 GNU/Linux (Ubuntu 26.04.1 LTS on WSL2)
Terminal: Windows Terminal (WT_SESSION set, TERM=xterm-256color, TERM_PROGRAM unset, COLORTERM unset)
Display / clipboard environment: DISPLAY=:0, WAYLAND_DISPLAY=wayland-0, XDG_RUNTIME_DIR=/run/user/1000 (/run/user/1000/wayland-0 symlinks to /mnt/wslg/runtime-dir/wayland-0); wl-copy, xclip, and xsel not installed (clip.exe and powershell.exe present via WSL interop)
Active plugins: two local workspace plugins (PATH shims and skill-origin guard; neither touches clipboard or mouse handling)
Reproduction
Run opencode (v2.4.1) in Windows Terminal inside WSL2 Ubuntu 26.04.1 LTS with default cli.json ("mouse": true).
Select text from a session response with the mouse. The TUI displays "Copied to clipboard".
Attempt to paste with Ctrl+V.
Set "mouse": false in ~/.config/opencode/cli.json (or via Open settings) to restore native terminal selection, then scroll with the mouse wheel.
Expected Behavior
Text reported as "Copied to clipboard" is actually written to the Windows clipboard and pastes cleanly with Ctrl+V, as it did prior to upgrading to v2.4.1.
Disabling mouse capture does not hijack mouse-wheel scrolling into prompt command history without a working way to scroll the transcript.
Actual Behavior
With "mouse": true (default in v2.4.1), selecting text shows the "Copied to clipboard" toast, but Ctrl+V does not paste the selected text.
With "mouse": false, mouse-wheel scrolling sends Up/Down arrow navigation in alternate screen mode, cycling through previous prompt commands instead of scrolling the screen.
Additional Context
Reproducible consistently (100% since upgrading to v2.4.1).
Worked in the prior installed OpenCode release (~1 hour before upgrading to v2.4.1).
Holding Shift while dragging with "mouse": true is a partial workaround to select via Windows Terminal, but breaks normal copy/paste flow.
Thanks for the detailed report. A few details would help narrow this down:
Where does Ctrl+V fail? Is it when pasting into a Windows app (Notepad, a browser) after selecting text in OpenCode, or when pasting into the OpenCode prompt? In the OpenCode prompt, Ctrl+V is bound to prompt.paste, which reads the clipboard itself, so it can fail separately from copying. If it's the prompt, does Ctrl+Shift+V (Windows Terminal's own paste) work there?
Which version worked? Please give the exact version you ran before upgrading (for example 2.4.0 or a 2.3.x). If you can, run that version again to confirm it still works on the same machine.
About the mouse wheel with "mouse": false: you can still scroll the transcript with the keyboard. session.page.up is bound to pageup and ctrl+alt+b, and session.page.down to pagedown and ctrl+alt+f.
You can reply here with the details or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know when you're done.
Additional test: installed xclip inside WSL2 Ubuntu 26.04.1 LTS; selecting text in v2.4.1 still shows "Copied to clipboard" while Ctrl+V does not paste.
Opened #66310 with a fix: when the native host clipboard does not write on WSL, the TUI now writes through powershell.exe interop before trusting the OSC 52 result, and reports an error instead of a false toast when that fails too.
Same on v2.4.3 (Windows Terminal 1.25.3131, WSL2 Ubuntu 26.04, WSLg), so the latest release still has it.
Two extra details:
After a drag-select in the TUI the Windows clipboard isn't just stale, it's emptied: Get-Clipboard -Raw returns nothing, while "Copied to clipboard" appears.
OSC 52 works here: printf '\033]52;c;<base64>\a' in a plain tab reaches the Windows clipboard, and Shift+drag → Ctrl+C also works.
Happy to test a build from #66641 on this machine.
Thanks for the report! This looks like the same bug as #59664, so I'm closing this one to keep the discussion in one place. If yours turns out to be different, leave a comment and we'll reopen it.
Activity
opencodejr commentedon Nov 23, 2026
Thanks for the detailed report. A few details would help narrow this down:
Ctrl+Vfail? Is it when pasting into a Windows app (Notepad, a browser) after selecting text in OpenCode, or when pasting into the OpenCode prompt? In the OpenCode prompt,Ctrl+Vis bound toprompt.paste, which reads the clipboard itself, so it can fail separately from copying. If it's the prompt, doesCtrl+Shift+V(Windows Terminal's own paste) work there?2.4.0or a2.3.x). If you can, run that version again to confirm it still works on the same machine.DISPLAY=:0 opencodechange anything? A comment on TUI: "Copied to clipboard" toast shown even when nothing was copied (OSC52 "attempted" treated as success) #59664 reports that this made copying reach the Windows clipboard in one WSL setup.About the mouse wheel with
"mouse": false: you can still scroll the transcript with the keyboard.session.page.upis bound topageupandctrl+alt+b, andsession.page.downtopagedownandctrl+alt+f.You can reply here with the details or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know when you're done.
Related issues, ordered by likelihood:
"mouse": false, reported on V1virafb commentedon Nov 23, 2026
Additional test: installed
xclipinside WSL2 Ubuntu 26.04.1 LTS; selecting text inv2.4.1still shows "Copied to clipboard" whileCtrl+Vdoes not paste.weboliver commentedon Nov 24, 2026
with opencode --log-level debug - Clipboard works // Strange
I downgraded and wait: opencode upgrade 2.3.2 && opencode service restart
PhonezM commentedon Nov 25, 2026
Opened #66310 with a fix: when the native host clipboard does not write on WSL, the TUI now writes through
powershell.exeinterop before trusting the OSC 52 result, and reports an error instead of a false toast when that fails too.virafb commentedon Nov 26, 2026
Answers to the follow-up questions:
Ctrl+Vfails: Both — pasting into Windows apps and pasting into the OpenCode prompt both fail (the Windows clipboard is not updated).v2.3.2. After downgrading back tov2.3.2on the same machine, copy/paste works fine again.DISPLAY=:0:DISPLAY=:0was already set in the environment whenv2.4.1failed.menschenfracht commentedon Dec 1, 2026
Same on v2.4.3 (Windows Terminal 1.25.3131, WSL2 Ubuntu 26.04, WSLg), so the latest release still has it.
Two extra details:
Get-Clipboard -Rawreturns nothing, while "Copied to clipboard" appears.printf '\033]52;c;<base64>\a'in a plain tab reaches the Windows clipboard, and Shift+drag → Ctrl+C also works.Happy to test a build from #66641 on this machine.
neriousy commentedon Dec 2, 2026
Thanks for the report! This looks like the same bug as #59664, so I'm closing this one to keep the discussion in one place. If yours turns out to be different, leave a comment and we'll reopen it.