[FEATURE] Setting to disable copy-on-selection in the agents view (TUI)
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
copyOnSelectionboolean in~/.claude/settings.json(defaulttrueto 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
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗