opencode icon indicating copy to clipboard operation
opencode copied to clipboard

can not copy and paste in opencode CLI

Open hongyesuifeng opened this issue 9 months ago • 67 comments

Description

I can not copy and paste in opencode,right top show copied to clipboard,but when I ctrl+v,nothing to paste

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

hongyesuifeng avatar Feb 17 '26 15:02 hongyesuifeng

This issue doesn't fully meet our contributing guidelines.

What needs to be fixed:

  • Steps to reproduce field is empty - please provide detailed steps to reproduce the issue
  • Operating System field is empty - please specify your OS (Windows/macOS/Linux)
  • Terminal field is empty - please specify which terminal emulator you're using
  • OpenCode version field is empty - please specify your OpenCode version

Please edit this issue to address the above within 2 hours, or it will be automatically closed.


Note: This issue might be a duplicate of existing paste/clipboard issues. Please check:

  • #13800: Ctrl+V paste not working on Windows 11 TUI
  • #4283: Copy To Clipboard is not working
  • #7048: Copy Text "Copied to clipboard" does never work
  • #11148: TUI: Can not paste certain string
  • #13878: Copy to clipboard does not copy previously pasted lines properly

If you believe this was flagged incorrectly, please let a maintainer know.

github-actions[bot] avatar Feb 17 '26 15:02 github-actions[bot]

Plugins None

OpenCode version 1.2.6

Steps to reproduce Select a text in opencode. Paste in a text app, the selected text was not copied and won't be pasted.

Screenshot and/or share link It's hard to screenshot this.

Operating System Linux

Terminal GNOME Terminal

wranvaud avatar Feb 17 '26 19:02 wranvaud

I meet the same issue

Plugins None

OpenCode version 1.2.7

Steps to reproduce Select a text in opencode. Paste in a text app, the selected text was not copied and won't be pasted.

Screenshot and/or share link It's hard to screenshot this.

Operating System Linux (Ubuntu 25.10)

Terminal GNOME Terminal

spaceater avatar Feb 20 '26 05:02 spaceater

can copy but it does not paste to other windows like gedit, vscode etc.. So cannot connect mcp streaming http server for authorization. Furthermore it takes a huge amount of time to tell OC how to use OAuth with DCR and well known authorization endpoints. Ubuntu 25.10 , standard terminal .

Image

symdeb avatar Feb 22 '26 15:02 symdeb

I meet the same issue

Plugins None

OpenCode version 1.2.7

Steps to reproduce Select a text in opencode. Paste in a text app, the selected text was not copied and won't be pasted.

Screenshot and/or share link It's hard to screenshot this.

Operating System Linux (Ubuntu 25.10)

Terminal GNOME Terminal

I update to 1.2.10 and this bug has been fixed.

spaceater avatar Feb 22 '26 18:02 spaceater

can copy but it does not paste to other windows like gedit, vscode etc.. So cannot connect mcp streaming http server for authorization. Furthermore it takes a huge amount of time to tell OC how to use OAuth with DCR and well known authorization endpoints. Ubuntu 25.10 , standard terminal .

Image

try update

spaceater avatar Feb 22 '26 18:02 spaceater

1.2.10 not working. After installing xsel it works

symdeb avatar Feb 23 '26 03:02 symdeb

I'm seeing this issue as well. Already have xsel. Upgrading from 1.2.10 to 1.2.11 did not help.

Debian 12 Gnome Terminal No plugins

realmilsky avatar Feb 25 '26 01:02 realmilsky

i have seen it work once but now it does work not anymore.

On Wed, Feb 25, 2026, 09:59 realmilsky @.***> wrote:

realmilsky left a comment (anomalyco/opencode#13984) https://github.com/anomalyco/opencode/issues/13984#issuecomment-3956230934

I'm seeing this issue as well. Already have xsel. Upgrading from 1.2.10 to 1.2.11 did not help.

— Reply to this email directly, view it on GitHub https://github.com/anomalyco/opencode/issues/13984#issuecomment-3956230934, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEVIMITAJWEJX5JT4C4YJXD4NT6Y7AVCNFSM6AAAAACVNM6XJSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSNJWGIZTAOJTGQ . You are receiving this because you commented.Message ID: @.***>

symdeb avatar Feb 25 '26 03:02 symdeb

  1. copy/paste from opencode for wayland needs wl-clipboard, use normal xtrl-c/p.
  2. copy from opencode to other app ctrl-shift-p

symdeb avatar Feb 25 '26 03:02 symdeb

cant even paste my API Code wow

arnavatsim74-alt avatar Feb 25 '26 14:02 arnavatsim74-alt

meet the same issue ubuntu 24 Terminator ctrl + shift + c and ctrl +shift + v not work

zalcit avatar Feb 26 '26 02:02 zalcit

Other thread here https://github.com/anomalyco/opencode/issues/4283#issuecomment-3963467079

symdeb avatar Feb 26 '26 07:02 symdeb

I've found a workaround (that works for me at least). Use the new OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true environment var and then hold down shift while dragging the mouse over what you want to copy to the clipboard. On my system (Fedora but running opencode in a podman container) the selection is then automatically copied to the clipboard and I can middle click paste it.

dustymabe avatar Mar 03 '26 15:03 dustymabe

I've found a workaround (that works for me at least). Use the new OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true environment var and then hold down shift while dragging the mouse over what you want to copy to the clipboard. On my system (Fedora but running opencode in a podman container) the selection is then automatically copied to the clipboard and I can middle click paste it.

thanks! for me, without working with that ENV var, i can hold shift while marking the text, then it doesnt use the auto-copy (which doesnt work for me in ubuntu-vm) - and then i can press ctrl+shift+c to really copy!

patrickzzz avatar Mar 08 '26 10:03 patrickzzz

I'm stuck at the first step because of this, I cannot copy the auth url for claude pro....

izissise avatar Mar 09 '26 10:03 izissise

I meet the same issue. windows 11 I modified the cmd settings of checked the option of 'use ctrl+shift+c/v to copy and paste', it can work with ctrl + shift + c and ctrl +shift + v

jimmyliuzm avatar Mar 10 '26 09:03 jimmyliuzm

This issue does not happen in ghostty but as mentioned in earlier comments usually holding shift in default terminal skips the auto-copy functionality and let's you use the built-in text selection and context menu of the terminal emulator.

peltax avatar Mar 13 '26 16:03 peltax

Here is a working AHK 1.1 script with conditional check for cmd.exe (change it by right click tray icon, Window Spy)

#IfWinActive ahk_class ConsoleWindowClass ahk_exe cmd.exe

^SC02F::
SendRaw %Clipboard%
return

RButton::
Click right
Sleep 50
SendRaw %Clipboard%
return

#IfWinActive

—

I can’t believe this bug is real. I was loving OpenCode Desktop, thought “hey, let’s try the CLI too!” and then BAM—this is the bug? After 17,548 issues, we’ve landed on... copy-paste doesn’t work. Comedy gold.

2024-LTSC-IoT 26100.8037

It's not me, it's them 🤣

grand-lotus-iroh avatar Mar 19 '26 13:03 grand-lotus-iroh

Yeah, I was very surprised to find I can't paste anything to my opencode on Linux. Hope it will be fixed soonish

grouzen avatar Apr 06 '26 18:04 grouzen