anomalyco / anomalyco/opencode
tui: paste/drag-drop image attachments not supported in chat prompt
@simonklee is already working on this.
Since Aug 23, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
The v2 TUI does not support pasting or drag-and-dropping images into the
chat prompt. According to the v2 attachments documentation, "Desktop and
web clients provide Attach file, paste, and drag-and-drop controls for
supported text and image files", but those controls are not surfaced in
the TUI. As a workaround, the screenshot has to be saved to a file in
the working directory and explicitly read by the model.
Environment
- opencode version: opencode2 v0.0.0-next-17444
- OS: Linux 6.18.44 (NixOS, x86_64)
- Terminal: alacritty (TERM=xterm-256color, COLORTERM=truecolor)
- Shell: zsh (/run/current-system/sw/bin/zsh)
- Install/channel: local/next (side-by-side with opencode v1 1.18.21)
- Active plugins: none
Reproduction
- Copy an image to the clipboard (e.g. via satty, grim, or any
screenshot tool). - Launch
opencode2and open a session. - In the chat prompt, paste the image (Ctrl+Shift+V, middle-click,
etc.) and/or drag-and-drop an image file onto the TUI. - Observe that nothing is attached to the outgoing message.
Expected Behavior
Per the v2 attachments documentation, paste and drag-and-drop controls
should be available to attach PNG/JPEG/GIF/WebP images to a prompt so
the model receives them as image media, without needing to save them to
a file first.
Actual Behavior
Both paste and drag-and-drop are silently ignored by the TUI prompt.
The only workaround is to save the screenshot to a file in the working
directory and prompt the model with the file path, e.g. "can you check
the img i put in the dir and tell me what it is?".
Additional Context
- Docs reference: https://opencode.ai/v2/docs/attachments/
- Related quote: "Desktop and web clients provide Attach file, paste,
and drag-and-drop controls for supported text and image files." - Many modern terminals expose clipboard images via escape sequences
(Kitty/iTerm2 image protocol, OSC 52, etc.) or support Sixel/iTerm2
inline-image queries. Even without inline display, capturing pasted
image data and persisting it to a temporary attachment file would be
enough to satisfy the documented contract. - This was also filed against the opencode v1 TUI in spirit; this
report is specifically about the v2 (opencode2) binary.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.