[BUG] Clipboard (Ctrl+V) overwritten with accumulated session content — Kitty terminal, Linux

Resolved 💬 2 comments Opened Jun 8, 2026 by rollingferret Closed Jun 8, 2026

Description

When selecting any text inside a Claude Code session in Kitty terminal, pasting with Ctrl+V produces a massive dump of accumulated session content instead of the selected text. Mouse selection goes to PRIMARY buffer correctly, but Claude Code programmatically overwrites CLIPBOARD with what appears to be the entire session context or accumulated response history.

Selecting 5 characters and pressing Ctrl+V pastes thousands of characters of previous session output.

This does not happen with Codex CLI or Gemini CLI in the same terminal — those tools are readline-based and do not intercept mouse events or write to clipboard.

Steps to Reproduce

  1. Launch claude in Kitty terminal on Linux
  2. Have a conversation with several exchanges
  3. Mouse-select any short string (e.g. 5 characters) from a response
  4. Press Ctrl+V to paste anywhere
  5. Observe: thousands of characters of session history are pasted instead of the selection

Expected Behavior

Pasted content matches the mouse selection exactly.

Actual Behavior

CLIPBOARD is overwritten with accumulated session content (appears to be the full /tmp/claude-1000/response.md contents or similar). The paste dumps the entire session history.

Root Cause Hypothesis

Claude Code writes to the CLIPBOARD buffer programmatically (via OSC 52 or xclip/wl-copy) after each response or on a timer. On Linux, Ctrl+V pastes from CLIPBOARD — so whatever Claude Code last wrote there replaces the user's actual mouse selection. The mouse selection correctly goes to PRIMARY but Ctrl+V never reaches it.

Codex CLI and Gemini CLI do not exhibit this because they don't have a TUI layer writing to clipboard.

Workaround

Middle-click paste (uses PRIMARY buffer) should bypass this — but middle-click is also broken in Kitty with Claude Code active, likely due to mouse reporting mode (\e[?1000h) intercepting the event.

Current only workaround: copy from /tmp/claude-1000/response.md in a separate terminal window.

Environment

  • Platform: Linux
  • Terminal: Kitty
  • Other CLIs tested (Codex, Gemini): not affected
  • Started after a recent Claude Code update — no other environment changes

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗