Tmux Copy Mode & Clipboard Integration
Intermediatev1.0.0
Master tmux copy mode with vi keybindings — navigate scrollback, select text, yank to system clipboard, and integrate with macOS pbcopy, Linux xclip, and WSL clip.exe.
Content
Overview
Tmux copy mode lets you navigate the scrollback buffer, select text, and copy it — all with vi or emacs keybindings. Proper configuration syncs the tmux clipboard with your system clipboard for seamless copy/paste.
Why This Matters
- -Access scrollback history — scroll through terminal output
- -Precise text selection — vi motions for accurate copying
- -System clipboard sync — copy from tmux, paste anywhere
- -Cross-platform — works on macOS, Linux, and WSL
How It Works
Step 1: Enable Vi Copy Mode
Step 2: Configure Vi-Style Selection
Step 3: System Clipboard Integration
Step 4: Mouse Selection (Optional)
Copy Mode Workflow
Using tmux-yank Plugin
Best Practices
- -Use vi mode — consistent with Vim/Neovim muscle memory
- -Install tmux-yank for automatic platform detection
- -Enable mouse as supplement, not replacement for keyboard
- -Increase scrollback:
set -g history-limit 50000 - -Search scrollback with
/in copy mode instead of manual scrolling
Common Mistakes
- -Not setting mode-keys to vi (stuck with emacs bindings)
- -Missing clipboard tool (xclip not installed on Linux)
- -Mouse selection not copying to system clipboard
- -Scrollback limit too low (default 2000 lines)
FAQ
Discussion
Loading comments...