Understanding Copy Mode
Copy mode allows you to navigate through a pane’s history, search for text, and copy content to paste buffers. It’s similar to a pager likeless or a text editor’s visual mode.
Copy mode provides access to the scrollback history, which by default stores 2000 lines. You can adjust this with the
history-limit option.Entering Copy Mode
Basic Entry
Exit Copy Mode
Pressq (vi mode) or Escape (emacs mode) to exit copy mode.
Key Binding Modes
tmux supports two key binding sets for copy mode: vi and emacs. Set your preference with:Navigation in Copy Mode
Vi Key Bindings
- Basic Movement
- Word Movement
- Scrolling
- Jumping
Emacs Key Bindings
- Basic Movement
- Word Movement
- Scrolling
- Jumping
Searching in Copy Mode
Vi Mode Searching
Emacs Mode Searching
Search Commands
From the tmux command prompt or key bindings:Advanced Searching
Searches use regular expressions by default. For literal string matching, use the
-text variants.Selecting and Copying Text
Vi Mode Selection
Emacs Mode Selection
Copy Commands
Explicit copy commands for use withsend-keys -X:
Copy Flags
Selection Modes
Copy mode supports different selection modes:Character Selection (Default)
Select character by character.Line Selection
Select entire lines at a time.Rectangle Selection
Select a rectangular block of text.Word Selection
Select word under cursor.Jumping in Copy Mode
Quickly move within a line:Vi Mode Jumps
Jump Commands
Marks and Position
Setting Marks
Position Indicator
The position indicator shows:- Current cursor position
- Total lines in history
- Search match count (when searching)
Advanced Copy Mode Features
Scrolling Modes
History Navigation
Prompt navigation requires your shell to emit OSC 133 escape sequences. Supported by some shells with proper configuration.
Matching Brackets
Paragraph Navigation
Paste Buffers
Copied text is stored in paste buffers.Viewing Buffers
Pasting Buffers
Managing Buffers
Mouse Support in Copy Mode
When mouse mode is enabled:- Click and drag - Select text
- Double-click - Select word
- Triple-click - Select line
- MouseDrag1 - Begin selection
- MouseDragEnd1 - Copy selection and exit
- WheelUp/Down - Scroll history
Mouse Copy Configuration
Customizing Copy Mode
Custom Key Bindings
Copy to System Clipboard
- Linux (X11)
- macOS
- Wayland
Word Separators
Customize what characters are considered word boundaries:Copy Mode Commands Reference
All Copy Mode Commands
Complete list of commands forsend-keys -X:
Movement Commands
Movement Commands
Scrolling Commands
Scrolling Commands
Search Commands
Search Commands
Selection Commands
Selection Commands
Copy Commands
Copy Commands
Other Commands
Other Commands