Skip to content

fix(tmux): improve clipboard and mouse handling for nested sessions - #62

Merged
paveg merged 2 commits into
mainfrom
fix/tmux-nested-copy-mode
Jan 15, 2026
Merged

paveg merged 2 commits into
mainfrom
fix/tmux-nested-copy-mode

Conversation

@paveg

@paveg paveg commented Jan 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Use pbcopy on local macOS for reliable clipboard access instead of relying on OSC 52
  • Use OSC 52 escape sequences on remote SSH sessions for clipboard integration
  • Disable mouse in PASSTHROUGH mode (F12) so mouse events pass through to inner tmux
  • Enables proper copy mode scrolling and text selection in nested tmux environments

Test plan

  • Apply config with just apply and reload tmux (prefix + r)
  • Local tmux: Enter copy mode, select text with v, yank with y, verify Cmd+V pastes correctly
  • Nested tmux over SSH: Press F12 to enter PASSTHROUGH mode, verify mouse scroll works in inner tmux copy mode
  • Nested tmux: Verify text selection and copy works via OSC 52

🤖 Generated with Claude Code

paveg and others added 2 commits January 15, 2026 11:56
- Use pbcopy on local macOS for reliable clipboard access
- Use OSC 52 escape sequences on remote SSH sessions
- Disable mouse in PASSTHROUGH mode so events reach inner tmux
- Enables proper copy mode scrolling and selection in nested tmux

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Per tmux wiki recommendation for nested sessions:
- Outer tmux (local): set-clipboard on - processes OSC 52 and forwards
- Inner tmux (remote): set-clipboard external - passes through unchanged

Also enable clipboard terminal feature for screen/tmux/xterm TERM types.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@paveg
paveg merged commit 7638f7c into main Jan 15, 2026
8 checks passed
@paveg
paveg deleted the fix/tmux-nested-copy-mode branch January 15, 2026 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant