[Bug] X11 PRIMARY selection pastes twice in JetBrains terminal

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

Bug Description
What happens Middle-clicking to paste the X11 PRIMARY selection inserts the text twice in Claude Code. What I expect The text is inserted once, as it is in every other program. Steps to reproduce 1. On Linux/X11, run Claude Code inside the JetBrains integrated terminal (PhpStorm). 2. Select any text anywhere to populate the PRIMARY selection. 3. Middle-click in the Claude Code prompt. 4. The selection is pasted twice. Scoped to Claude Code — control test included In a plain terminal tab of the same PhpStorm build, running cat and middle-clicking pastes the text once. The duplication only occurs while Claude Code is running, which points at the interaction between Claude Code's mouse reporting and the terminal's native PRIMARY paste: the terminal performs its own paste, and the mouse event is also forwarded to Claude Code, which pastes again. No third-party clipboard manager is involved (no clipman/parcellite/copyq/gpaste/greenclip/diodon process running). Environment - Claude Code 2.1.234 - PhpStorm 2026.2.1, build 262.9437.196 (snap rev 695), integrated terminal ("Reworked Terminal") - Ubuntu GNOME, session type X11 - Linux 7.0.0-28-generic - TERM=xterm-256color Workaround Ctrl+Shift+V pastes once, but it reads CLIPBOARD rather than PRIMARY, so it requires an explicit copy first — highlighting alone no longer suffices.

Environment Info

  • Platform: linux
  • Terminal: pycharm
  • Version: 2.1.234
  • Feedback ID: a89a3007-bcb8-4883-83ed-f9dcdc36fffc

Errors

[]

View original on GitHub ↗