Skip to main content

Overview

tmux maintains a set of named paste buffers. Each buffer may be either explicitly or automatically named. Buffers can be created from copy mode or by loading content from files.

Buffer Naming

Automatic Names

Automatically named buffers are given names like buffer0001, buffer0002, etc. When the buffer-limit option is reached, the oldest automatically named buffer is deleted.

Explicit Names

Buffers can be explicitly named when created with set-buffer or load-buffer, or by renaming with set-buffer -n. Explicitly named buffers are not subject to buffer-limit and must be deleted manually with delete-buffer.

copy-mode

Enter copy mode, which allows a section of a window or its history to be copied to a paste buffer.
flag
Scroll to bottom when reaching the end in copy mode.
flag
Hide the position indicator in the top right.
flag
Begin a mouse drag (only valid if bound to a mouse key binding).
flag
Cancel copy mode and any other modes.
flag
Scroll one page up immediately after entering copy mode.
string
Copy from src-pane instead of target-pane.
string
The target pane to enter copy mode in.

Copy Mode Key Bindings

Copy mode uses one of two key tables depending on the mode-keys option:
  • copy-mode for emacs-style bindings
  • copy-mode-vi for vi-style bindings
Key tables can be viewed with list-keys -T copy-mode or list-keys -T copy-mode-vi.

Copy Mode Commands

Commands are sent to copy mode using send-keys -X. Common commands include:
  • begin-selection: Start selecting text
  • cancel: Exit copy mode
  • copy-selection: Copy the current selection
  • copy-selection-and-cancel: Copy selection and exit
  • cursor-down, cursor-up, cursor-left, cursor-right: Move cursor
  • halfpage-down, halfpage-up: Scroll half page
  • history-top, history-bottom: Jump to top/bottom of history
  • search-forward, search-backward: Search

paste-buffer

Alias: pasteb
Insert the contents of a paste buffer into the specified pane.
flag
Also delete the paste buffer after pasting.
flag
Paste bracket control codes are sent before and after the buffer if the application has requested bracketed paste mode.
flag
Do not replace line feeds (LF) with carriage returns (CR) when pasting.
string
Name of the buffer to paste. If not specified, the most recently added automatically named buffer is used.
string
Separator to replace LF characters with. Default is carriage return (CR). Ignored with -r.
string
The target pane. If not specified, paste into the current pane.

Examples

list-buffers

Alias: lsb
List the global paste buffers.
flag
Reverse the sort order.
string
Specify the format of each line. Available format variables:
  • #{buffer_name}: Name of buffer
  • #{buffer_size}: Size in bytes
  • #{buffer_sample}: Sample of start of buffer
  • #{buffer_created}: Time buffer was created
string
Only show buffers for which the filter is true.
string
Specify sort order: name, size, or creation (time).

Examples

set-buffer

Alias: setb
Set the contents of a paste buffer or rename it.
flag
Append to the buffer instead of replacing.
flag
Send the buffer to the clipboard for target-client using the xterm escape sequence.
string
Name of the buffer. If not specified, a new automatically named buffer is created.
string
Target client for sending to clipboard (with -w).
string
Rename the buffer to new-buffer-name.
string
Data to set in the buffer. If not specified and -n is used, renames the buffer.

Examples

delete-buffer

Alias: deleteb
Delete the specified paste buffer.
string
Name of the buffer to delete. If not specified, deletes the most recently added automatically named buffer.

Examples

load-buffer

Alias: loadb
Load the contents of a file into a paste buffer.
flag
Send the buffer to the clipboard for target-client using the xterm escape sequence.
string
Name for the buffer. If not specified, creates a new automatically named buffer.
string
Target client for sending to clipboard (with -w).
string
required
Path to the file to load. Use - to read from stdin.

Examples

save-buffer

Alias: saveb
Save the contents of a paste buffer to a file.
flag
Append to the file instead of overwriting.
string
Name of the buffer to save. If not specified, uses the most recently added automatically named buffer.
string
required
Path to save to. Use - to write to stdout.

Examples

show-buffer

Alias: showb
Display the contents of a paste buffer.
string
Name of the buffer to show. If not specified, shows the most recently added automatically named buffer.

Examples

choose-buffer

Put a pane into buffer mode, where a buffer may be chosen interactively from a list.
flag
Start without the preview.
flag
Reverse the sort order.
flag
Disable any confirmation prompts.
flag
Zoom the pane.
string
Format for each item in the list.
string
Initial filter (as a format expression).
string
Format for each shortcut key.
string
Initial sort order: creation (time), name, or size.
string
Target pane.
string
After a buffer is chosen, %% is replaced by the buffer name and the result is executed as a command. Default: paste-buffer -p -b '%%'

Buffer Mode Keys

  • Enter: Paste selected buffer
  • Up/Down: Navigate
  • C-s: Search
  • n/N: Repeat search forward/backward
  • t: Toggle tag
  • T/C-t: Tag none/all
  • p/P: Paste selected/tagged buffers
  • d/D: Delete selected/tagged buffers
  • e: Open buffer in editor
  • f: Enter filter
  • O: Change sort order
  • r: Reverse sort
  • v: Toggle preview
  • q: Exit

Examples

clear-history

Alias: clearhist
Remove and free the history for the specified pane.
flag
Also remove all hyperlinks.
string
The target pane.

Examples