Overview
tmux allows commands to be bound to most keys, with or without a prefix key. When specifying keys, most represent themselves (e.g.,A to Z). Special modifiers and keys are also supported.
Key Notation
Modifiers
- Ctrl keys: Prefix with
C-or^(e.g.,C-bor^b) - Shift keys: Prefix with
S-(e.g.,S-Up) - Alt/Meta keys: Prefix with
M-(e.g.,M-1)
Special Key Names
The following special key names are accepted:Up,Down,Left,RightBSpace(Backspace)BTab(Back Tab)DC(Delete)EndEnterEscapeF1toF12HomeIC(Insert)NPage,PageDown,PgDnPPage,PageUp,PgUpSpaceTab
Binding Special Characters
To bind" or ' keys, quotation marks are necessary:
The Any Key
A command bound to theAny key will execute for all keys which do not have a more specific binding.
Key Tables
Keys are bound in key tables:- prefix: Default table for keys pressed after the prefix key (default
C-b) - root: Table for keys pressed without the prefix key
- copy-mode: Emacs-style key bindings in copy mode
- copy-mode-vi: Vi-style key bindings in copy mode
- Custom tables: Can be created and switched to with
switch-client -T
bind-key
Alias:bind
Alias for
-T root. Bind the key in the root table (without prefix).Indicate this key may repeat. See the
initial-repeat-time and repeat-time options.Attach a note to the key (shown with
list-keys -N). Pass an empty string to clear an existing note.Specify the key table to bind the key in. Default is
prefix.The key to bind.
The tmux command to execute when the key is pressed.
Using -r and -N Without Command
The-r and -N flags can be used without a command to alter an existing binding.
Examples
unbind-key
Alias:unbind
Remove all key bindings in the key table (cannot be used with a key argument).
Alias for
-T root. Unbind the key from the root table.Do not report an error if the key is not bound.
Specify the key table. Default is
prefix.The key to unbind (unless
-a is used).Examples
list-keys
Alias:lsk
Default Form
Lists keys asbind-key commands. All key tables are listed by default.
List only the first matching key.
With
-N, list the command for keys that do not have a note rather than skipping them.List only keys with attached notes. Shows only the key and note for each key. Only keys in the
root and prefix tables are listed by default.Specify a prefix to print before each key.
List only keys in the specified key table.
List bindings for the specified key only.
Examples
send-keys
Alias:send
Expand formats in arguments.
Expect each key to be a hexadecimal number for an ASCII character.
Send keys to the target client instead of the target pane, so they are looked up in the client’s key table.
Disable key name lookup and process the keys as literal UTF-8 characters.
Pass through a mouse event (only valid if bound to a mouse key binding).
Reset the terminal state.
Send keys to copy mode. The keys are interpreted as copy mode commands.
The target client to send keys to (with
-K).Repeat count for the key.
The target pane to send keys to.
Key name (e.g.,
C-a, NPage) or literal string. If no keys are given and the command is bound to a key, that key is used.Examples
Repeating Keys
Keys bound with the-r flag may repeat. After the first press, if the same key is pressed again within the repeat-time interval (default 500ms), the command is executed again without requiring the prefix key.
Related Options
Time in milliseconds for which the prefix indicator is shown after the prefix key is pressed (default 500).
Time in milliseconds for which a key bound with
-r may repeat (default 500).