[BUG] Right-click paste duplicates text in Claude Code TUI on VS Code integrated terminal (Ubuntu/Wayland) — not reproducible in plain bash in same terminal

Status Open
Reported on v2.1.226
Maintainer reply None cached
Activity 0 comments · opened Aug 10, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet (closest are #82238 — opposite symptom, right-click paste does nothing — and #82678, closed, same byte-identical duplication symptom but root-caused to the host terminal app double-writing to the pty, which doesn't match this report — see below)
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code (confirmed via claude update)

What's Wrong?

Right-click paste into the Claude Code prompt inserts the pasted text twice, concatenated with no separator, when running inside VS Code's integrated terminal on Ubuntu 22.04 (GNOME, Wayland session).

Critically, this is isolated to Claude Code's own input handling, not the terminal: right-click-pasting the same clipboard content into a plain bash prompt in the exact same terminal (same session, same paste mechanism, same settings) inserts it only once. This rules out the terminal/pty/clipboard stack as the cause — it points at Claude Code's own paste parsing (likely its bracketed-paste handling).

This differs from the closed #82678: that report's duplication was traced to the host Electron terminal app itself writing the clipboard to the pty twice (its own hand-rolled paste handler plus xterm.js's native paste event both firing), which would double paste for any program in that terminal, including bash. Here, bash is unaffected and only Claude Code doubles it, so the same "duplicate write at the host terminal" explanation cannot apply.

Troubleshooting already ruled out:

  • Changing VS Code's terminal.integrated.rightClickBehavior from the default (context menu) to "paste" (direct paste, no menu) — no change.
  • claude update to the latest version — no change.
  • GNOME touchpad/accessibility settings (click-method: default, tap-to-click: true, no click-assist/secondary-click-simulation features enabled) — nothing unusual.
  • VS Code is running natively via --ozone-platform=wayland (not falling back to XWayland), so this isn't the known Wayland/XWayland Electron double-event class of bug.

What Should Happen?

Right-click paste should insert the clipboard content exactly once, matching the behavior of a plain shell prompt in the same terminal.

Steps to Reproduce

  1. On Ubuntu 22.04 with a GNOME/Wayland session, open VS Code (1.132.0) and use its integrated terminal.
  2. Copy some text to the clipboard.
  3. At a plain bash prompt in that terminal, right-click to paste — text appears once, as expected.
  4. Run claude to start Claude Code in that same terminal.
  5. Right-click to paste the same clipboard text into the Claude Code prompt — the text appears twice, concatenated with no separator.

Reproduces both with VS Code's default right-click context-menu paste and with "terminal.integrated.rightClickBehavior": "paste" (direct paste).

Is this a regression?

I don't know

Claude Code Version

2.1.226 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

  • Desktop session: GNOME on Wayland (XDG_SESSION_TYPE=wayland); VS Code confirmed running with --ozone-platform=wayland (native Wayland Electron backend, not XWayland).
  • Right-click paste is via laptop touchpad secondary-click (not an external mouse).
  • Related issues for context: #82238 (right-click paste does nothing at all, ChromeOS Crostini — opposite symptom, may share root cause in Claude Code's mouse/paste handling on Linux terminals) and #82678 (closed — similar byte-identical no-separator duplication pattern, but explicitly root-caused to the host terminal app, not Claude Code; that explanation doesn't fit here since plain bash in the same terminal is unaffected).

View original on GitHub ↗