claude-code - 💡(How to fix) Fix [FEATURE] Setting to disable copy-on-selection in the agents view (TUI)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Add a setting to disable Claude Code's automatic copy-on-selection behavior in the agents view (the background-agents management UI), so selection only highlights and explicit Cmd+C is required to copy (matching native macOS terminal conventions).

Root Cause

Any quick visual selection inside the agents view silently overwrites whatever the user had in their clipboard. This is surprising and easy to miss, especially because:

Fix Action

Fix / Workaround

Workarounds considered

RAW_BUFFERClick to expand / collapse

Summary

Add a setting to disable Claude Code's automatic copy-on-selection behavior in the agents view (the background-agents management UI), so selection only highlights and explicit Cmd+C is required to copy (matching native macOS terminal conventions).

Current behavior

Inside the agents view in the Claude Code TUI, any text selection (drag, double-click word, triple-click line) is automatically copied to the system clipboard, and a "copied X chars to clipboard" toast appears.

This does not happen in a normal interactive Claude Code session — only inside the agents view — so the auto-copy logic appears to live in that view's input handler specifically.

Why this is a problem

Any quick visual selection inside the agents view silently overwrites whatever the user had in their clipboard. This is surprising and easy to miss, especially because:

  • The same behavior does not happen in a normal interactive Claude Code session.
  • The same WezTerm session does not exhibit this behavior at a regular shell prompt or inside other TUI CLIs (e.g. Codex).

Even with WezTerm configured with disable_default_mouse_bindings = true and explicit Nop bindings on mouse-Up events, the auto-copy still happens inside the agents view, confirming it is Claude Code's own copy logic in that view, not the terminal's.

Proposed solution

Add one of:

  • A copyOnSelection boolean in ~/.claude/settings.json (default true to preserve current behavior)
  • An env var like CLAUDE_CODE_NO_COPY_ON_SELECT=1

Setting it to disable would mean selection only highlights inside the agents view, and Cmd+C is required to copy, matching native macOS terminal conventions and the rest of Claude Code.

Workarounds considered

CLAUDE_CODE_DISABLE_MOUSE=1 is too heavy-handed since it disables all mouse interaction, not just the copy-on-select side-effect.

Environment

  • Claude Code (latest)
  • WezTerm 20240203 on macOS
  • Reproduces: agents view inside Claude Code
  • Does NOT reproduce: normal interactive Claude Code session, Codex CLI, shell prompt

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING