claude agents: OSC 52 clipboard emission broken in tmux (regression in 2.1.146–2.1.153)
Summary
claude agents has its own selection layer that emits OSC 52 directly (with helpful indent-aware copy). That emission is no longer landing in the clipboard when tmux is in between. Plain claude in a sibling pane works because it falls back to terminal-level selection.
Nothing on the host or tmux side changed between working and broken — the only delta was a Claude Code auto-update across a Windows reboot. Worked on the prior latest build; broken on 2.1.153.
Environment
- Claude Code
2.1.153(commit6cfd211761f3),latestchannel — broken - Stable:
2.1.145— presumed last known-good - Platform: linux-x64, VS Code devcontainer
- Host: Windows 11, WSL2, Windows Terminal (latest, "Allow OSC 52 to write to clipboard" enabled)
- tmux 3.3a,
set-clipboard on(unchanged for weeks)
Steps to reproduce
- From Windows Terminal, exec into a devcontainer and start:
tmux new -s s claude agents. - Mouse-select any text in the
claude agentspane. - Claude prints
sent 75 characters via OSC 52 - check terminal clipboard settings if paste fails. - Paste anywhere on Windows — clipboard unchanged.
What's confirmed working (isolates the failure to claude agents' copy path)
- Plain
claudein a sibling pane of the same tmux session: mouse-select → clipboard works (terminal-level selection, no indent awareness). - Sibling bash pane: mouse-select works.
- Shift+select in the
claude agentspane: works — bypasses Claude's mouse tracking and routes through tmux's selection path. Rules out tmux pass-through and WT OSC 52 acceptance as broken.
The failing path is specifically the OSC 52 sequence emitted by claude agents' own copy handler.
Suspected cause
The claude agents TUI's OSC 52 sequence is formed or terminated in a way that tmux's set-clipboard on pass-through no longer recognizes, somewhere in 2.1.146 → 2.1.153. The "sent N characters" message suggests the emit path believes it sent the bytes but they aren't surviving tmux's OSC parser.
Workarounds
- Shift+select in the
claude agentspane (loses indent-aware copy). - Pin to stable:
2.1.145is presumed unaffected.
<details><summary>tmux config (for reference; unchanged)</summary>
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:RGB"
set -s escape-time 10
set -g mouse on
set -g set-clipboard on
setw -g mode-keys vi
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-selection-no-clear
</details>
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗