Feature request: Paste to attach image
Not sure how possible it is, but I really enjoy using excalidraw when working with opencode. I like to copy the stuff as png and then paste it in LLMs to use. But opencode only support attachment via drag and drop, wonder is it possible to implement paste to add image
Correct me if I'm wrong, but you can paste using Control (not Command) + V. I use that all the time both in opencode and Claude Code. Check the keyboard shortcuts with /help.
For example, I screenshot part of the screen with Control + Shift + Command + 4, and then paste in using Control + V.
This is how it appears in the opencode.
@almirsarajcic Owh ya it works with CTRL+V.
But IMO should work for CMD + V for Macos. But feel free to close this issue if it's redundant
I was also confused until I tried Ctrl+V instead of Cmd+V. It just doesn't feel intuitive enough.
this seems to work with CMD V?
The documentation was a bit confusing (to me at least) in this regard, it states:
Drag and drop images into the terminal to add them to the prompt.
For me, copy‑and‑paste attaches the image as a [Image #1] placeholder, whereas dragging and dropping only inserts the path.
I tried in Arch Linux and here too. Ctrl + V Normal paste doesn't work.
For me Windows (Meta) Key + V Pasted Image. Text is pasted via Ctrl + V hence this is not intuitive
This would be a sick feature to have in opencode!
what os and terminal are you @jawadqur pasting images works for me
cmd+v would be better ➕ 1️⃣
There seems to be some weirdness here with wsl2 and wezterm on recognizing there's something to paste. Not sure where to start on looking for a fix
@sai-sy what happens does it just paste the path?
does literally nothing
Thanks! He/Him Saihaan "Sai" Syed
On Mon, Sep 29, 2025 at 1:05 AM Aiden Cline @.***> wrote:
rekram1-node left a comment (sst/opencode#906) https://github.com/sst/opencode/issues/906#issuecomment-3344916673
@sai-sy https://github.com/sai-sy what happens does it just paste the path?
— Reply to this email directly, view it on GitHub https://github.com/sst/opencode/issues/906#issuecomment-3344916673, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR3GQZLGA75QF4R7VI4SIOL3VC4YFAVCNFSM6AAAAACBLKBGMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNBUHEYTMNRXGM . You are receiving this because you were mentioned.Message ID: @.***>
ooo @itsrainingmani note: windows image pasting doesn’t seem to work
@rekram1-node I'm gonna make a new issue since this thread seems faily mac specific. I'm also curious if this is a wezterm issue, however since wezterm is listed as being one of multiple options which are necessary to get opencode run properly, i think it's relevant
https://github.com/sst/opencode/issues/2878
guys any update on this? I can drag and drop images but they don't get sent to the AI. But when I copy and paste the image, it works. Tried with glm-4.5v.
For me it was using ctrl + v instead cmd + v that fixed the issue on opencode and codex 😅
@ibehnam what terminal are u in, some of them dont send that drag & drop the same
and what os r u
Does not work on Ubuntu/terminator:
➜ opencode --version
1.0.120
➜ uname -a
Linux juliusz-Latitude-5421 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
➜ terminator --version
terminator 2.1.3
also does not work in terminal running in Intellij
@rekram1-node I use WSL Ubuntu and the screenshot does get's pasted using CTRL + V, text paste works fine, the image I can paste in vscode, and copilot chat as well but with opencode does not works.
Hey,
I am having the same issue:
On Windows Terminal, pwsh
Whatever I try, CTRL + V or ALT + V ( this works on claude code ) I don't see any visual feedback that the image is included in the prompt. I even tried CTRL + ALT + V
I would like to help out in this situation. Any ideas which libraries would need to be changed to make the support work with the Command + V combination? @kommander Im sure you have enough on your plate and I just restocked some Claude credits.
@tyrellshawn capturing super modifiers and especially something like cmd+c/v is tricky and not supported by all terminals, not even with kitty keyboard protocol.
If you have an image buffer in your clipboard which was properly put there as such, it should start with a file signature (magic bytes) that needs to be parsed to recognise raw image/file data. I would implement that parsing in opentui when data is pasted, checking for magic bytes, parse the header if present and add a fileType: string to the paste event, possibly with metadata from the header. That would solve it generically on library level.
Optionally, as the raw pasted data is just emitted with the paste event, opencode can do the magic byte parsing and recognize image types. I would prefer that on library level to generalise for other apps.
Then opencode needs to handle that raw data, either storing a temp file and referencing it or putting it into the session as message part directly.
@kommander Thank you for the quick and well detailed response. Another reason why I think your product is doing great and will become the best is the ability to articulate these concepts in a respectful and easy to understand way and I appreciate that. That being said if any contribution could be provided to help on a library level I would be interested in learning more!
On a completely separate note something that comes to mind is creating a terminal on top of opentui that could potentially make something like this less tricky?
It will have an integrated terminal with ghostty-vt, there is unfortunately nothing I know of that would make this easier that way. If you want you can give it a shot in the opentui repo. Ask claude to parse magic bytes and a potential image header for paste data in the keyhandler and to extend the paste event with an optional file type and file meta data. It should be able to generate some tests for the keyhandler and stdin.buffer around that.
what os and terminal are you @jawadqur pasting images works for me
WSL2 Ubuntu, pasting don't work at all
Hey @kommander I have developed a PR here https://github.com/anomalyco/opentui/pull/520 and tested on my setup. Seems like its handling the paste events fairly well but I'm sure the code could be better but worth a shot. lmk