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

Status Fixed / completed
Maintainer reply None cached
Activity 3 comments · opened Jun 8, 2026 · 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 ↗

3 Comments

github-actions[bot] · 4 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/41954

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

rollingferret · 4 months ago

Duplicate of #41954. Closing.

github-actions[bot] · 2 months 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.