Skip to content

tui: paste/drag-drop image attachments not supported in chat prompt #44310

Closed

Description

@amirh-amini

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

  1. Copy an image to the clipboard (e.g. via satty, grim, or any
    screenshot tool).
  2. Launch opencode2 and open a session.
  3. In the chat prompt, paste the image (Ctrl+Shift+V, middle-click,
    etc.) and/or drag-and-drop an image file onto the TUI.
  4. 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.

Activity

  1. changed the title [-]tui: pasting images into the chat prompt is not supported[/-] [+]tui: paste/drag-drop image attachments not supported in chat prompt[/+] on Aug 23, 2026
  2. github-actions commented on Aug 23, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is not covered by these, please add any additional context that distinguishes it.

  3. redstonepro109 commented on Sep 5, 2026

    @redstonepro109

    I think I found an important clue for this on Windows 11.

    Image/screenshot clipboard paste in opencode2 does not work for me when OpenCode is launched normally.

    However, if I launch the terminal / opencode2 elevated (Run as Administrator), pasting the exact same screenshot from the Windows clipboard works.

    Reproduction on Windows 11:

    1. Take a screenshot/snippet so the image is in the Windows clipboard.
    2. Launch opencode2 normally.
    3. Try to paste the screenshot into the TUI → image paste does not work.
    4. Close it.
    5. Launch the terminal as Administrator and start opencode2.
    6. Paste a screenshot again → image paste works.

    So this appears to be dependent on the Windows process security/elevation context.

    There may be some clipboard-access/integrity-level issue in the Windows clipboard-reading path. I wouldn’t call that confirmed yet, but the elevated vs. non-elevated behavior is consistently reproducible on my machine.

    It may be useful to compare which Windows clipboard API/process is being invoked by opencode2 in the two cases.

  4. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Thanks for the report! TUI image attachments are supported in 2.0.4, including a Nix/Wayland clipboard fix: select an image-capable model, then press Ctrl+V to attach a clipboard image or drag an image file into the prompt. Update with opencode upgrade or npm i -g @opencode/cli@latest (desktop: update the app). Please comment or reopen if this still happens on that version or later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions