Skip to content

Image paste (Ctrl+V) fails on Wayland with 'target STRING not available' #856

@riftzen-bit

Description

@riftzen-bit

Description

Pasting images from clipboard via Ctrl+V in Droid CLI fails on Wayland with error:

Error: target STRING not available

After installing xsel, text paste works but image paste still fails with the same error.

Root Cause

Droid's clipboard handler calls xsel --clipboard --output which only supports text (STRING target). When the clipboard contains an image (image/png), xsel cannot read it.

Claude Code CLI handles this correctly by detecting the clipboard MIME type, saving image data to a temp file, and attaching it as an image. Droid should do the same.

Environment

  • OS: Arch Linux (kernel 6.19.8-arch1-1)
  • Display server: Wayland (Ghostty terminal)
  • Clipboard tools available: wl-paste, xclip, xsel

Steps to Reproduce

  1. Copy an image to clipboard (screenshot, browser image, etc.)
  2. Open Droid CLI session
  3. Press Ctrl+V to paste

Expected: Image is pasted as an attachment (like Claude Code CLI)
Actual: Error: target STRING not available

Suggested Fix

  1. Detect clipboard content type before reading (check MIME via wl-paste --list-types on Wayland or xclip -selection clipboard -t TARGETS on X11)
  2. If image: read binary data via wl-paste (Wayland) or xclip -t image/png (X11), save to temp file, attach as image
  3. If text: read as text via current method
  4. On Wayland, prefer wl-paste over xsel for better compatibility

Workaround

wl-paste > /tmp/screenshot.png
# Then reference the file path in Droid

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions