[BUG] Middle-click paste inserts text twice in the TUI (VS Code terminal, Linux X11) — regression of #67857 in 2.1.281
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?
Body:
Description
Middle-click paste (X11 PRIMARY selection) into the Claude Code prompt inserts the text twice
(e.g. selecting anywhere and middle-clicking gives anywhereanywhere).
Same symptom as #67857 (fixed/locked), but still reproducible in 2.1.281.
Environment
- Claude Code 2.1.281 (CLI, running in the VS Code integrated terminal)
- VS Code 1.138.0
- Ubuntu 24.04, GNOME on X11
Steps to reproduce
- Select a word in any application (VS Code editor, gedit, another terminal).
- Middle-click in the Claude Code prompt.
Expected
The text is pasted once.
Actual
The text is pasted twice.
Diagnostics
- In a plain bash prompt in the same VS Code terminal, middle-click pastes once.
- Middle-click into Claude Desktop pastes once.
- Right-click > Paste / Ctrl+Shift+V in the Claude Code prompt paste once.
xinput testshows a single button-2 press/release per click (the mouse is not double-clicking).- The PRIMARY selection holds the text once.
What Should Happen?
Body:
Description
Middle-click paste (X11 PRIMARY selection) into the Claude Code prompt inserts the text twice
(e.g. selecting anywhere and middle-clicking gives anywhereanywhere).
Same symptom as #67857 (fixed/locked), but still reproducible in 2.1.281.
Environment
- Claude Code 2.1.281 (CLI, running in the VS Code integrated terminal)
- VS Code 1.138.0
- Ubuntu 24.04, GNOME on X11
Steps to reproduce
- Select a word in any application (VS Code editor, gedit, another terminal).
- Middle-click in the Claude Code prompt.
Expected
The text is pasted once.
Actual
The text is pasted twice.
Diagnostics
- In a plain bash prompt in the same VS Code terminal, middle-click pastes once.
- Middle-click into Claude Desktop pastes once.
- Right-click > Paste / Ctrl+Shift+V in the Claude Code prompt paste once.
xinput testshows a single button-2 press/release per click (the mouse is not double-clicking).- The PRIMARY selection holds the text once.
Error Messages/Logs
Steps to Reproduce
Body:
Description
Middle-click paste (X11 PRIMARY selection) into the Claude Code prompt inserts the text twice
(e.g. selecting anywhere and middle-clicking gives anywhereanywhere).
Same symptom as #67857 (fixed/locked), but still reproducible in 2.1.281.
Environment
- Claude Code 2.1.281 (CLI, running in the VS Code integrated terminal)
- VS Code 1.138.0
- Ubuntu 24.04, GNOME on X11
Steps to reproduce
- Select a word in any application (VS Code editor, gedit, another terminal).
- Middle-click in the Claude Code prompt.
Expected
The text is pasted once.
Actual
The text is pasted twice.
Diagnostics
- In a plain bash prompt in the same VS Code terminal, middle-click pastes once.
- Middle-click into Claude Desktop pastes once.
- Right-click > Paste / Ctrl+Shift+V in the Claude Code prompt paste once.
xinput testshows a single button-2 press/release per click (the mouse is not double-clicking).- The PRIMARY selection holds the text once.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
21.1.281
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_