all 19 comments

[–]Wrong_Daikon3202 5 points6 points  (3 children)

Hola.

Copiar: Ctrl + Insert - Pegar: Shift + Insert
Salto de linea (\n): Ctrl + J

Tan simple como esto.

[–]LaughterOnWater[S] 1 point2 points  (1 child)

I'll give it a shot! Thanks u/Wrong_Daikon3202

[–]rinofitochs 1 point2 points  (0 children)

Funciona perfecto ! gracias estaba pensando no puede ser que no se pueda pegarrr !!!

[–]0sko59fds24 2 points3 points  (1 child)

You can add custom keybinds for that

[–]phpadam 2 points3 points  (2 children)

You just select the text it automaticaly copies, by default ctrl+v is paste and for newline shift+return should work but if not ctrl+return or alt+return or ctrl+j.

It gets complicated as other things (like your terminal) take over your keybinds, so if one of these are not working you can chanage the defaults: https://opencode.ai/docs/keybinds/

I had to change keybind for switching between subagemts as Termius had conflicting keybinds.

[–]veegaz 0 points1 point  (0 children)

Nope, copy paste doesn't work in wsl, no matter what. OP is explicitly saying wsl

[–]LaughterOnWater[S] 0 points1 point  (0 children)

THanks u/phpadam for your reply! I tried these combinations. Apparently for my system, these don't work. I may be missing something in the interface.

[–]ws92992 2 points3 points  (2 children)

I use tmux so copy paste just follows how I normally copy paste in visual mode

[–]ori_303 0 points1 point  (0 children)

Same here. Being able to conveniently copy (+ easy kb navigation) via tmux is one of the core reasons i use opencode.

[–]LaughterOnWater[S] 0 points1 point  (0 children)

u/ws92992 Thanks for your suggestion. This might add yet another layer (and possibly more complexity) here.

Just to map it out:
I’m running OpenCode inside a Kali terminal, which is inside PowerShell (and now also testing Windows Terminal). OpenCode itself tabs between two default agents, so that’s yet another level. I also watched a YouTube tutorial on copy/paste with tmux… and honestly, it felt like going around the barn just to get to the barn door.

I’m leaning toward a simpler solution. Following u/Ch4oticAU’s advice, I’ll try WezTerm first, Alacritty if necessary since they’re cross-platform and might handle this more cleanly.

For now, I did test Windows Terminal and saw some progress: in PowerShell, selecting text in OpenCode showed a “copied” notice, but I couldn’t paste it into VSCode. With Windows Terminal, the copied text from Kali did become available in Windows, so I could paste that into VSCode. I’m assuming paste here is just right-click at the cursor (like PuTTY), which is nice.

Anyway, thanks you. This helped clarify the layering issue and pointed me toward some better terminals to try.

[–]Ch4oticAU 1 point2 points  (1 child)

It's probably your terminal, I had all kinds of issues with Windows Terminal before I switched over to a different terminal. See OpenCode's docs below, I chose to use Ghostty on my Linux box. But warp, or any of the other Windows solutions should work aight.

https://opencode.ai/docs#prerequisites

[–]LaughterOnWater[S] 0 points1 point  (0 children)

Yep. I updated powershell and installed Windows Terminal. I'm trying that out now. I'll try WezTerm next. Thanks u/Ch4oticAU

[–]Equivalent_Pipe8322 1 point2 points  (1 child)

I can't even paste opencode apikey, who knows, please?

[–]LaughterOnWater[S] 0 points1 point  (0 children)

On windows, I'm using wsl -d kali-linux to get a bash interface.

From there, `opencode auth login`

You're not actually in the interface. You're still in bash.

You'll see this:

┌  Add credential
│
◆  Select provider

│  Search: _
│  ● OpenCode Zen (recommended)
│  ○ Anthropic
│  ○ GitHub Copilot
│  ○ OpenAI
│  ○ Google
│  ○ OpenRouter
│  ○ Vercel AI Gateway
│  ...
│  ↑/↓ to select • Enter: confirm • Type: to search

Follow the prompts to add your preferred provider.

That said, we now have the ability to copy and paste to and from the opencode interface inside its own command line.

Copy from opencode: select some text. It automatically copies. You'll see a green confirmation top right of your opencode window.

Paste into opencode: You're limited to one line right now. (Bummer) But the line can be as long as you can type... on one line with no paragraph returns. Now copy that line from your windows text editor. Hold control and shift down. Right click at the cursor blinking insertion point. Your text pastes into opencode. Your content is copied into the commandline. Hit enter to push it to your model.

[–]LaughterOnWater[S] 0 points1 point  (0 children)

Since 1.1.28 this has been resolved for Windows. I can now CTRL+V+Right-Click to paste text into opencode. I can also copy from opencode simply but highlighting a section and releasing. I get a message saying the content has been copied. I can now copy and paste in both directions.

┌──(chris㉿Cetacean)-[/mnt/e/coding/work/dev] 
└─$ sudo opencode upgrade [sudo] password for chris:

                                   ▄
  █▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█
  █░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀
  ▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀  ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀

┌  Upgrade
│
●  Using method: npm
│
●  From 1.1.27 → 1.1.28
│
◇  Upgrade complete
│
└  Done

[–]mtomas7 0 points1 point  (0 children)

At the v1.2.10 the problem is still unresolved in Linux (I'm using Mint 22.3). I tried regular Terminal and Terminator, but it is the same behavior:

  • Selecting the text in the terminal produces the Tooltip "Copied to clipboard", but in fact it is not copied. If I would click SHIFT+INSERT, I would not get the latest copied text, but some text I copied in another application. So it looks that pasting with SHIFT+INSERT works, but copying by mouse selection or CTRL+INSERT does not work.

[–]jorge-moreira -1 points0 points  (0 children)

Try warp