opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Can't Paste content from clipboard

Open ntovarsolorzano opened this issue 1 year ago • 30 comments

Image

By any means I can't paste from clipboard, nor by middle clic, left clic, Cntrl+V, Shift+Cntrl+V, Insert, absolutely ANYTHING.

I am about to clone the code and ask gemini-pro to revise it for me if there is anything in the code that hinders me hehe 😣

How to reproduce:

  • Install as npm i -g opencode-ai@latest . [Current version: 0.2.33]
  • Open as opencode
  • Insert your API Key.
  • Paste your prompt that you have in clipboard. It just doesn't paste.

What I tried:

  • All the paste combination that I humanly know mouse, keyboard, etc..
  • Tried from MobaXterm remote SSH machine (linux endpoint)... nothing.
  • Tried on WSL2 in windows... didnt work either.

Am i missing something? I did a quick search in the Issues and I haven't found something related, so hopefully this is not a duplicate issue.

Best regards, Nelson.

ntovarsolorzano avatar Jul 12 '25 06:07 ntovarsolorzano

the default keybind for pasting text/images is ctrl+v, but depending on OS this can be troublesome. if you're running on linux, there should be some log output saying whether it found a clipboard tool in your PATH. can you paste some logs here? https://opencode.ai/docs/troubleshooting/#logs

adamdotdevin avatar Jul 15 '25 18:07 adamdotdevin

the default keybind for pasting text/images is ctrl+v, but depending on OS this can be troublesome. if you're running on linux, there should be some log output saying whether it found a clipboard tool in your PATH. can you paste some logs here? https://opencode.ai/docs/troubleshooting/#logs

Running apt install -y wl-clipboard as per noted in the docs fixed it for me (Arch, GNOME Wayland). I'm using opencode inside a distrobox, had to restart the container to make the newly installed dependency work. Thank you.

ryzen3100 avatar Jul 16 '25 20:07 ryzen3100

Hi, I come back just to report that it is working now simply using Cntrl+V (In Ubuntu 25.04 Wayland | Windows 10 , in both). Did you fix it in a recent update? I appreciate it so much, it is working now !! 🥹🥹🥹 God bless 🤗

ntovarsolorzano avatar Jul 17 '25 04:07 ntovarsolorzano

this feature only works on models that support image as an input right? (anthropic models i.e?)

pHequals7 avatar Aug 30 '25 18:08 pHequals7

if you wanna send a model images then yeah it needs image support, openai and google both have models that support image inputs not just anthropic, there are others too

rekram1-node avatar Aug 30 '25 18:08 rekram1-node

Image

Using Gemini 2.5 Pro on Opencode and it says it cannot access images :/

pHequals7 avatar Aug 31 '25 10:08 pHequals7

gemini 2.5 pro can definitely access images, if it says otherwise it is probably due to the previous context in session confusing llm

rekram1-node avatar Aug 31 '25 14:08 rekram1-node

Using wsl in wezTerm under windows, I had to use Ctrl-Shift-V to paste text.

hwacookie avatar Oct 06 '25 11:10 hwacookie

This is still an issue. Windows 10. wsl kali-linux. OpenCode 1.0.129 I'm just trying to paste in some text.

CTRL-V - nothing SHIFT-CTRL-V - nothing ???

LaughterOnWater avatar Dec 03 '25 18:12 LaughterOnWater

Win 11. I confirm also with mobaxterm not working also not working the right mouse. ssh via powershell works with ctrl+v but not with right mouse. Also in git bash no ctrl+v and no right mouse Seems something intercepts the right mouse click blocking the paste. Quite annoying

inalto avatar Dec 15 '25 09:12 inalto

i am on win 11 25h2 and have wsl (debian) and can copy and past (select the code and then right click to paste). But it would be great to document that better.

suse-coder avatar Dec 15 '25 19:12 suse-coder

I can't paste text on Mac with Ghostty terminal. cmd + v doesn't work at all and cmd + shift + V is pasting something that I haven't actually copied.

EDIT: To explain a little better:

  • I can paste text copied from the opencode conversation
  • I can't paste copied from outside, anywhere outside
  • I can paste normally in Ghostty, it just doesn't work in opencode.

bzhr avatar Dec 21 '25 20:12 bzhr

ctrl-shift-v works to paste here on Fedora 43, however, opencode comes back with Could not process image and stops.

geeknik avatar Dec 26 '25 16:12 geeknik

Do you expect me to type in my API keys by hand? Really?

OakerO avatar Dec 29 '25 13:12 OakerO

on Win 11 You can use git bash and "shift+insert" to paste the clipboard.

Lets7512 avatar Dec 30 '25 14:12 Lets7512

Annoying stupid bug.

revskill10 avatar Jan 19 '26 05:01 revskill10

to paste, make sure something is in the buffer in windows, mouse over and ctrl+x or ctrl+c

go to your SSH session and click on the text input window press shift + insert to paste.

this works on local terminal and SSH. tested with mobaXterm and it works.

stephen2422 avatar Jan 21 '26 20:01 stephen2422

But on a MacBook keyboard, there is no dedicated Insert (Ins) key.

to paste, make sure something is in the buffer in windows, mouse over and ctrl+x or ctrl+c

go to your SSH session and click on the text input window press shift + insert to paste.

this works on local terminal and SSH. tested with mobaXterm and it works.

gclsoft avatar Feb 20 '26 15:02 gclsoft

what happens when i run opencode inside a tmux inside a docker container, i don't think installing wl-clipboard will fix it, because there are no wailand in docker container...

niwinz avatar Mar 12 '26 22:03 niwinz

still not works on fedora 43 (on cinnamon x11), ctrl+shift+v paste the old clipboard content. xsel and xclip are installed Opencode CLI 1.2.24 on Gnome-terminal (whole OS updated)

abda11ah avatar Mar 15 '26 20:03 abda11ah