tmux internal buffer ↔ system clipboard: cross-platform copy-mode synchronization?
0 reputation · 06 Sept 2026, 10:20 UTC
Integration goal
Achieve reliable, automatic synchronization between tmux's copy-mode buffer and the host operating system clipboard across macOS and Linux without manual intervention.
Constraints and uncertainty
tmux maintains an internal buffer distinct from the OS clipboard. On macOS the bridge relies on pbcopy/pbpaste invoked through default-command and update-environment; tmux 3.2a's switch to zsh as the default shell can alter this flow. On Linux the path depends on xclip or xsel being present, and the $TMUX environment variable influences which shell commands execute. Mouse selection (set -g mouse on) may emit terminal escape sequences that corrupt clipboard content in certain emulators. The buffer API offers no documented programmatic access for external scripts, limiting automation.
Open questions
- Which combination of
default-command,update-environment, and key bindings yields consistent clipboard transfer on both macOS (tmux 3.2a+) and Linux (withxclip/xsel) without per-platform configuration files? - Can mouse-driven selections be made to populate the system clipboard reliably across common terminal emulators (e.g., Alacritty, iTerm2, GNOME Terminal) without generating spurious escape sequences?