tmux Copy Mode, Scrollback, and Clipboard

tmux copy-mode commands, scrollback capture, search, buffers, and clipboard configuration patterns.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Copy mode and scrolling
Enter copy mode
tmux copy-mode

# Open scrollback for the active pane.

Scroll up half a page
tmux send-keys -X halfpage-up

# Send a copy-mode command to the current pane.

Search backward in history
tmux command-prompt -p "search" "send-keys -X search-backward-incremental "%%""

# Prompt for a reverse search term.

Capture visible history
tmux capture-pane -pS -100

# Dump pane contents into a paste buffer.

Write the top buffer to a file
tmux save-buffer ~/tmux-buffer.txt

# Persist copied text to disk.

## Clipboard workflows
List paste buffers
tmux list-buffers

# Show all saved buffers.

Show the current buffer
tmux show-buffer

# Print the active buffer contents.

Paste the current buffer
tmux paste-buffer

# Insert copied text into the active pane.

Enable clipboard integration
set -g set-clipboard on

# Tell tmux to use the terminal clipboard when supported.

Enable vi-style keys in copy mode
set -g mode-keys vi

# Use familiar vi navigation in copy mode.

Recommended next

No recommendations yet.