# tmux manual

Source: https://libtmux.org/en/tmux/latest/manual/

> Command syntax and behavior for tmux 3.7c.

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](https://libtmux.org/en/tmux/latest/reference/) documents this version's internal declarations.

Start with the [global options](https://libtmux.org/en/tmux/latest/manual/full/#DESCRIPTION), [target syntax](https://libtmux.org/en/tmux/latest/manual/full/#COMMANDS), or [formats](https://libtmux.org/en/tmux/latest/manual/full/#FORMATS). The [full manual](https://libtmux.org/en/tmux/latest/manual/full/) also covers options, hooks and key bindings.

## Clients and sessions

* [`attach-session`](https://libtmux.org/en/tmux/latest/manual/attach-session/)

  If run from outside tmux, attach to target-session in the current terminal.

* [`detach-client`](https://libtmux.org/en/tmux/latest/manual/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`](https://libtmux.org/en/tmux/latest/manual/has-session/)

  Report an error and exit with 1 if the specified session does not exist.

* [`kill-server`](https://libtmux.org/en/tmux/latest/manual/kill-server/)

  Kill the tmux server and clients and destroy all sessions.

* [`kill-session`](https://libtmux.org/en/tmux/latest/manual/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`](https://libtmux.org/en/tmux/latest/manual/list-clients/)

  List all clients attached to the server.

* [`list-commands`](https://libtmux.org/en/tmux/latest/manual/list-commands/)

  List the syntax of command or - if omitted - of all commands supported by tmux.

* [`list-sessions`](https://libtmux.org/en/tmux/latest/manual/list-sessions/)

  List all sessions managed by the server.

* [`lock-client`](https://libtmux.org/en/tmux/latest/manual/lock-client/)

  Lock target-client, see the lock-server command.

* [`lock-session`](https://libtmux.org/en/tmux/latest/manual/lock-session/)

  Lock all clients attached to target-session.

* [`new-session`](https://libtmux.org/en/tmux/latest/manual/new-session/)

  Create a new session with name session-name.

* [`refresh-client`](https://libtmux.org/en/tmux/latest/manual/refresh-client/)

  Refresh the current client if bound to a key, or a single client if one is given with -t.

* [`rename-session`](https://libtmux.org/en/tmux/latest/manual/rename-session/)

  Rename the session to new-name.

* [`server-access`](https://libtmux.org/en/tmux/latest/manual/server-access/)

  Change the access or read/write permission of user.

* [`show-messages`](https://libtmux.org/en/tmux/latest/manual/show-messages/)

  Show server messages or information.

* [`source-file`](https://libtmux.org/en/tmux/latest/manual/source-file/)

  Execute commands from one or more files specified by path (which may be glob(7) patterns).

* [`start-server`](https://libtmux.org/en/tmux/latest/manual/start-server/)

  Start the tmux server, if not already running, without creating any sessions.

* [`suspend-client`](https://libtmux.org/en/tmux/latest/manual/suspend-client/)

  Suspend a client by sending SIGTSTP (tty stop).

* [`switch-client`](https://libtmux.org/en/tmux/latest/manual/switch-client/)

  Switch the current session for client target-client to target-session.

## Key bindings

* [`bind-key`](https://libtmux.org/en/tmux/latest/manual/bind-key/)

  Bind key key to command.

* [`list-keys`](https://libtmux.org/en/tmux/latest/manual/list-keys/)

  List key bindings.

* [`send-keys`](https://libtmux.org/en/tmux/latest/manual/send-keys/)

  Send a key or keys to a window or client.

* [`send-prefix`](https://libtmux.org/en/tmux/latest/manual/send-prefix/)

  Send the prefix key, or with -2 the secondary prefix key, to a window as if it was pressed.

* [`unbind-key`](https://libtmux.org/en/tmux/latest/manual/unbind-key/)

  Unbind the command bound to key.

## Windows and panes

* [`break-pane`](https://libtmux.org/en/tmux/latest/manual/break-pane/)

  Break src-pane off from its containing window to make it the only pane in dst-window.

* [`capture-pane`](https://libtmux.org/en/tmux/latest/manual/capture-pane/)

  Capture the contents of a pane.

* [`choose-client`](https://libtmux.org/en/tmux/latest/manual/choose-client/)

  Put a pane into client mode, allowing a client to be selected interactively from a list.

* [`choose-tree`](https://libtmux.org/en/tmux/latest/manual/choose-tree/)

  Put a pane into tree mode, where a session, window or pane may be chosen interactively from a tree.

* [`copy-mode`](https://libtmux.org/en/tmux/latest/manual/copy-mode/)

  Enter copy mode.

* [`customize-mode`](https://libtmux.org/en/tmux/latest/manual/customize-mode/)

  Put a pane into customize mode, where options and key bindings may be browsed and modified from a list.

* [`display-panes`](https://libtmux.org/en/tmux/latest/manual/display-panes/)

  Display a visible indicator of each pane shown by target-client.

* [`find-window`](https://libtmux.org/en/tmux/latest/manual/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`](https://libtmux.org/en/tmux/latest/manual/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`](https://libtmux.org/en/tmux/latest/manual/kill-pane/)

  Destroy the given pane.

* [`kill-window`](https://libtmux.org/en/tmux/latest/manual/kill-window/)

  Kill the current window or the window at target-window, removing it from any sessions to which it is linked.

* [`last-pane`](https://libtmux.org/en/tmux/latest/manual/last-pane/)

  Select the last (previously selected) pane.

* [`last-window`](https://libtmux.org/en/tmux/latest/manual/last-window/)

  Select the last (previously selected) window.

* [`link-window`](https://libtmux.org/en/tmux/latest/manual/link-window/)

  Link the window at src-window to the specified dst-window.

* [`list-panes`](https://libtmux.org/en/tmux/latest/manual/list-panes/)

  If -a is given, target is ignored and all panes on the server are listed.

* [`list-windows`](https://libtmux.org/en/tmux/latest/manual/list-windows/)

  If -a is given, list all windows on the server.

* [`move-pane`](https://libtmux.org/en/tmux/latest/manual/move-pane/)

  Does the same as join-pane.

* [`move-window`](https://libtmux.org/en/tmux/latest/manual/move-window/)

  This is similar to link-window, except the window at src-window is moved to dst-window.

* [`new-pane`](https://libtmux.org/en/tmux/latest/manual/new-pane/)

  Create a new pane.

* [`new-window`](https://libtmux.org/en/tmux/latest/manual/new-window/)

  Create a new window.

* [`next-layout`](https://libtmux.org/en/tmux/latest/manual/next-layout/)

  Move a window to the next layout and rearrange the panes to fit.

* [`next-window`](https://libtmux.org/en/tmux/latest/manual/next-window/)

  Move to the next window in the session.

* [`pipe-pane`](https://libtmux.org/en/tmux/latest/manual/pipe-pane/)

  Pipe output sent by the program in target-pane to a shell command or vice versa.

* [`previous-layout`](https://libtmux.org/en/tmux/latest/manual/previous-layout/)

  Move to the previous layout in the session.

* [`previous-window`](https://libtmux.org/en/tmux/latest/manual/previous-window/)

  Move to the previous window in the session.

* [`rename-window`](https://libtmux.org/en/tmux/latest/manual/rename-window/)

  Rename the current window, or the window at target-window if specified, to new-name.

* [`resize-pane`](https://libtmux.org/en/tmux/latest/manual/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`](https://libtmux.org/en/tmux/latest/manual/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`](https://libtmux.org/en/tmux/latest/manual/respawn-pane/)

  Reactivate a pane in which the command has exited (see the remain-on-exit window option).

* [`respawn-window`](https://libtmux.org/en/tmux/latest/manual/respawn-window/)

  Reactivate a window in which the command has exited (see the remain-on-exit window option).

* [`rotate-window`](https://libtmux.org/en/tmux/latest/manual/rotate-window/)

  Rotate the positions of the panes within a window, either upward (numerically lower) with -U or downward (numerically higher).

* [`select-layout`](https://libtmux.org/en/tmux/latest/manual/select-layout/)

  Choose a specific layout for a window.

* [`select-pane`](https://libtmux.org/en/tmux/latest/manual/select-pane/)

  Make pane target-pane the active pane in its window.

* [`select-window`](https://libtmux.org/en/tmux/latest/manual/select-window/)

  Select the window at target-window.

* [`split-window`](https://libtmux.org/en/tmux/latest/manual/split-window/)

  Creates a new pane by splitting target-pane.

* [`swap-pane`](https://libtmux.org/en/tmux/latest/manual/swap-pane/)

  Swap two panes.

* [`swap-window`](https://libtmux.org/en/tmux/latest/manual/swap-window/)

  This is similar to link-window, except the source and destination windows are swapped.

* [`unlink-window`](https://libtmux.org/en/tmux/latest/manual/unlink-window/)

  Unlink target-window.

## Buffers

* [`choose-buffer`](https://libtmux.org/en/tmux/latest/manual/choose-buffer/)

  Put a pane into buffer mode, where a buffer may be chosen interactively from a list.

* [`clear-history`](https://libtmux.org/en/tmux/latest/manual/clear-history/)

  Remove and free the history for the specified pane.

* [`delete-buffer`](https://libtmux.org/en/tmux/latest/manual/delete-buffer/)

  Delete the buffer named buffer-name, or the most recently added automatically named buffer if not specified.

* [`list-buffers`](https://libtmux.org/en/tmux/latest/manual/list-buffers/)

  List the global buffers.

* [`load-buffer`](https://libtmux.org/en/tmux/latest/manual/load-buffer/)

  Load the contents of the specified paste buffer from path.

* [`paste-buffer`](https://libtmux.org/en/tmux/latest/manual/paste-buffer/)

  Insert the contents of a paste buffer into the specified pane.

* [`save-buffer`](https://libtmux.org/en/tmux/latest/manual/save-buffer/)

  Save the contents of the specified paste buffer to path.

* [`set-buffer`](https://libtmux.org/en/tmux/latest/manual/set-buffer/)

  Set the contents of the specified buffer to data.

* [`show-buffer`](https://libtmux.org/en/tmux/latest/manual/show-buffer/)

  Display the contents of the specified buffer.

## Status line

* [`clear-prompt-history`](https://libtmux.org/en/tmux/latest/manual/clear-prompt-history/)

  Clear status prompt history for prompt type prompt-type.

* [`command-prompt`](https://libtmux.org/en/tmux/latest/manual/command-prompt/)

  Open the command prompt in a client.

* [`confirm-before`](https://libtmux.org/en/tmux/latest/manual/confirm-before/)

  Ask for confirmation before executing command.

* [`display-menu`](https://libtmux.org/en/tmux/latest/manual/display-menu/)

  Display a menu on target-client.

* [`display-message`](https://libtmux.org/en/tmux/latest/manual/display-message/)

  Display a message.

* [`display-popup`](https://libtmux.org/en/tmux/latest/manual/display-popup/)

  Display a popup running shell-command (or default-command when omitted) on target-client.

* [`show-prompt-history`](https://libtmux.org/en/tmux/latest/manual/show-prompt-history/)

  Display status prompt history for prompt type prompt-type.

## Miscellaneous

* [`clock-mode`](https://libtmux.org/en/tmux/latest/manual/clock-mode/)

  Display a large clock.

* [`if-shell`](https://libtmux.org/en/tmux/latest/manual/if-shell/)

  Execute the first command if shell-command (run with /bin/sh) returns success or the second command otherwise.

* [`lock-server`](https://libtmux.org/en/tmux/latest/manual/lock-server/)

  Lock each client individually by running the command specified by the lock-command option.

* [`run-shell`](https://libtmux.org/en/tmux/latest/manual/run-shell/)

  Execute shell-command using /bin/sh or (with -C) a tmux command in the background without creating a window.

* [`wait-for`](https://libtmux.org/en/tmux/latest/manual/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`](https://libtmux.org/en/tmux/latest/manual/set-environment/)

  Set or unset an environment variable.

* [`show-environment`](https://libtmux.org/en/tmux/latest/manual/show-environment/)

  Display the environment for target-session or the global environment with -g.

## Hooks

* [`set-hook`](https://libtmux.org/en/tmux/latest/manual/set-hook/)

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

* [`show-hooks`](https://libtmux.org/en/tmux/latest/manual/show-hooks/)

  Shows hooks.

## Options

* [`set-option`](https://libtmux.org/en/tmux/latest/manual/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`](https://libtmux.org/en/tmux/latest/manual/set-window-option/)

  Window-scoped form of set-option.

* [`show-options`](https://libtmux.org/en/tmux/latest/manual/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`](https://libtmux.org/en/tmux/latest/manual/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](https://libtmux.org/en/tmux/latest/manual/full/#DESCRIPTION) for sockets and configuration, and [command syntax and targets](https://libtmux.org/en/tmux/latest/manual/full/#COMMANDS).

Behavior is taken from the [tmux 3.7c manual](https://github.com/tmux/tmux/blob/79072dd1a9f5fb437a5859e362a496fd57ec0981/tmux.1).

```
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.
```
