How to copy from tmux to the system clipboard
Modern tmux + a decent terminal — this is usually all you need:
There are three clipboards. That's the whole problem.
Your terminal's selection, tmux's paste buffers, and the OS clipboard are three separate things. set-clipboard on bridges them using OSC 52, an escape sequence that asks your terminal to set the OS clipboard — it works in iTerm2, kitty, WezTerm, Alacritty, Ghostty, and Windows Terminal, and crucially it works over SSH, because the sequence travels through the connection to your local terminal.
If OSC 52 doesn't work: pipe to a clipboard tool
The traditional fix is piping the copy to your platform's clipboard command:
# macOS
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "pbcopy"
# Linux X11
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "xclip -selection clipboard -i"
# Linux Wayland
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "wl-copy"Stale advice warning
Old guides tell macOS users to install reattach-to-user-namespace. That's been unnecessary since tmux 2.6 (2017) — if a tutorial mentions it, the rest of it is probably outdated too. Same for xsel incantations wrapped in if-shell blocks from 2014.
Mouse selection
With mouse on, drag-select copies to the tmux buffer and (with set-clipboard on) the system clipboard on release. To bypass tmux entirely and use raw terminal selection, hold Shift while dragging.
Related
Verified against tmux 3.6 · updated July 2026 · back to the full cheat sheet