tui: image clipboard paste silently ignored on WSL2 Debian (regression 1.3.x → 2.1.2) · Issue #57724 · anomalyco/opencode · GitHub
Skip to content

tui: image clipboard paste silently ignored on WSL2 Debian (regression 1.3.x → 2.1.2) #57724

Open

Description

@zacra91

Summary

On WSL2 Debian, the OpenCode TUI (v2.1.2) silently ignores an image pasted from the Windows clipboard. The same workflow worked in OpenCode 1.3.x, and text paste still works. Claude in the same environment still handles image paste (user-reported), so this looks like an OpenCode TUI regression rather than a missing clipboard image.

Environment

  • opencode version: 2.1.2
  • OS: Linux 5.15.167.4-microsoft-standard-WSL2 (WSL2, Debian)
  • Terminal: TERM=xterm-256color, TERM_PROGRAM unset, WAYLAND_DISPLAY=wayland-0, DISPLAY=:0; exact terminal application not provided
  • Shell: /bin/bash
  • Install/channel: latest (opencode v2.1.2)
  • Active plugins: none found (~/.config/opencode/opencode.jsonc contains only $schema)

Reproduction

  1. In WSL2 Debian, take a screenshot with a Windows capture tool so the image is in the Windows clipboard.
  2. Start opencode (v2.1.2) in the TUI.
  3. Focus the prompt and press Ctrl+V (and Ctrl+Shift+V).
  4. Observe that no [image ...] attachment is added and no error/toast is shown. Text paste in the same prompt works.
  5. Reproduce the same clipboard image paste in Claude in the same WSL environment: the image is accepted. In OpenCode 1.3.x this also worked.

A PowerShell helper can read the same clipboard image and save it successfully:

Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$img = [System.Windows.Forms.Clipboard]::GetImage()
$img.Save('C:\Users\...\AppData\Local\Temp\nf-clipboard.png', [System.Drawing.Imaging.ImageFormat]::Png)

So the image is present on the Windows clipboard; OpenCode's TUI paste path is the failing part.

Expected Behavior

The pasted image is attached to the prompt and becomes visible to the model, as it did in OpenCode 1.3.x and as it does in Claude in the same environment.

Actual Behavior

Nothing happens: no image attachment, no [image ...] marker, no error or notification. The prompt only receives text paste events.

Additional Context

Activity

  1. opencode-agent commented on Oct 21, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report! I think this is a duplicate of #49895, which reports the same silent failure when pasting an image on WSL2 with OpenCode v2.

    Possible duplicates and related issues, ordered from most to least likely:

    Until the fix lands, two workarounds from the #49895 thread may help in your setup:

    • Your XDG_RUNTIME_DIR/wl-paste errors match one commenter's case. Pointing at the WSLg socket fixed it for them: run export WAYLAND_DISPLAY=/mnt/wslg/runtime-dir/wayland-0 before starting opencode.
    • Another user on the same WSL kernel (5.15.167.4) fixed it by updating WSL to 3.0.3.0 (wsl --update).

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions