Custom Bindings
This reference describes the finite building blocks for bindings you can add.
It is separate from the Default Bindings, standalone
commands and send-keys. The generated catalog below is
validated against the selected product's runtime metadata.
Tables and input ownership
bind/bind-key and unbind/unbind-key select the prefix table by default.
-n selects root; -T NAME or -TNAME selects a named table. Names are nonempty,
case-sensitive and contain no whitespace or control characters. Conflicting
table selections fail. -r is accepted but does not implement repeat behavior;
binding notes, arbitrary binding flags, and full tmux key-table parity are not
implemented.
Root keyboard bindings fire without the prefix, but the prefix byte itself is
handled first. A prefix binding consumes its following key even if no action
matches. Named tables are one-shot: after switch-client -T NAME, the next
complete input event is consumed and the table returns to root, match or not.
Only a single-byte event can match an ordinary custom table binding. A matched
binding can select another table. An unknown table fails; a table switch cannot
share a command line with server commands.
bind-key h select-pane -L
bind-key -n C-n next-window
bind-key n switch-client -T navigation
bind-key -T navigation h select-pane -L
unbind-key h
unbind-key -n C-n
An explicit binding replaces a matching default. Unbinding a default suppresses it rather than revealing it again; unbinding an ordinary custom binding removes it. Root and prefix definitions/suppression are separate. See Default Bindings for default actions and precedence.
Client prompts and clipboard confirmations own their keyboard input. Copy mode owns its keyboard input and resets ordinary key-table routing; its built-in movement keys are not an extensible custom copy-mode table. Overlays can own input before ordinary server commands run. Bracketed paste and complete escape sequences are not a way to invoke a sequence of byte bindings.
Mouse definitions using the default-prefix spelling or -n go into the same
separate mouse map; they do not wait for a prefix key. Custom-table mouse
definitions are rejected. Explicit mouse bindings can operate with mouse off;
mouse on also enables default mouse actions and intrinsic behavior. An
explicit unbind suppresses the matching default action.
Mouse-name parsing does not imply gesture delivery. Ordinary custom mouse routing classifies rows as Pane or Status, not Border. Border names are accepted and stored but currently do not receive custom Border events. Built-in left-button border resizing has priority when mouse support is on.
Popup/menu/clock/copy-mode ownership and chooser suppression precede ordinary mouse bindings. An active pane application that requests mouse tracking receives eligible in-pane events before custom bindings. Pager wheel handling can translate scrolling into application arrow input. A tracked drag release is promoted to DragEnd rather than also firing an Up binding.
Keyboard keys
Use one printable ASCII character, or a named key below. Printable characters are case-sensitive. Quote spaces and configuration metacharacters, for example bind-key ' ' next-window or bind-key ';' last-pane.
| Named spelling | Byte |
|---|---|
Enter |
0x0D |
Space |
0x20 |
Tab |
0x09 |
Escape |
0x1B |
Esc |
0x1B |
BSpace |
0x08 |
Named spellings are case-insensitive. The canonical control forms are C-a through C-z (bytes 1-26); the C- prefix is case-insensitive. Use the lower-case ASCII letter forms shown here. C-i/Tab, C-m/Enter and C-h/BSpace collide because each pair names one byte. BSpace is byte 8, not DEL; a terminal sending DEL for physical Backspace does not send this named byte.
This is not the send-keys vocabulary. Up, F1, M-x, modifier combinations and arbitrary Unicode characters are not supported custom keyboard-key names. Built-in prefix arrow decoding does not make those names individually bindable. Terminal/OS shortcuts and keyboard protocols can consume or transform input before wtmux receives it.
Mouse names
Names are exact-case. Buttons 1, 2 and 3 mean left, middle and right. The finite parser vocabulary is:
| Name | Delivery category |
|---|---|
MouseDown1Border |
Parsed/stored, not delivered as a custom Border event |
MouseDown1Pane |
Subject to input ownership and mouse routing |
MouseDown1Status |
Subject to input ownership and mouse routing |
MouseDown2Border |
Parsed/stored, not delivered as a custom Border event |
MouseDown2Pane |
Subject to input ownership and mouse routing |
MouseDown2Status |
Subject to input ownership and mouse routing |
MouseDown3Border |
Parsed/stored, not delivered as a custom Border event |
MouseDown3Pane |
Subject to input ownership and mouse routing |
MouseDown3Status |
Subject to input ownership and mouse routing |
MouseDrag1Border |
Parsed/stored, not delivered as a custom Border event |
MouseDrag1Pane |
Subject to input ownership and mouse routing |
MouseDrag1Status |
Subject to input ownership and mouse routing |
MouseDrag2Border |
Parsed/stored, not delivered as a custom Border event |
MouseDrag2Pane |
Subject to input ownership and mouse routing |
MouseDrag2Status |
Subject to input ownership and mouse routing |
MouseDrag3Border |
Parsed/stored, not delivered as a custom Border event |
MouseDrag3Pane |
Subject to input ownership and mouse routing |
MouseDrag3Status |
Subject to input ownership and mouse routing |
MouseDragEnd1Border |
Parsed/stored, not delivered as a custom Border event |
MouseDragEnd1Pane |
Subject to input ownership and mouse routing |
MouseDragEnd1Status |
Subject to input ownership and mouse routing |
MouseDragEnd2Border |
Parsed/stored, not delivered as a custom Border event |
MouseDragEnd2Pane |
Subject to input ownership and mouse routing |
MouseDragEnd2Status |
Subject to input ownership and mouse routing |
MouseDragEnd3Border |
Parsed/stored, not delivered as a custom Border event |
MouseDragEnd3Pane |
Subject to input ownership and mouse routing |
MouseDragEnd3Status |
Subject to input ownership and mouse routing |
MouseUp1Border |
Parsed/stored, not delivered as a custom Border event |
MouseUp1Pane |
Subject to input ownership and mouse routing |
MouseUp1Status |
Subject to input ownership and mouse routing |
MouseUp2Border |
Parsed/stored, not delivered as a custom Border event |
MouseUp2Pane |
Subject to input ownership and mouse routing |
MouseUp2Status |
Subject to input ownership and mouse routing |
MouseUp3Border |
Parsed/stored, not delivered as a custom Border event |
MouseUp3Pane |
Subject to input ownership and mouse routing |
MouseUp3Status |
Subject to input ownership and mouse routing |
WheelDownBorder |
Parsed/stored, not delivered as a custom Border event |
WheelDownPane |
Subject to input ownership and mouse routing |
WheelDownStatus |
Subject to input ownership and mouse routing |
WheelUpBorder |
Parsed/stored, not delivered as a custom Border event |
WheelUpPane |
Subject to input ownership and mouse routing |
WheelUpStatus |
Subject to input ownership and mouse routing |
There are no extra-button, double-click or triple-click names. A release after a tracked drag is delivered as MouseDragEndN..., not additionally as MouseUpN....
Direct binding commands
These are direct bind-key mappings, not a standalone CLI inventory. Flags below belong to the canonical binding command; name-specific argument losses are described alongside them. A blank list is not permission to use standalone flags. Examples define one binding each and require any named target/buffer to exist. Most actions need the triggering attached client/pane; configuration-only operations still need an attached client to trigger a key.
| Intrinsic command names | Binding flags | Arguments and behavior | Context | Example |
|---|---|---|---|---|
break-pane |
-d, -s <pane>, --source <pane> |
Optional source pane and detached-selection flag; no positional arguments. | Attached client/pane | bind-key x break-pane |
capture-pane |
-p, -e, -S <line>, -E <line>, -b <buffer>, --buffer <buffer>, -J, -t <pane>, --target <pane> |
Capture flags select output/buffer, joined lines, line range and optional pane target; see the capture-pane usage contract. | Server/configuration | bind-key x capture-pane -b sample |
choose-buffer |
- | No arguments retained; opens the interactive buffer chooser. | Attached client/pane | bind-key x choose-buffer |
choose-client |
- | No arguments retained; opens the attached-client chooser. | Attached client/pane | bind-key x choose-client |
choose-tree |
- | No arguments retained; opens the session/window/pane chooser. | Attached client/pane | bind-key x choose-tree |
clear-history |
-t <pane>, --target <pane> |
No positional arguments; clears the active pane's scrollback. | Attached client/pane | bind-key x clear-history |
clock-mode |
-t <pane>, --target <pane> |
No positional arguments; shows the active pane's clock. | Attached client/pane | bind-key x clock-mode |
confirm-before |
-p <text>, --prompt <text> |
Optional -p/--prompt TEXT followed by a supported server command. The client owns the confirmation prompt. | Attached client/pane | bind-key x confirm-before -p "close pane?" kill-pane |
copy-mode |
- | No arguments retained; enters the active pane's copy mode. | Attached client/pane | bind-key x copy-mode |
delete-buffer |
-b <buffer>, -n <buffer> |
Optional -b/-n NAME (also attached forms); otherwise the latest buffer. Standalone --buffer is not mapped. | Attached client/pane | bind-key x delete-buffer -b sample |
detach-client, detach |
- | Detaches the triggering client; direct-binding arguments are discarded. | Attached client/pane | bind-key x detach-client |
display-menu |
-T <text>, -x <integer>, -y <integer> |
Menu options followed by NAME KEY COMMAND triples; COMMAND is validated on selection. Standalone -t/--target metadata is not accepted. | Attached client/pane | bind-key x display-menu "Next window" n next-window |
display-message, display |
-p, -a |
Optional formatting flags and TEXT use the display-message parser. | Attached client/pane | bind-key x display-message hello |
display-panes |
- | No arguments retained; displays the pane-number chooser. | Attached client/pane | bind-key x display-panes |
display-popup |
-E, --pane-directory, -w <integer>, -h <integer>, -x <integer>, -y <integer> |
Popup options and an optional shell command; standalone -t/--target metadata is not accepted. The popup owns input while open. | Attached client/pane | bind-key x display-popup -E |
find-window |
- | QUERY searches window names/pane titles and opens the result chooser. | Attached client/pane | bind-key x find-window work |
join-pane |
-h, -v, -s <pane>, --source <pane>, -t <pane>, --target <pane> |
Source/destination pane selectors and split orientation; no positional arguments. | Attached client/pane | bind-key x join-pane -s work:1.0 -t work:0.0 |
kill-pane |
- | Closes the active pane; direct binding arguments are discarded. | Attached client/pane | bind-key x kill-pane |
kill-window |
-a, -t <window>, --target <window> |
Optional target/window selection and -a use the window command parser; no positional arguments. | Attached client/pane | bind-key x kill-window |
last-pane |
- | Selects the previously active pane; arguments use the existing pane command parser. | Attached client/pane | bind-key x last-pane |
last-window |
- | No arguments retained; selects the previously active window. | Attached client/pane | bind-key x last-window |
link-window |
-k, -s <window>, --source <window>, -t <window>, --target <window> |
Source and destination selectors use the window command parser; -k replaces an occupied destination. | Attached client/pane | bind-key x link-window -s work:0 -t work:2 |
list-buffers |
- | Mapped at definition time but rejected at execution in bindings/attached commands. Use the standalone list-buffers command. | Attached client/pane | Not executable in a binding |
move-pane |
-h, -v, -s <pane>, --source <pane>, -t <pane>, --target <pane> |
Source/destination pane selectors and split orientation; no positional arguments. | Attached client/pane | bind-key x move-pane -s work:1.0 -t work:0.0 |
move-window |
-r, -s <window>, --source <window>, -t <window>, --target <window> |
Optional source/target selectors; -r reindexes. No positional arguments. | Attached client/pane | bind-key x move-window -r |
new-window |
- | Creates a window with defaults; name, index and shell arguments are discarded on this direct binding path. | Attached client/pane | bind-key x new-window |
next-layout |
-t <window>, --target <window> |
Optional window target; no positional arguments. | Server/configuration | bind-key x next-layout |
next-window |
- | No arguments retained; selects the next window. | Attached client/pane | bind-key x next-window |
paste-buffer |
-b <buffer>, -n <buffer> |
Optional -b/-n NAME (also attached forms) uses the normal active-pane buffer path. Bare keyboard form uses the latest internal buffer. Bare mouse form requests Windows clipboard text for the pointer pane (or active pane if none), falling back to the latest internal buffer when empty/unavailable. Standalone --buffer/delete options are not mapped. | Attached client/pane | bind-key x paste-buffer -b sample |
pipe-pane |
-I, -O, -o, -t <pane>, --target <pane> |
Pipe flags and optional pane target precede a shell command; -I supplies pane input, -O pipes pane output, -o opens only if not already piped. | Server/configuration | bind-key x pipe-pane -O more |
previous-window |
- | No arguments retained; selects the previous window. | Attached client/pane | bind-key x previous-window |
reload, reload-config |
- | Reloads the standard configuration; direct-binding arguments are discarded. | Server/configuration | bind-key x reload-config |
rename-session |
-t <session>, --target <session> |
NAME is retained; rename the current session. | Attached client/pane | bind-key x rename-session work |
resize-pane |
-U [<integer>], -D [<integer>], -L [<integer>], -R [<integer>] |
A direction is required; an optional following positive integer sets the cell count. This is not the built-in zoom action. | Attached client/pane | bind-key x resize-pane -L 5 |
respawn-pane |
-k, --kill, -t <pane>, --target <pane> |
Pane respawn flags and optional shell command use the respawn parser; preserve its live/dead-pane and replacement rules. | Attached client/pane | bind-key x respawn-pane -k |
respawn-window |
-k, --kill, -t <window>, --target <window> |
Window respawn flags and optional shell command use the respawn parser. | Attached client/pane | bind-key x respawn-window -k |
rotate-window |
-D, -U, -t <window>, --target <window> |
Optional direction/window target; no positional arguments. | Attached client/pane | bind-key x rotate-window -D |
select-layout |
-t <window>, --target <window> |
One layout name with optional window target; see the supported layout reference. | Server/configuration | bind-key x select-layout even-horizontal |
select-pane |
-U, -D, -L, -R |
Use one direction. With no direction, selects the pane under a mouse event; that bare form needs mouse context. | Attached client/pane | bind-key x select-pane -L |
select-window |
-t <window> |
Requires -t INDEX (or -tINDEX); a positional index alone is not mapped. | Attached client/pane | bind-key x select-window -t 1 |
set-buffer |
-a, --append, -b <buffer>, -n <buffer>, --buffer <buffer> |
TEXT with optional buffer-name flags is forwarded to the buffer parser; names/text follow its binding contract. | Attached client/pane | bind-key x set-buffer -b sample hello |
set, set-option |
-g, -t <session>, --target <session>, -u |
OPTION and VALUE, or unset form, use the runtime option parser; use the option reference for supported values/scope. | Server/configuration | bind-key x set-option status-left ready |
setw, set-window-option |
-g, -t <session>, --target <session>, -u |
Uses the same runtime option parser; this does not imply full tmux window-option scope. | Server/configuration | bind-key x set-window-option synchronize-panes on |
show-option, show-options, show |
-g |
Optional OPTION and query flags; use the option reference for supported names/scope. | Server/configuration | bind-key x show-options status |
source-file, source |
- | An optional first PATH is retained; no path reloads the standard configuration. Further direct-binding arguments are not retained. | Server/configuration | bind-key x source-file |
split-window |
-h |
Only -h is retained: left/right with -h, top/bottom otherwise; shell/name/target arguments are not retained. | Attached client/pane | bind-key x split-window -h |
swap-pane |
-d, -D, -U, -s <pane>, --source <pane>, -t <pane>, --target <pane> |
Optional source/target pane selectors, direction and detached-selection flag; no positional arguments. | Attached client/pane | bind-key x swap-pane -D |
swap-window |
-s <window>, --source <window>, -t <window>, --target <window> |
Optional source/target window selectors; no positional arguments. | Attached client/pane | bind-key x swap-window -t 1 |
switch-client, next-session, previous-session, last-session |
-t <session>, --target <session>, -T <table> |
switch-client uses -t SESSION, -t +, -t -, -t last, or -T TABLE. next-session/previous-session/last-session discard arguments and navigate directly. A table switch must be the sole command. | Attached client/pane | bind-key x switch-client -t work |
unlink-window |
-k (inert), -t <window>, --target <window> |
Optional target; -k is accepted but inert. No positional arguments. | Attached client/pane | bind-key x unlink-window |
Built-in internal zoom, synchronize and command-prompt actions are not automatically custom command spellings. send-keys and rename-window belong to other command paths, not this direct mapping. See Usage for target, layout, buffer, capture, pipe, respawn and overlay contracts; the binding-specific argument losses/restrictions above still apply.
Default command aliases
These are configurable defaults, not intrinsic spellings. A direct single-command binding expands the live alias map when defined; users may replace or remove these aliases. Deferred command lists resolve their stored commands against the live map at execution, so alias changes may affect existing lists. An alias does not add an unsupported direct command/flag or preserve arguments discarded by the direct mapping.
| Default alias | Expansion |
|---|---|
capturep |
capture-pane |
displayp |
display-panes |
findw |
find-window |
killp |
kill-pane |
killw |
kill-window |
lastw |
last-window |
linkw |
link-window |
movew |
move-window |
neww |
new-window |
nextl |
next-layout |
pipep |
pipe-pane |
resizep |
resize-pane |
selectl |
select-layout |
selectp |
select-pane |
splitw |
split-window |
swapw |
swap-window |
unlinkw |
unlink-window |
Command sequences and contexts
A direct single command uses the binding mapping above, not the standalone
parser. For example, binding new-window -n build does not preserve that name,
and binding paste-buffer --buffer sample does not select that buffer.
Use the binding forms shown in the catalog.
An actual semicolon-separated command list follows a different, deferred server command path. Escape the separator in a configuration binding so the configuration loader does not execute the next command immediately:
bind-key x display-message first \; next-window
Accepting a binding definition does not validate every deferred command or its
arguments. Execution follows server ordering and stops on an error. Do not infer
that a standalone command becomes directly bindable, or use an accidental
trailing separator to bypass the direct mapping. Client-local
switch-client -T must remain a sole command; a mixed client/server command list
is rejected.
Targets, buffers and layout names must be valid in the triggering context. Changing a configurable command alias affects subsequent direct single-command definitions; it does not rewrite the action already stored by a direct mapping. Deferred command lists instead resolve their stored commands against the live alias map at execution, so an alias change may affect an existing list. Runtime dispatch uses that same map and does not restore a removed default alias; intrinsic command spellings remain available independently. This reference does not add plugin command privileges, global target grammar or full tmux command compatibility.