claude-code - 💡(How to fix) Fix [BUG] Image paste (Ctrl+V) silently fails on Wayland: `xclip` is blind to clipboard, `wl-paste` is not used as fallback

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

No error is shown in the UI. xclip (which appears to be what Claude Code calls) returns: Error: target image/png not available but this is not surfaced to the user.

Root Cause

Root cause: Claude Code relies on xclip to read the clipboard, but on a pure Wayland session xclip cannot read clipboard contents at all (not even ext written via wl-copy) — KDE/kwin does not bridge clipboard reads to XWayland clients in the way xclip expects. The wl-clipboard tools (wl-paste) read the clipboard correctly but Claude Code does not use them.

Code Example

No error is shown in the UI. `xclip` (which appears to be what Claude Code calls) returns: 
  Error: target image/png not available
but this is not surfaced to the user.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

On a Wayland session (KDE Plasma 6, Kubuntu 26.04), image paste with Ctrl+V at the Claude Code prompt does nothing — no attachment is added and no error is shown.

Root cause: Claude Code relies on xclip to read the clipboard, but on a pure Wayland session xclip cannot read clipboard contents at all (not even ext written via wl-copy) — KDE/kwin does not bridge clipboard reads to XWayland clients in the way xclip expects. The wl-clipboard tools (wl-paste) read the clipboard correctly but Claude Code does not use them.

This affects every Wayland-only desktop. On Kubuntu 26.04 the Plasma X11 session has been removed (startplasma-x11 and plasma-workspace-x11 are no longer available), so falling back to an X11 session is not an option.

What Should Happen?

Pressing Ctrl+V with an image on the clipboard should attach the image to the prompt, regardless of whether the session is X11 or Wayland. When wl-paste is available and the session is Wayland (XDG_SESSION_TYPE=wayland or WAYLAND_DISPLAY set), Claude Code should prefer wl-paste over xclip, or use it as a fallback when xclip returns "target not available".

At a minimum, image paste should surface a clear error/warning when the clipboard read fails, instead of silently doing nothing.

Error Messages/Logs

No error is shown in the UI. `xclip` (which appears to be what Claude Code calls) returns: 
  Error: target image/png not available
but this is not surfaced to the user.

Steps to Reproduce

  1. On a Wayland KDE session (Kubuntu 26.04 / Plasma 6), install both clipboard backends: sudo apt install wl-clipboard xclip
  2. Copy an image to the clipboard (e.g. Spectacle → "Copy to clipboard").
  3. Verify the clipboard contains the image with wl-paste: wl-paste --list-types # shows image/png + many others wl-paste --type image/png | wc -c # returns a non-zero byte count
  4. Verify xclip cannot see it (and cannot see ANY clipboard content, including text): xclip -selection clipboard -t image/png -o # Error: target image/png not available echo "test" | wl-copy xclip -selection clipboard -o # Error: target STRING not available
  5. Start Claude Code (any version that supports image paste) and press Ctrl+V at the prompt.
  6. Observe: nothing happens — no attachment, no error.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.143

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

Operating system

Kubuntu 26.04 LTS (Ubuntu 26.04) Desktop: KDE Plasma 6.6.4 Session: Wayland (XDG_SESSION_TYPE=wayland, WAYLAND_DISPLAY=wayland-0) Terminal: Konsole Clipboard tools installed: wl-clipboard (wl-paste, wl-copy) + xclip

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING