-.\" $OpenBSD: tmux.1,v 1.857 2021/10/07 07:53:31 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.858 2021/10/08 06:37:39 kn Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: October 7 2021 $
+.Dd $Mdocdate: October 8 2021 $
.Dt TMUX 1
.Os
.Sh NAME
.Pp
The following commands are available to manage clients and sessions:
.Bl -tag -width Ds
+.Tg attach
.It Xo Ic attach-session
.Op Fl dErx
.Op Fl c Ar working-directory
is used, the
.Ic update-environment
option will not be applied.
+.Tg detach
.It Xo Ic detach-client
.Op Fl aP
.Op Fl E Ar shell-command
run
.Ar shell-command
to replace the client.
+.Tg has
.It Ic has-session Op Fl t Ar target-session
.D1 (alias: Ic has )
Report an error and exit with 1 if the specified session does not exist.
.Fl C
flag clears alerts (bell, activity, or silence) in all windows linked to the
session.
+.Tg lsc
.It Xo Ic list-clients
.Op Fl F Ar format
.Op Fl t Ar target-session
If
.Ar target-session
is specified, list only clients connected to that session.
+.Tg lscm
.It Xo Ic list-commands
.Op Fl F Ar format
.Op Ar command
.Ar command
or - if omitted - of all commands supported by
.Nm .
+.Tg ls
.It Xo Ic list-sessions
.Op Fl F Ar format
.Op Fl f Ar filter
See the
.Sx FORMATS
section.
+.Tg lockc
.It Ic lock-client Op Fl t Ar target-client
.D1 (alias: Ic lockc )
Lock
see the
.Ic lock-server
command.
+.Tg locks
.It Ic lock-session Op Fl t Ar target-session
.D1 (alias: Ic locks )
Lock all clients attached to
.Ar target-session .
+.Tg new
.It Xo Ic new-session
.Op Fl AdDEPX
.Op Fl c Ar start-directory
.Ql VARIABLE=value
and sets an environment variable for the newly created session; it may be
specified multiple times.
+.Tg refresh
.It Xo Ic refresh-client
.Op Fl cDlLRSU
.Op Fl A Ar pane:state
See the
.Ic window-size
option.
+.Tg rename
.It Xo Ic rename-session
.Op Fl t Ar target-session
.Ar new-name
.D1 (alias: Ic rename )
Rename the session to
.Ar new-name .
+.Tg showmsgs
.It Xo Ic show-messages
.Op Fl JT
.Op Fl t Ar target-client
and
.Fl T
show debugging information about jobs and terminals.
+.Tg source
.It Xo Ic source-file
.Op Fl Fnqv
.Ar path
the file is parsed but no commands are executed.
.Fl v
shows the parsed commands and line numbers if possible.
+.Tg start
.It Ic start-server
.D1 (alias: Ic start )
Start the
.Bd -literal -offset indent
$ tmux start \\; show -g
.Ed
+.Tg suspendc
.It Xo Ic suspend-client
.Op Fl t Ar target-client
.Xc
Suspend a client by sending
.Dv SIGTSTP
(tty stop).
+.Tg switchc
.It Xo Ic switch-client
.Op Fl ElnprZ
.Op Fl c Ar target-client
.Pp
Commands related to windows and panes are as follows:
.Bl -tag -width Ds
+.Tg breakp
.It Xo Ic break-pane
.Op Fl abdP
.Op Fl F Ar format
.Ql #{session_name}:#{window_index}.#{pane_index}
but a different format may be specified with
.Fl F .
+.Tg capturep
.It Xo Ic capture-pane
.Op Fl aepPqCJN
.Op Fl b Ar buffer-name
starts without the option information.
This command works only if at least one client is attached.
.It Xo
+.Tg displayp
.Ic display-panes
.Op Fl bN
.Op Fl d Ar duration
With
.Fl b ,
other commands are not blocked from running until the indicator is closed.
+.Tg findw
.It Xo Ic find-window
.Op Fl iCNrTZ
.Op Fl t Ar target-pane
zooms the pane.
.Pp
This command works only if at least one client is attached.
+.Tg joinp
.It Xo Ic join-pane
.Op Fl bdfhv
.Op Fl l Ar size
.Ic select-pane
.Fl m ) ,
the marked pane is used rather than the current pane.
+.Tg killp
.It Xo Ic kill-pane
.Op Fl a
.Op Fl t Ar target-pane
.Fl a
option kills all but the pane given with
.Fl t .
+.Tg killw
.It Xo Ic kill-window
.Op Fl a
.Op Fl t Ar target-window
.Fl a
option kills all but the window given with
.Fl t .
+.Tg lastp
.It Xo Ic last-pane
.Op Fl deZ
.Op Fl t Ar target-window
enables or
.Fl d
disables input to the pane.
+.Tg last
.It Ic last-window Op Fl t Ar target-session
.D1 (alias: Ic last )
Select the last (previously selected) window.
If no
.Ar target-session
is specified, select the last window of the current session.
+.Tg link
.It Xo Ic link-window
.Op Fl abdk
.Op Fl s Ar src-window
If
.Fl d
is given, the newly linked window is not selected.
+.Tg lsp
.It Xo Ic list-panes
.Op Fl as
.Op Fl F Ar format
See the
.Sx FORMATS
section.
+.Tg lsw
.It Xo Ic list-windows
.Op Fl a
.Op Fl F Ar format
See the
.Sx FORMATS
section.
+.Tg movep
.It Xo Ic move-pane
.Op Fl bdfhv
.Op Fl l Ar size
.D1 (alias: Ic movep )
Does the same as
.Ic join-pane .
+.Tg movew
.It Xo Ic move-window
.Op Fl abrdk
.Op Fl s Ar src-window
the
.Ic base-index
option.
+.Tg neww
.It Xo Ic new-window
.Op Fl abdkPS
.Op Fl c Ar start-directory
.Ql #{session_name}:#{window_index}
but a different format may be specified with
.Fl F .
+.Tg nextl
.It Ic next-layout Op Fl t Ar target-window
.D1 (alias: Ic nextl )
Move a window to the next layout and rearrange the panes to fit.
+.Tg next
.It Xo Ic next-window
.Op Fl a
.Op Fl t Ar target-session
If
.Fl a
is used, move to the next window with an alert.
+.Tg pipep
.It Xo Ic pipe-pane
.Op Fl IOo
.Op Fl t Ar target-pane
.Bd -literal -offset indent
bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
.Ed
+.Tg prevl
.It Xo Ic previous-layout
.Op Fl t Ar target-window
.Xc
.D1 (alias: Ic prevl )
Move to the previous layout in the session.
+.Tg prev
.It Xo Ic previous-window
.Op Fl a
.Op Fl t Ar target-session
With
.Fl a ,
move to the previous window with an alert.
+.Tg renamew
.It Xo Ic rename-window
.Op Fl t Ar target-window
.Ar new-name
.Ar target-window
if specified, to
.Ar new-name .
+.Tg resizep
.It Xo Ic resize-pane
.Op Fl DLMRTUZ
.Op Fl t Ar target-pane
.Fl T
trims all lines below the current cursor position and moves lines out of the
history to replace them.
+.Tg resizew
.It Xo Ic resize-window
.Op Fl aADLRU
.Op Fl t Ar target-window
This command will automatically set
.Ic window-size
to manual in the window options.
+.Tg respawnp
.It Xo Ic respawn-pane
.Op Fl k
.Op Fl c Ar start-directory
option has the same meaning as for the
.Ic new-window
command.
+.Tg respawnw
.It Xo Ic respawn-window
.Op Fl k
.Op Fl c Ar start-directory
option has the same meaning as for the
.Ic new-window
command.
+.Tg rotatew
.It Xo Ic rotate-window
.Op Fl DUZ
.Op Fl t Ar target-window
or downward (numerically higher).
.Fl Z
keeps the window zoomed if it was zoomed.
+.Tg selectl
.It Xo Ic select-layout
.Op Fl Enop
.Op Fl t Ar target-pane
applies the last set layout if possible (undoes the most recent layout change).
.Fl E
spreads the current pane and any panes next to it out evenly.
+.Tg selectp
.It Xo Ic select-pane
.Op Fl DdeLlMmRUZ
.Op Fl T Ar title
.Ic swap-pane
and
.Ic swap-window .
+.Tg selectw
.It Xo Ic select-window
.Op Fl lnpT
.Op Fl t Ar target-window
is given and the selected window is already the current window,
the command behaves like
.Ic last-window .
+.Tg splitw
.It Xo Ic split-window
.Op Fl bdfhIvPZ
.Op Fl c Ar start-directory
All other options have the same meaning as for the
.Ic new-window
command.
+.Tg swapp
.It Xo Ic swap-pane
.Op Fl dDUZ
.Op Fl s Ar src-pane
.Ic select-pane
.Fl m ) ,
the marked pane is used rather than the current pane.
+.Tg swapw
.It Xo Ic swap-window
.Op Fl d
.Op Fl s Ar src-window
.Ic select-pane
.Fl m ) ,
the window containing the marked pane is used rather than the current window.
+.Tg unlinkw
.It Xo Ic unlink-window
.Op Fl k
.Op Fl t Ar target-window
.Pp
Commands related to key bindings are as follows:
.Bl -tag -width Ds
+.Tg bind
.It Xo Ic bind-key
.Op Fl nr
.Op Fl N Ar note
To view the default bindings and possible commands, see the
.Ic list-keys
command.
+.Tg lsk
.It Xo Ic list-keys
.Op Fl 1aN
.Op Fl P Ar prefix-string Fl T Ar key-table
lists only the first matching key.
.Fl a
lists the command for keys that do not have a note rather than skipping them.
+.Tg send
.It Xo Ic send-keys
.Op Fl FHlMRX
.Op Fl N Ar repeat-count
Send the prefix key, or with
.Fl 2
the secondary prefix key, to a window as if it was pressed.
+.Tg unbind
.It Xo Ic unbind-key
.Op Fl anq
.Op Fl T Ar key-table
.Pp
Commands which set options are as follows:
.Bl -tag -width Ds
+.Tg set
.It Xo Ic set-option
.Op Fl aFgopqsuUw
.Op Fl t Ar target-pane
Without
.Fl a ,
the result would be the default background and a blue foreground.
+.Tg show
.It Xo Ic show-options
.Op Fl AgHpqsvw
.Op Fl t Ar target-pane
.Pp
Commands to alter and view the environment are:
.Bl -tag -width Ds
+.Tg setenv
.It Xo Ic set-environment
.Op Fl Fhgru
.Op Fl t Ar target-session
new process.
.Fl h
marks the variable as hidden.
+.Tg showenv
.It Xo Ic show-environment
.Op Fl hgs
.Op Fl t Ar target-session
.Pp
Commands related to the status line are as follows:
.Bl -tag -width Ds
+.Tg clrphist
.It Xo Ic clear-prompt-history
.Op Fl T Ar prompt-type
.Xc
.Fl b ,
the prompt is shown in the background and the invoking client does not exit
until it is dismissed.
+.Tg confirm
.It Xo Ic confirm-before
.Op Fl b
.Op Fl p Ar prompt
.Fl b ,
the prompt is shown in the background and the invoking client does not exit
until it is dismissed.
+.Tg menu
.It Xo Ic display-menu
.Op Fl O
.Op Fl c Ar target-client
.It Li "Down" Ta "Select next item"
.It Li "q" Ta "Exit menu"
.El
+.Tg display
.It Xo Ic display-message
.Op Fl aINpv
.Op Fl c Ar target-client
.Fl I
forwards any input read from stdin to the empty pane given by
.Ar target-pane .
+.Tg popup
.It Xo Ic display-popup
.Op Fl BCE
.Op Fl c Ar target-client
The
.Fl C
flag closes any popup on the client.
+.Tg showphist
.It Xo Ic show-prompt-history
.Op Fl T Ar prompt-type
.Xc
.Fl N
starts without the preview.
This command works only if at least one client is attached.
+.Tg clearhist
.It Ic clear-history Op Fl t Ar target-pane
.D1 (alias: Ic clearhist )
Remove and free the history for the specified pane.
+.Tg deleteb
.It Ic delete-buffer Op Fl b Ar buffer-name
.D1 (alias: Ic deleteb )
Delete the buffer named
.Ar buffer-name ,
or the most recently added automatically named buffer if not specified.
+.Tg lsb
.It Xo Ic list-buffers
.Op Fl F Ar format
.Op Fl f Ar filter
.Op Fl t Ar target-client
.Ar path
.Xc
+.Tg loadb
.D1 (alias: Ic loadb )
Load the contents of the specified paste buffer from
.Ar path .
using the
.Xr xterm 1
escape sequence, if possible.
+.Tg pasteb
.It Xo Ic paste-buffer
.Op Fl dpr
.Op Fl b Ar buffer-name
.Fl p
is specified, paste bracket control codes are inserted around the
buffer if the application has requested bracketed paste mode.
+.Tg saveb
.It Xo Ic save-buffer
.Op Fl a
.Op Fl b Ar buffer-name
.Op Fl aw
.Op Fl b Ar buffer-name
.Op Fl t Ar target-client
+.Tg setb
.Op Fl n Ar new-buffer-name
.Ar data
.Xc
.Fl n
option renames the buffer to
.Ar new-buffer-name .
+.Tg showb
.It Xo Ic show-buffer
.Op Fl b Ar buffer-name
.Xc
.Bl -tag -width Ds
.It Ic clock-mode Op Fl t Ar target-pane
Display a large clock.
+.Tg if
.It Xo Ic if-shell
.Op Fl bF
.Op Fl t Ar target-pane
.Ar shell-command
is not executed but considered success if neither empty nor zero (after formats
are expanded).
+.Tg lock
.It Ic lock-server
.D1 (alias: Ic lock )
Lock each client individually by running the command specified by the
.Ic lock-command
option.
+.Tg run
.It Xo Ic run-shell
.Op Fl bC
.Op Fl d Ar delay
.Fl t
or the current pane if omitted) after the command finishes.
If the command fails, the exit status is also displayed.
+.Tg wait
.It Xo Ic wait-for
.Op Fl L | S | U
.Ar channel