tmuxtmuxCLI Manual

Choose documentation 1

3.7c

tmux manual version

Latest (3.7c) 3.7c 3.2a
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

tmux manual

Look up the flags and behavior supported by tmux 3.7c. Choose the version installed on your machine with tmux -V.

The C source reference documents this version's internal declarations.

Start with the global options, target syntax, or formats. The full manual also covers options, hooks and key bindings.

Clients and sessions

attach-session
If run from outside tmux, attach to target-session in the current terminal.
detach-client
Detach the current client if bound to a key, the client specified with -t, or all clients currently attached to the session specified by -s.
has-session
Report an error and exit with 1 if the specified session does not exist.
kill-server
Kill the tmux server and clients and destroy all sessions.
kill-session
Destroy the given session, closing any windows linked to it and no other sessions, and detaching all clients attached to it.
list-clients
List all clients attached to the server.
list-commands
List the syntax of command or - if omitted - of all commands supported by tmux.
list-sessions
List all sessions managed by the server.
lock-client
Lock target-client, see the lock-server command.
lock-session
Lock all clients attached to target-session.
new-session
Create a new session with name session-name.
refresh-client
Refresh the current client if bound to a key, or a single client if one is given with -t.
rename-session
Rename the session to new-name.
server-access
Change the access or read/write permission of user.
show-messages
Show server messages or information.
source-file
Execute commands from one or more files specified by path (which may be glob(7) patterns).
start-server
Start the tmux server, if not already running, without creating any sessions.
suspend-client
Suspend a client by sending SIGTSTP (tty stop).
switch-client
Switch the current session for client target-client to target-session.

Key bindings

bind-key
Bind key key to command.
list-keys
List key bindings.
send-keys
Send a key or keys to a window or client.
send-prefix
Send the prefix key, or with -2 the secondary prefix key, to a window as if it was pressed.
unbind-key
Unbind the command bound to key.

Windows and panes

break-pane
Break src-pane off from its containing window to make it the only pane in dst-window.
capture-pane
Capture the contents of a pane.
choose-client
Put a pane into client mode, allowing a client to be selected interactively from a list.
choose-tree
Put a pane into tree mode, where a session, window or pane may be chosen interactively from a tree.
copy-mode
Enter copy mode.
customize-mode
Put a pane into customize mode, where options and key bindings may be browsed and modified from a list.
display-panes
Display a visible indicator of each pane shown by target-client.
find-window
Search for a glob(7) pattern or, with -r, regular expression match-string in window names, titles, and visible content (but not history).
join-pane
Like split-window, but instead of splitting dst-pane and creating a new pane, split it and move src-pane into the space.
kill-pane
Destroy the given pane.
kill-window
Kill the current window or the window at target-window, removing it from any sessions to which it is linked.
last-pane
Select the last (previously selected) pane.
last-window
Select the last (previously selected) window.
link-window
Link the window at src-window to the specified dst-window.
list-panes
If -a is given, target is ignored and all panes on the server are listed.
list-windows
If -a is given, list all windows on the server.
move-pane
Does the same as join-pane.
move-window
This is similar to link-window, except the window at src-window is moved to dst-window.
new-pane
Create a new pane.
new-window
Create a new window.
next-layout
Move a window to the next layout and rearrange the panes to fit.
next-window
Move to the next window in the session.
pipe-pane
Pipe output sent by the program in target-pane to a shell command or vice versa.
previous-layout
Move to the previous layout in the session.
previous-window
Move to the previous window in the session.
rename-window
Rename the current window, or the window at target-window if specified, to new-name.
resize-pane
Resize a pane, up, down, left or right by adjustment with -U, -D, -L or -R, or to an absolute size with -x or -y.
resize-window
Resize a window, up, down, left or right by adjustment with -U, -D, -L or -R, or to an absolute size with -x or -y.
respawn-pane
Reactivate a pane in which the command has exited (see the remain-on-exit window option).
respawn-window
Reactivate a window in which the command has exited (see the remain-on-exit window option).
rotate-window
Rotate the positions of the panes within a window, either upward (numerically lower) with -U or downward (numerically higher).
select-layout
Choose a specific layout for a window.
select-pane
Make pane target-pane the active pane in its window.
select-window
Select the window at target-window.
split-window
Creates a new pane by splitting target-pane.
swap-pane
Swap two panes.
swap-window
This is similar to link-window, except the source and destination windows are swapped.
unlink-window
Unlink target-window.

Buffers

choose-buffer
Put a pane into buffer mode, where a buffer may be chosen interactively from a list.
clear-history
Remove and free the history for the specified pane.
delete-buffer
Delete the buffer named buffer-name, or the most recently added automatically named buffer if not specified.
list-buffers
List the global buffers.
load-buffer
Load the contents of the specified paste buffer from path.
paste-buffer
Insert the contents of a paste buffer into the specified pane.
save-buffer
Save the contents of the specified paste buffer to path.
set-buffer
Set the contents of the specified buffer to data.
show-buffer
Display the contents of the specified buffer.

Status line

clear-prompt-history
Clear status prompt history for prompt type prompt-type.
command-prompt
Open the command prompt in a client.
confirm-before
Ask for confirmation before executing command.
display-menu
Display a menu on target-client.
display-message
Display a message.
display-popup
Display a popup running shell-command (or default-command when omitted) on target-client.
show-prompt-history
Display status prompt history for prompt type prompt-type.

Miscellaneous

clock-mode
Display a large clock.
if-shell
Execute the first command if shell-command (run with /bin/sh) returns success or the second command otherwise.
lock-server
Lock each client individually by running the command specified by the lock-command option.
run-shell
Execute shell-command using /bin/sh or (with -C) a tmux command in the background without creating a window.
wait-for
When used without options, prevents the client from exiting until woken using wait-for -S with the same channel.

Global and session environment

set-environment
Set or unset an environment variable.
show-environment
Display the environment for target-session or the global environment with -g.

Hooks

set-hook
Without -R, sets (or with -u unsets) hook hook-name to command.
show-hooks
Shows hooks.

Options

set-option
Set a pane option with -p, a window option with -w, a server option with -s, otherwise a session option.
set-window-option
Window-scoped form of set-option.
show-options
Show the pane options (or a single option if option is provided) with -p, the window options with -w, the server options with -s, otherwise the session options.
show-window-options
Window-scoped form of show-options.
tmux sources and license

Syntax comes from tmux 3.7c list-commands. See the global options for sockets and configuration, and command syntax and targets.

Behavior is taken from the tmux 3.7c manual.

Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Esc

Type to search.