[BUG] Mouse-selection copy (drag-release auto-copy) silently fails to reach the clipboard on Wayland when wl-clipboard/xclip/xsel are missing (2.1.222; same missing-backend path as /copy in #67486, bot-closed as dup of unrelated #62350)

Status Fixed / completed
Reported on v2.1.222
Maintainer reply ✓ Yes — bcherny
Activity 3 comments · opened Aug 5, 2026 · closed Aug 24, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Preflight Checklist

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

What's Wrong?

Environment

  • Claude Code 2.1.222
  • Ubuntu 26.04, GNOME on Wayland (XDG_SESSION_TYPE=wayland), GNOME Terminal (VTE 0.84), bash
  • Stock desktop: none of wl-copy / xclip / xsel installed — Ubuntu does not

preinstall wl-clipboard (#67486 reproduced the same on 24.04, so it spans releases)

What happens

Witnessed on this machine (2026-08-05, 2.1.222, no clipboard utility installed):

  • Fullscreen renderer, mouse drag-release auto-copy: appears to succeed —

selection renders, release gives no error — but the system clipboard is
untouched: pasting yields its stale previous content. Zero output anywhere
to suggest a failure.

  • After sudo apt install wl-clipboard and an app restart — same fullscreen

renderer — drag-release copy work immediately. Renderer identical
on both sides; the only changed variables were the package and the restart.

Not independently re-tested pre-install: /copy and /export → clipboard on a
utility-less system — their identical silent failure is what #67486 documented.

Real-world cost: the symptom masquerades as a hardware/terminal fault. We spent a
full debugging session ruling out mouse switch chatter (libinput debug-events),
Bluetooth vs USB link, battery, GNOME Terminal mouse-reporting, and
CLAUDE_CODE_DISABLE_MOUSE before finding the actual cause: a missing package
that nothing ever complained about.

Version forensics (from this repo's CHANGELOG.md)

  • 2.1.160: WSL copy-on-select moved from OSC 52 to PowerShell interop
  • 2.1.161: "Fullscreen mode: clipboard now uses wl-copy/xclip/xsel on

Linux when available…" — matches the regression point reported in #67486
("regression from OSC 52 fallback, ~2.1.161")

  • 2.1.181: "Fixed /copy and copy-on-select on Linux not detecting a clipboard

utility installed after Claude Code started" — the stale-detection half of
#67486 is already fixed; this report is only about the remaining half

  • 2.1.222 (current): installed binary contains no literal ]52; escape

sequence, consistent with no OSC 52 fallback existing today; the silent failure
reproduces

Why a new issue (dedup trail — please don't bot-close onto the same chain)

  • #67486 reported exactly this (2.1.170, Ubuntu 24.04) and was auto-closed by the

triage bot as a duplicate of #62350

  • #62350 is a different bug — FleetView /copy inside tmux over VS Code Remote

SSH, an OSC 52 passthrough context — closed as completed on 2026-05-27,
before #67486 was even filed, and now locked

  • The local missing-backend case was therefore never actually triaged, and it

still reproduces on 2.1.222

Suggested fix

Fail loudly with an actionable message — "No clipboard utility found — install
wl-clipboard (Wayland) or xclip/xsel (X11)" — and/or restore an OSC 52 fallback
when no utility is present. Reporting success while the clipboard keeps stale
content is the worst outcome: it sends users off debugging their hardware.

What Should Happen?

Mouse drag-select (fullscreen copy-on-release) — should place the
selected text into the system clipboard. If no clipboard utility is installed,
Claude Code should fail loudly with "No clipboard utility found — install
wl-clipboard (Wayland) or xclip/xsel (X11)". It must never report success
while the clipboard keeps its stale previous content.

Error Messages/Logs

Steps to Reproduce

  1. Ubuntu GNOME Wayland desktop with no clipboard utility installed — stock state

(command -v wl-copy xclip xsel returns nothing)

  1. Put a known marker in the system clipboard (e.g. copy the word "MARKER" from

a text editor)

  1. Run claude in GNOME Terminal; switch renderer with /tui fullscreen
  2. Drag-select any response text with the mouse and release — no error appears,

selection behaves as if copied

  1. Paste (Ctrl+V) into any app

Expected: the selected text.
Actual: "MARKER" — the clipboard still holds its previous content; nothing
anywhere indicates the copy failed.

  1. sudo apt install wl-clipboard, restart Claude Code, repeat steps 2–5:

paste now yields the selected text.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.222

Platform

Other

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

3 Comments

dangowrt · 2 months ago

Reproduced on Arch Linux — confirms this spans distros and VTE-based terminals:

  • Claude Code 2.1.220, fullscreen renderer
  • Arch Linux, GNOME on Wayland (XDG_SESSION_TYPE=wayland), GNOME Console (kgx 50.0, VTE 0.84.1)
  • None of wl-copy / xclip / xsel installed (Arch doesn't pull in wl-clipboard on a standard GNOME install either)

Symptom identical to the report: drag-release selection shows the "copied" hint, no error anywhere, but the clipboard is never written — pasting always yields the previous stale content, 100% of the time.

Two suggestions:

  1. Detect the missing backend (at startup or on first copy attempt) and surface an error or install hint instead of reporting success. The spawn failure of the clipboard helper is already observable; the current behavior actively misleads the user into debugging their terminal/compositor.
  2. Note that falling back to OSC 52 would not cover this case for the GNOME default terminals: VTE silently discards OSC 52 (see #80184), so a missing-backend warning is the only honest option there.
bcherny collaborator · 1 month ago

Thanks for the exceptionally thorough report and the dedup trail. I tested this on the released build 2.1.233 on Linux with none of wl-copy/xclip/xsel installed, capturing all bytes the app writes to the terminal:

  • Mouse drag-release copy (fullscreen renderer): with no clipboard utility installed, releasing the selection now emits an OSC 52 clipboard sequence (verified: the captured payload base64-decodes to exactly the selected text) and shows a visible notice: "sent N chars via OSC 52 · if paste fails, hold Shift while selecting for native copy".
  • /copy: also emits OSC 52 with the correct payload when no utility is present.

So both parts of what you asked for — an OSC 52 fallback when no clipboard utility is installed, and an explicit on-screen indication instead of silent success-with-stale-clipboard — are present in a recent release. You verified 2.1.222 had no OSC 52 path, so this changed shortly after the version you tested.

One note: whether the paste ultimately works then depends on your terminal accepting OSC 52 (recent VTE/GNOME Terminal versions do, older ones may not) — but if it doesn't, the new on-screen hint points you to native selection rather than leaving you debugging hardware.

Could you upgrade to the latest version and confirm on your Ubuntu/Wayland setup? If the silent-failure behavior still reproduces there, please comment and we'll reopen.

🤖 Generated with Claude Code

github-actions[bot] · 15 hours ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.