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

Navigate history, search, and select text.

Enter copy mode

Open scrollback for the active pane.

bashANYtmuxcopy-mode
bash
tmux copy-mode

Equivalent to using the copy-mode key binding.

Scroll up half a page

Send a copy-mode command to the current pane.

bashANYtmuxcopy-modesend-keys
bash
tmux send-keys -X halfpage-up

Useful for scripts or custom key bindings.

Search backward in history

Prompt for a reverse search term.

bashANYtmuxsearchhistory
bash
tmux command-prompt -p "search" "send-keys -X search-backward-incremental "%%""

Builds an interactive copy-mode search prompt.

Capture visible history

Dump pane contents into a paste buffer.

bashANYtmuxcapture-panehistory
bash
tmux capture-pane -pS -100

Prints the last 100 lines to stdout with `-p`.

Write the top buffer to a file

Persist copied text to disk.

bashANYtmuxsave-bufferclipboard
bash
tmux save-buffer ~/tmux-buffer.txt

Useful after copying logs or diagnostics.

Clipboard workflows

Use buffers and system clipboard integrations.

List paste buffers

Show all saved buffers.

bashANYtmuxbuffers
bash
tmux list-buffers

Helpful if you copy frequently.

Show the current buffer

Print the active buffer contents.

bashANYtmuxbuffer
bash
tmux show-buffer

Inspect the current copied text.

Paste the current buffer

Insert copied text into the active pane.

bashANYtmuxpaste-buffer
bash
tmux paste-buffer

Useful in scripts and macros.

Enable clipboard integration

Tell tmux to use the terminal clipboard when supported.

tmuxANYtmuxclipboardconfig
tmux
set -g set-clipboard on

This can help integrate tmux copying with the system clipboard in supporting terminals.

Enable vi-style keys in copy mode

Use familiar vi navigation in copy mode.

tmuxANYtmuxvicopy-mode
tmux
set -g mode-keys vi

Popular among vim users.

Recommended next

No recommendations yet.