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
feat(tui): Support clipboard image paste in chat input #45198
When a user pastes an image from the clipboard into the TUI chat input, OpenCode should automatically save it as a temporary file and insert the @/path/to/image reference into the input field — rather than silently ignoring the image data.
Proposed Behavior
User copies an image (screenshot, etc.) to clipboard
User presses Ctrl+V in the TUI chat input
OpenCode detects the clipboard content is an image (not text)
Saves it to a temp file (e.g. /tmp/opencode-paste-<timestamp>.png)
Inserts @/tmp/opencode-paste-<timestamp>.png into the input field
User can then add a prompt and send as usual
Why This Matters
Currently the only way to attach an image in TUI is to manually save the file and type @path. This is cumbersome for common workflows like:
Pasting a screenshot of an error
Sharing a UI mockup for review
Attaching a diagram for architecture discussion
The Web UI already supports image drag-and-drop/paste, so TUI is inconsistent in this regard.
Implementation Notes
Detect if clipboard data is image binary (not text) on paste event
Save to /tmp/opencode-paste-<unix_timestamp>.png (or similar)
Auto-insert @<path> into the input buffer
Works with existing @file reference handling — no new infrastructure needed
This would make TUI image workflow consistent with Web UI, with minimal implementation complexity.
I do feel this might broke something in there, since last week when I updated opencode from 1 to 2, it lost the option of paste images, maybe you should double check for the process of clipboard, maybe when was added the task for images, forgot that images can get in different ways, losing the skill to paste images from the clipboard, I will need to rollback to version 1 because of it, sad, i was curious about version 2
I do feel this might broke something in there, since last week when I updated opencode from 1 to 2, it lost the option of paste images, maybe you should double check for the process of clipboard, maybe when was added the task for images, forgot that images can get in different ways, losing the skill to paste images from the clipboard, I will need to rollback to version 1 because of it, sad, i was curious about version 2
Can you share more about your setup, so i can try to reproduce the issue.
I do feel this might broke something in there, since last week when I updated opencode from 1 to 2, it lost the option of paste images, maybe you should double check for the process of clipboard, maybe when was added the task for images, forgot that images can get in different ways, losing the skill to paste images from the clipboard, I will need to rollback to version 1 because of it, sad, i was curious about version 2
Can you share more about your setup, so i can try to reproduce the issue.
I was using the version 1.18.16 and I got a news that we had a version 2, I just installed as recommended:
After that the image support isnt working anymore, I tried to use as normal, and i noticed it wasn't working, i went to foruns to check it more information, i tried to change some configurations to seek some kind of solution, and I coulnd't find a way, so I downgraded to the version 1, working fine.
what exactly isn't working, do you get an error when you try to paste an image, does anything happen.
No error, just i got that i can't paste the content, i didn't went to debug of it, as i tried to use, and noticed that wasnt working, so i rolled it back, to a functional version.
if possible, run with opencode --log-level all, try to paste an image, then share the relevant part from ~/.local/share/opencode/log/opencode.log
When you suggested this, wont work in opencode 1
opencode --log-level all
▄
█▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█
█ █ █ █ █▀▀▀ █ █ █ █ █ █ █ █▀▀▀
▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀
Commands:
opencode completion generate shell completion script
opencode acp start ACP (Agent Client Protocol) server
opencode mcp manage MCP (Model Context Protocol) servers
opencode [project] start opencode tui [default]
opencode attach <url> attach to a running opencode server
opencode run [message..] run opencode with a message
opencode debug debugging and troubleshooting tools
opencode providers manage AI providers and credentials [aliases: auth]
opencode agent manage agents
opencode upgrade [target] upgrade opencode to the latest or a specific version
opencode uninstall uninstall opencode and remove all related files
opencode serve starts a headless opencode server
opencode web start opencode server and open web interface
opencode models [provider] list all available models
opencode stats show token usage and cost statistics
opencode export [sessionID] export session data as JSON
opencode import <file> import session data from JSON file or URL
opencode github manage GitHub agent
opencode pr <number> fetch and checkout a GitHub PR branch, then run opencode
opencode session manage sessions
opencode plugin <module> install plugin and update config [aliases: plug]
opencode db database tools
Positionals:
project path to start opencode in [string]
Options:
-h, --help show help [boolean]
-v, --version show version number [boolean]
--print-logs print logs to stderr [boolean]
--log-level log level [string] [choices: "DEBUG", "INFO", "WARN", "ERROR"]
--pure run without external plugins [boolean]
--port port to listen on [number] [default: 0]
--hostname hostname to listen on [string] [default: "127.0.0.1"]
--mdns enable mDNS service discovery (defaults hostname to 0.0.0.0)
[boolean] [default: false]
--mdns-domain custom domain name for mDNS service (default: opencode.local)
[string] [default: "opencode.local"]
--cors additional domains to allow for CORS [array] [default: []]
-m, --model model to use in the format of provider/model [string]
-c, --continue continue the last session [boolean]
-s, --session session id to continue [string]
--fork fork the session when continuing (use with --continue or --session) [boolean]
--prompt prompt to use [string]
--agent agent to use [string]
--auto auto-approve permissions that are not explicitly denied (dangerous!)
[boolean] [default: false]
--mini start the minimal interactive interface [boolean] [default: false]
--no-replay disable mini session history replay on resume and after resize [boolean]
--replay-limit cap visible mini replay to the newest N messages [number]
Again, thanks for the help!
Cheers I am trying to help, but to be honest i tried to share everything here, no new configuration than installing of the version 2, i was using the version one, normally, doing everything fine, when i updated to version 2, the paste command does not show, one thing that i noticed while debuging it is:
I could see while i was trying to debug that the wl-paste wasnt showing an image, but i could see that i could go to chatgpt.com and add an image there from the clipboard fine without any issues, so that is why i said should be an opencode issue:
Did not work even with image preview true (i thoght as was introduced this new feature, coult it be this config with a false there and something could be breaking, but wasnt)
Fyi: With the same configurations i have in my computer, when i rolled it back to version 1, all the things are working fine, so maybe could be something related to wl-clipboard ? as i am using the same configs and works, but for the version 2 is missing something.
Activity
github-actions commentedon Aug 26, 2026
This issue might be a duplicate of or closely related to an existing issue. Please check:
simonklee commentedon Aug 26, 2026
I've implemented this in V2 which you can start using today.
strubloid commentedon Sep 28, 2026
I do feel this might broke something in there, since last week when I updated opencode from 1 to 2, it lost the option of paste images, maybe you should double check for the process of clipboard, maybe when was added the task for images, forgot that images can get in different ways, losing the skill to paste images from the clipboard, I will need to rollback to version 1 because of it, sad, i was curious about version 2
simonklee commentedon Sep 28, 2026
Can you share more about your setup, so i can try to reproduce the issue.
strubloid commentedon Sep 28, 2026
I was using the version 1.18.16 and I got a news that we had a version 2, I just installed as recommended:
After that the image support isnt working anymore, I tried to use as normal, and i noticed it wasn't working, i went to foruns to check it more information, i tried to change some configurations to seek some kind of solution, and I coulnd't find a way, so I downgraded to the version 1, working fine.
simonklee commentedon Sep 28, 2026
Thanks, for the reply, but could you share:
opencode --log-level all, try to paste an image, then share the relevant part from~/.local/share/opencode/log/opencode.logAgain, thanks for the help!
rme-scf commentedon Sep 28, 2026
When you suggested this, wont work in opencode 1
I could see while i was trying to debug that the wl-paste wasnt showing an image, but i could see that i could go to chatgpt.com and add an image there from the clipboard fine without any issues, so that is why i said should be an opencode issue:
I tried to also fix by adding a different keybind
Fyi: With the same configurations i have in my computer, when i rolled it back to version 1, all the things are working fine, so maybe could be something related to wl-clipboard ? as i am using the same configs and works, but for the version 2 is missing something.
I hope be able to help!