Copy mode allows you to select and copy text from your terminal using only the keyboard, with Vim-style navigation controls. This eliminates the need to reach for your mouse when selecting terminal output.
Activating Copy Mode
Action Keybinding Activate copy mode Ctrl+Shift+X
When copy mode is active, the tab title is prefixed with “Copy Mode” and the terminal behavior changes to allow keyboard-driven cursor navigation.
Selection Modes
Copy mode supports three types of selection:
Mode Keybinding Description Cell selection vSelect individual characters Line selection Shift+VSelect entire lines Rectangular selection Ctrl+VSelect a rectangular block
Selection mode is off by default. Press v to toggle it on before selecting text.
Navigation
Basic Movement
Action Keybindings Move left h, LeftArrowMove down j, DownArrowMove up k, UpArrowMove right l, RightArrow
Word Movement
Action Keybindings Forward one word w, Alt+F, Alt+RightArrow, TabBackward one word b, Alt+B, Alt+LeftArrow, Shift+TabForward to word end e
Line Movement
Action Keybindings Start of line 0, HomeEnd of line $, EndStart of next line EnterStart of indented line ^, Alt+M
Viewport Movement
Action Keybindings Top of viewport Shift+HMiddle of viewport Shift+MBottom of viewport Shift+L
Page Movement
Action Keybindings Up one screen PageUp, Ctrl+BDown one screen PageDown, Ctrl+FUp half screen Ctrl+UDown half screen Ctrl+D
Action Keybindings Top of scrollback g (press twice)Bottom of scrollback Shift+G
Selection Actions
Copying Text
Action Keybinding Copy and exit yCopy (without exit) Ctrl+Shift+C
Adjusting Selection
Action Keybinding Move to other end of selection oMove to other end horizontally Shift+O
Shift+O is particularly useful in rectangular selection mode for adjusting the selection boundary.
Exiting Copy Mode
Action Keybindings Exit copy mode Escape, Ctrl+C, Ctrl+G, q
Workflow Example
Activate copy mode
Press Ctrl+Shift+X to enter copy mode.
Navigate to start position
Use h, j, k, l or arrow keys to move the cursor to where you want to start selecting.
Start selection
Press v for character selection, Shift+V for line selection, or Ctrl+V for rectangular selection.
Extend selection
Move the cursor to the end of the text you want to select.
Copy and exit
Press y to copy the selected text and exit copy mode, or Ctrl+Shift+C to copy without exiting.
Customizing Copy Mode
You can customize copy mode keybindings by overriding the copy_mode key table:
Custom Copy Mode Bindings
local wezterm = require 'wezterm'
local act = wezterm . action
local config = {}
-- Get default key tables
config . key_tables = wezterm . gui . default_key_tables ()
-- Customize specific bindings in copy_mode
table.insert ( config . key_tables . copy_mode , {
key = 'c' ,
mods = 'CTRL' ,
action = act . CopyMode 'Close' ,
})
return config
View Default Copy Mode Bindings
To see all default copy mode keybindings:
wezterm show-keys --lua --key-table copy_mode
Color Customization
Customize the appearance of selected text in copy mode:
local wezterm = require 'wezterm'
local config = {}
config . colors = {
copy_mode_active_highlight_bg = { Color = '#000000' },
copy_mode_active_highlight_fg = { Color = '#ffffff' },
copy_mode_inactive_highlight_bg = { Color = '#52ad70' },
copy_mode_inactive_highlight_fg = { Color = '#c0c0c0' },
}
return config
Advanced Usage
Quick Copy Git Commit Hash
Using Copy Mode
Using Search Instead
-- 1. Run git log
-- 2. Ctrl+Shift+X to enter copy mode
-- 3. Navigate to the commit hash
-- 4. Press 'w' repeatedly to select the hash (moves word by word)
-- 5. Press 'v' to start selection
-- 6. Press 'e' to extend to end of word
-- 7. Press 'y' to copy
Selecting Command Output
-- 1. Run a command that produces output
-- 2. Ctrl+Shift+X to enter copy mode
-- 3. 'gg' to go to top of scrollback
-- 4. Search forward for command prompt or output start
-- 5. 'V' for line selection mode
-- 6. 'j' or '}' to select lines
-- 7. 'y' to copy
Integration with Quick Select
While copy mode provides fine-grained control, Quick Select mode is better for quickly selecting common patterns like:
URLs
File paths
Git hashes
IP addresses
Use copy mode when you need:
Precise character-level selection
Multi-line selections
Rectangular selections
Vim-style navigation
Feature Copy Mode tmux copy-mode screen copy mode Vim-style navigation ✓ ✓ ✓ Rectangular selection ✓ ✓ ✓ Integrated search ✓ (via Ctrl+Shift+F) ✓ ✓ Works with mouse ✓ ✓ ✓ No external multiplexer ✓ ✗ ✗
Tips and Tricks
Combine with search : Use Ctrl+Shift+F to search, then Ctrl+Shift+X to enter copy mode at the found location
Use markers : Navigate to specific points quickly with Shift+H (top), Shift+M (middle), Shift+L (bottom)
Rectangular mode for columns : Use Ctrl+V to select columnar data from command output
Fast line grabbing : Shift+V then j/k for quick line-based selections
Practice Vim motions : Copy mode is a great way to learn or practice Vim navigation if you’re new to it