1TMUX(1)                   BSD General Commands Manual                  TMUX(1)
2

NAME

4     tmux — terminal multiplexer
5

SYNOPSIS

7     tmux [-28lCquvV] [-c shell-command] [-f file] [-L socket-name]
8          [-S socket-path] [command [flags]]
9

DESCRIPTION

11     tmux is a terminal multiplexer: it enables a number of terminals to be
12     created, accessed, and controlled from a single screen.  tmux may be
13     detached from a screen and continue running in the background, then later
14     reattached.
15
16     When tmux is started it creates a new session with a single window and
17     displays it on screen.  A status line at the bottom of the screen shows
18     information on the current session and is used to enter interactive com‐
19     mands.
20
21     A session is a single collection of pseudo terminals under the management
22     of tmux.  Each session has one or more windows linked to it.  A window
23     occupies the entire screen and may be split into rectangular panes, each
24     of which is a separate pseudo terminal (the pty(4) manual page documents
25     the technical details of pseudo terminals).  Any number of tmux instances
26     may connect to the same session, and any number of windows may be present
27     in the same session.  Once all sessions are killed, tmux exits.
28
29     Each session is persistent and will survive accidental disconnection
30     (such as ssh(1) connection timeout) or intentional detaching (with the
31     ‘C-b d’ key strokes).  tmux may be reattached using:
32
33           $ tmux attach
34
35     In tmux, a session is displayed on screen by a client and all sessions
36     are managed by a single server.  The server and each client are separate
37     processes which communicate through a socket in /tmp.
38
39     The options are as follows:
40
41     -2            Force tmux to assume the terminal supports 256 colours.
42
43     -8            Like -2, but indicates that the terminal supports 88
44                   colours.
45
46     -C            Start in control mode.  Given twice (-CC) disables echo.
47
48     -c shell-command
49                   Execute shell-command using the default shell.  If neces‐
50                   sary, the tmux server will be started to retrieve the
51                   default-shell option.  This option is for compatibility
52                   with sh(1) when tmux is used as a login shell.
53
54     -f file       Specify an alternative configuration file.  By default,
55                   tmux loads the system configuration file from
56                   /etc/tmux.conf, if present, then looks for a user configu‐
57                   ration file at ~/.tmux.conf.
58
59                   The configuration file is a set of tmux commands which are
60                   executed in sequence when the server is first started.
61                   tmux loads configuration files once when the server process
62                   has started.  The source-file command may be used to load a
63                   file later.
64
65                   tmux shows any error messages from commands in configura‐
66                   tion files in the first session created, and continues to
67                   process the rest of the configuration file.
68
69     -L socket-name
70                   tmux stores the server socket in a directory under /tmp (or
71                   TMPDIR if set); the default socket is named default.  This
72                   option allows a different socket name to be specified,
73                   allowing several independent tmux servers to be run.
74                   Unlike -S a full path is not necessary: the sockets are all
75                   created in the same directory.
76
77                   If the socket is accidentally removed, the SIGUSR1 signal
78                   may be sent to the tmux server process to recreate it.
79
80     -l            Behave as a login shell.  This flag currently has no effect
81                   and is for compatibility with other shells when using tmux
82                   as a login shell.
83
84     -q            Set the quiet server option to prevent the server sending
85                   various informational messages.
86
87     -S socket-path
88                   Specify a full alternative path to the server socket.  If
89                   -S is specified, the default socket directory is not used
90                   and any -L flag is ignored.
91
92     -u            tmux attempts to guess if the terminal is likely to support
93                   UTF-8 by checking the first of the LC_ALL, LC_CTYPE and
94                   LANG environment variables to be set for the string
95                   "UTF-8".  This is not always correct: the -u flag explic‐
96                   itly informs tmux that UTF-8 is supported.
97
98                   If the server is started from a client passed -u or where
99                   UTF-8 is detected, the utf8 and status-utf8 options are
100                   enabled in the global window and session options respec‐
101                   tively.
102
103     -v            Request verbose logging.  This option may be specified mul‐
104                   tiple times for increasing verbosity.  Log messages will be
105                   saved into tmux-client-PID.log and tmux-server-PID.log
106                   files in the current directory, where PID is the PID of the
107                   server or client process.
108
109     -V            Report the tmux version.
110
111     command [flags]
112                   This specifies one of a set of commands used to control
113                   tmux, as described in the following sections.  If no com‐
114                   mands are specified, the new-session command is assumed.
115

KEY BINDINGS

117     tmux may be controlled from an attached client by using a key combination
118     of a prefix key, ‘C-b’ (Ctrl-b) by default, followed by a command key.
119
120     The default command key bindings are:
121
122           C-b         Send the prefix key (C-b) through to the application.
123           C-o         Rotate the panes in the current window forwards.
124           C-z         Suspend the tmux client.
125           !           Break the current pane out of the window.
126           "           Split the current pane into two, top and bottom.
127           #           List all paste buffers.
128           $           Rename the current session.
129           %           Split the current pane into two, left and right.
130           &           Kill the current window.
131           '           Prompt for a window index to select.
132           ,           Rename the current window.
133           -           Delete the most recently copied buffer of text.
134           .           Prompt for an index to move the current window.
135           0 to 9      Select windows 0 to 9.
136           :           Enter the tmux command prompt.
137           ;           Move to the previously active pane.
138           =           Choose which buffer to paste interactively from a list.
139           ?           List all key bindings.
140           D           Choose a client to detach.
141           [           Enter copy mode to copy text or view the history.
142           ]           Paste the most recently copied buffer of text.
143           c           Create a new window.
144           d           Detach the current client.
145           f           Prompt to search for text in open windows.
146           i           Display some information about the current window.
147           l           Move to the previously selected window.
148           n           Change to the next window.
149           o           Select the next pane in the current window.
150           p           Change to the previous window.
151           q           Briefly display pane indexes.
152           r           Force redraw of the attached client.
153           s           Select a new session for the attached client interac‐
154                       tively.
155           L           Switch the attached client back to the last session.
156           t           Show the time.
157           w           Choose the current window interactively.
158           x           Kill the current pane.
159           {           Swap the current pane with the previous pane.
160           }           Swap the current pane with the next pane.
161           ~           Show previous messages from tmux, if any.
162           Page Up     Enter copy mode and scroll one page up.
163           Up, Down
164           Left, Right
165                       Change to the pane above, below, to the left, or to the
166                       right of the current pane.
167           M-1 to M-5  Arrange panes in one of the five preset layouts: even-
168                       horizontal, even-vertical, main-horizontal, main-verti‐
169                       cal, or tiled.
170           M-n         Move to the next window with a bell or activity marker.
171           M-o         Rotate the panes in the current window backwards.
172           M-p         Move to the previous window with a bell or activity
173                       marker.
174           C-Up, C-Down
175           C-Left, C-Right
176                       Resize the current pane in steps of one cell.
177           M-Up, M-Down
178           M-Left, M-Right
179                       Resize the current pane in steps of five cells.
180
181     Key bindings may be changed with the bind-key and unbind-key commands.
182

COMMANDS

184     This section contains a list of the commands supported by tmux.  Most
185     commands accept the optional -t argument with one of target-client,
186     target-session target-window, or target-pane.  These specify the client,
187     session, window or pane which a command should affect.  target-client is
188     the name of the pty(4) file to which the client is connected, for example
189     either of /dev/ttyp1 or ttyp1 for the client attached to /dev/ttyp1.  If
190     no client is specified, the current client is chosen, if possible, or an
191     error is reported.  Clients may be listed with the list-clients command.
192
193     target-session is the session id prefixed with a $, the name of a session
194     (as listed by the list-sessions command), or the name of a client with
195     the same syntax as target-client, in which case the session attached to
196     the client is used.  When looking for the session name, tmux initially
197     searches for an exact match; if none is found, the session names are
198     checked for any for which target-session is a prefix or for which it
199     matches as an fnmatch(3) pattern.  If a single match is found, it is used
200     as the target session; multiple matches produce an error.  If a session
201     is omitted, the current session is used if available; if no current ses‐
202     sion is available, the most recently used is chosen.
203
204     target-window specifies a window in the form session:window.  session
205     follows the same rules as for target-session, and window is looked for in
206     order: as a window index, for example mysession:1; as a window ID, such
207     as @1; as an exact window name, such as mysession:mywindow; then as an
208     fnmatch(3) pattern or the start of a window name, such as myses‐
209     sion:mywin* or mysession:mywin.  An empty window name specifies the next
210     unused index if appropriate (for example the new-window and link-window
211     commands) otherwise the current window in session is chosen.  The special
212     character ‘!’ uses the last (previously current) window, ‘^’ selects the
213     highest numbered window, ‘$’ selects the lowest numbered window, and ‘+’
214     and ‘-’ select the next window or the previous window by number.  When
215     the argument does not contain a colon, tmux first attempts to parse it as
216     window; if that fails, an attempt is made to match a session.
217
218     target-pane takes a similar form to target-window but with the optional
219     addition of a period followed by a pane index, for example: myses‐
220     sion:mywindow.1.  If the pane index is omitted, the currently active pane
221     in the specified window is used.  If neither a colon nor period appears,
222     tmux first attempts to use the argument as a pane index; if that fails,
223     it is looked up as for target-window.  A ‘+’ or ‘-’ indicate the next or
224     previous pane index, respectively.  One of the strings top, bottom, left,
225     right, top-left, top-right, bottom-left or bottom-right may be used
226     instead of a pane index.
227
228     The special characters ‘+’ and ‘-’ may be followed by an offset, for
229     example:
230
231           select-window -t:+2
232
233     When dealing with a session that doesn't contain sequential window
234     indexes, they will be correctly skipped.
235
236     tmux also gives each pane created in a server an identifier consisting of
237     a ‘%’ and a number, starting from zero.  A pane's identifier is unique
238     for the life of the tmux server and is passed to the child process of the
239     pane in the TMUX_PANE environment variable.  It may be used alone to tar‐
240     get a pane or the window containing it.
241
242     shell-command arguments are sh(1) commands.  These must be passed as a
243     single item, which typically means quoting them, for example:
244
245           new-window 'vi /etc/passwd'
246
247     command [arguments] refers to a tmux command, passed with the command and
248     arguments separately, for example:
249
250           bind-key F1 set-window-option force-width 81
251
252     Or if using sh(1):
253
254           $ tmux bind-key F1 set-window-option force-width 81
255
256     Multiple commands may be specified together as part of a command
257     sequence.  Each command should be separated by spaces and a semicolon;
258     commands are executed sequentially from left to right and lines ending
259     with a backslash continue on to the next line, except when escaped by
260     another backslash.  A literal semicolon may be included by escaping it
261     with a backslash (for example, when specifying a command sequence to
262     bind-key).
263
264     Example tmux commands include:
265
266           refresh-client -t/dev/ttyp2
267
268           rename-session -tfirst newname
269
270           set-window-option -t:0 monitor-activity on
271
272           new-window ; split-window -d
273
274           bind-key R source-file ~/.tmux.conf \; \
275                   display-message "source-file done"
276
277     Or from sh(1):
278
279           $ tmux kill-window -t :1
280
281           $ tmux new-window \; split-window -d
282
283           $ tmux new-session -d 'vi /etc/passwd' \; split-window -d \; attach
284

CLIENTS AND SESSIONS

286     The tmux server manages clients, sessions, windows and panes.  Clients
287     are attached to sessions to interact with them, either when they are cre‐
288     ated with the new-session command, or later with the attach-session com‐
289     mand.  Each session has one or more windows linked into it.  Windows may
290     be linked to multiple sessions and are made up of one or more panes, each
291     of which contains a pseudo terminal.  Commands for creating, linking and
292     otherwise manipulating windows are covered in the WINDOWS AND PANES sec‐
293     tion.
294
295     The following commands are available to manage clients and sessions:
296
297     attach-session [-dr] [-t target-session]
298                   (alias: attach)
299             If run from outside tmux, create a new client in the current ter‐
300             minal and attach it to target-session.  If used from inside,
301             switch the current client.  If -d is specified, any other clients
302             attached to the session are detached.  -r signifies the client is
303             read-only (only keys bound to the detach-client or switch-client
304             commands have any effect)
305
306             If no server is started, attach-session will attempt to start it;
307             this will fail unless sessions are created in the configuration
308             file.
309
310             The target-session rules for attach-session are slightly
311             adjusted: if tmux needs to select the most recently used session,
312             it will prefer the most recently used unattached session.
313
314     detach-client [-P] [-a] [-s target-session] [-t target-client]
315                   (alias: detach)
316             Detach the current client if bound to a key, the client specified
317             with -t, or all clients currently attached to the session speci‐
318             fied by -s.  The -a option kills all but the client given with
319             -t.  If -P is given, send SIGHUP to the parent process of the
320             client, typically causing it to exit.
321
322     has-session [-t target-session]
323                   (alias: has)
324             Report an error and exit with 1 if the specified session does not
325             exist.  If it does exist, exit with 0.
326
327     kill-server
328             Kill the tmux server and clients and destroy all sessions.
329
330     kill-session
331             [-a] [-t target-session] Destroy the given session, closing any
332             windows linked to it and no other sessions, and detaching all
333             clients attached to it.  If -a is given, all sessions but the
334             specified one is killed.
335
336     list-clients [-F format] [-t target-session]
337                   (alias: lsc)
338             List all clients attached to the server.  For the meaning of the
339             -F flag, see the FORMATS section.  If target-session is speci‐
340             fied, list only clients connected to that session.
341
342     list-commands
343                   (alias: lscm)
344             List the syntax of all commands supported by tmux.
345
346     list-sessions [-F format]
347                   (alias: ls)
348             List all sessions managed by the server.  For the meaning of the
349             -F flag, see the FORMATS section.
350
351     lock-client [-t target-client]
352                   (alias: lockc)
353             Lock target-client, see the lock-server command.
354
355     lock-session [-t target-session]
356                   (alias: locks)
357             Lock all clients attached to target-session.
358
359     new-session [-AdDP] [-F format] [-n window-name] [-s session-name] [-t
360             target-session] [-x width] [-y height] [shell-command]
361                   (alias: new)
362             Create a new session with name session-name.
363
364             The new session is attached to the current terminal unless -d is
365             given.  window-name and shell-command are the name of and shell
366             command to execute in the initial window.  If -d is used, -x and
367             -y specify the size of the initial window (80 by 24 if not
368             given).
369
370             If run from a terminal, any termios(4) special characters are
371             saved and used for new windows in the new session.
372
373             The -A flag makes new-session behave like attach-session if
374             session-name already exists; in the case, -D behaves like -d to
375             attach-session.
376
377             If -t is given, the new session is grouped with target-session.
378             This means they share the same set of windows - all windows from
379             target-session are linked to the new session and any subsequent
380             new windows or windows being closed are applied to both sessions.
381             The current and previous window and any session options remain
382             independent and either session may be killed without affecting
383             the other.  Giving -n or shell-command are invalid if -t is used.
384
385             The -P option prints information about the new session after it
386             has been created.  By default, it uses the format
387             ‘#{session_name}:’ but a different format may be specified with
388             -F.
389
390     refresh-client [-S] [-t target-client]
391                   (alias: refresh)
392             Refresh the current client if bound to a key, or a single client
393             if one is given with -t.  If -S is specified, only update the
394             client's status bar.
395
396     rename-session [-t target-session] new-name
397                   (alias: rename)
398             Rename the session to new-name.
399
400     show-messages [-t target-client]
401                   (alias: showmsgs)
402             Any messages displayed on the status line are saved in a per-
403             client message log, up to a maximum of the limit set by the
404             message-limit session option for the session attached to that
405             client.  This command displays the log for target-client.
406
407     source-file path
408                   (alias: source)
409             Execute commands from path.
410
411     start-server
412                   (alias: start)
413             Start the tmux server, if not already running, without creating
414             any sessions.
415
416     suspend-client [-t target-client]
417                   (alias: suspendc)
418             Suspend a client by sending SIGTSTP (tty stop).
419
420     switch-client [-lnpr] [-c target-client] [-t target-session]
421                   (alias: switchc)
422             Switch the current session for client target-client to
423             target-session.  If -l, -n or -p is used, the client is moved to
424             the last, next or previous session respectively.  -r toggles
425             whether a client is read-only (see the attach-session command).
426

WINDOWS AND PANES

428     A tmux window may be in one of several modes.  The default permits direct
429     access to the terminal attached to the window.  The other is copy mode,
430     which permits a section of a window or its history to be copied to a
431     paste buffer for later insertion into another window.  This mode is
432     entered with the copy-mode command, bound to ‘[’ by default.  It is also
433     entered when a command that produces output, such as list-keys, is exe‐
434     cuted from a key binding.
435
436     The keys available depend on whether emacs or vi mode is selected (see
437     the mode-keys option).  The following keys are supported as appropriate
438     for the mode:
439
440           Function                     vi              emacs
441           Back to indentation          ^               M-m
442           Bottom of history            G               M-<
443           Clear selection              Escape          C-g
444           Copy selection               Enter           M-w
445           Cursor down                  j               Down
446           Cursor left                  h               Left
447           Cursor right                 l               Right
448           Cursor to bottom line        L
449           Cursor to middle line        M               M-r
450           Cursor to top line           H               M-R
451           Cursor up                    k               Up
452           Delete entire line           d               C-u
453           Delete/Copy to end of line   D               C-k
454           End of line                  $               C-e
455           Go to line                   :               g
456           Half page down               C-d             M-Down
457           Half page up                 C-u             M-Up
458           Jump forward                 f               f
459           Jump to forward              t
460           Jump backward                F               F
461           Jump to backward             T
462           Jump again                   ;               ;
463           Jump again in reverse        ,               ,
464           Next page                    C-f             Page down
465           Next space                   W
466           Next space, end of word      E
467           Next word                    w
468           Next word end                e               M-f
469           Paste buffer                 p               C-y
470           Previous page                C-b             Page up
471           Previous word                b               M-b
472           Previous space               B
473           Quit mode                    q               Escape
474           Rectangle toggle             v               R
475           Scroll down                  C-Down or C-e   C-Down
476           Scroll up                    C-Up or C-y     C-Up
477           Search again                 n               n
478           Search again in reverse      N               N
479           Search backward              ?               C-r
480           Search forward               /               C-s
481           Start of line                0               C-a
482           Start selection              Space           C-Space
483           Top of history               g               M->
484           Transpose characters                         C-t
485
486     The next and previous word keys use space and the ‘-’, ‘_’ and ‘@’ char‐
487     acters as word delimiters by default, but this can be adjusted by setting
488     the word-separators session option.  Next word moves to the start of the
489     next word, next word end to the end of the next word and previous word to
490     the start of the previous word.  The three next and previous space keys
491     work similarly but use a space alone as the word separator.
492
493     The jump commands enable quick movement within a line.  For instance,
494     typing ‘f’ followed by ‘/’ will move the cursor to the next ‘/’ character
495     on the current line.  A ‘;’ will then jump to the next occurrence.
496
497     Commands in copy mode may be prefaced by an optional repeat count.  With
498     vi key bindings, a prefix is entered using the number keys; with emacs,
499     the Alt (meta) key and a number begins prefix entry.  For example, to
500     move the cursor forward by ten words, use ‘M-1 0 M-f’ in emacs mode, and
501     ‘10w’ in vi.
502
503     When copying the selection, the repeat count indicates the buffer index
504     to replace, if used.
505
506     Mode key bindings are defined in a set of named tables: vi-edit and
507     emacs-edit for keys used when line editing at the command prompt;
508     vi-choice and emacs-choice for keys used when choosing from lists (such
509     as produced by the choose-window command); and vi-copy and emacs-copy
510     used in copy mode.  The tables may be viewed with the list-keys command
511     and keys modified or removed with bind-key and unbind-key.  One command
512     accepts an argument, copy-pipe, which copies the selection and pipes it
513     to a command.  For example the following will bind ‘C-q’ to copy the
514     selection into /tmp as well as the paste buffer:
515
516           bind-key -temacs-copy C-q copy-pipe "cat >/tmp/out"
517
518     The paste buffer key pastes the first line from the top paste buffer on
519     the stack.
520
521     The synopsis for the copy-mode command is:
522
523     copy-mode [-u] [-t target-pane]
524             Enter copy mode.  The -u option scrolls one page up.
525
526     Each window displayed by tmux may be split into one or more panes; each
527     pane takes up a certain area of the display and is a separate terminal.
528     A window may be split into panes using the split-window command.  Windows
529     may be split horizontally (with the -h flag) or vertically.  Panes may be
530     resized with the resize-pane command (bound to ‘C-up’, ‘C-down’ ‘C-left’
531     and ‘C-right’ by default), the current pane may be changed with the
532     select-pane command and the rotate-window and swap-pane commands may be
533     used to swap panes without changing their position.  Panes are numbered
534     beginning from zero in the order they are created.
535
536     A number of preset layouts are available.  These may be selected with the
537     select-layout command or cycled with next-layout (bound to ‘Space’ by
538     default); once a layout is chosen, panes within it may be moved and
539     resized as normal.
540
541     The following layouts are supported:
542
543     even-horizontal
544             Panes are spread out evenly from left to right across the window.
545
546     even-vertical
547             Panes are spread evenly from top to bottom.
548
549     main-horizontal
550             A large (main) pane is shown at the top of the window and the
551             remaining panes are spread from left to right in the leftover
552             space at the bottom.  Use the main-pane-height window option to
553             specify the height of the top pane.
554
555     main-vertical
556             Similar to main-horizontal but the large pane is placed on the
557             left and the others spread from top to bottom along the right.
558             See the main-pane-width window option.
559
560     tiled   Panes are spread out as evenly as possible over the window in
561             both rows and columns.
562
563     In addition, select-layout may be used to apply a previously used layout
564     - the list-windows command displays the layout of each window in a form
565     suitable for use with select-layout.  For example:
566
567           $ tmux list-windows
568           0: ksh [159x48]
569               layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
570           $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
571
572     tmux automatically adjusts the size of the layout for the current window
573     size.  Note that a layout cannot be applied to a window with more panes
574     than that from which the layout was originally defined.
575
576     Commands related to windows and panes are as follows:
577
578     break-pane [-dP] [-F format] [-t target-pane]
579                   (alias: breakp)
580             Break target-pane off from its containing window to make it the
581             only pane in a new window.  If -d is given, the new window does
582             not become the current window.  The -P option prints information
583             about the new window after it has been created.  By default, it
584             uses the format ‘#{session_name}:#{window_index}’ but a different
585             format may be specified with -F.
586
587     capture-pane [-aepPq] [-b buffer-index] [-E end-line] [-S start-line] [-t
588             target-pane]
589                   (alias: capturep)
590             Capture the contents of a pane.  If -p is given, the output goes
591             to stdout, otherwise to the buffer specified with -b or a new
592             buffer if omitted.  If -a is given, the alternate screen is used,
593             and the history is not accessible.  If no alternate screen
594             exists, an error will be returned unless -q is given.  If -e is
595             given, the output includes escape sequences for text and back‐
596             ground attributes.  -C also escapes non-printable characters as
597             octal \xxx.  -J joins wrapped lines and preserves trailing spaces
598             at each line's end.  -P captures only any output that the pane
599             has received that is the beginning of an as-yet incomplete escape
600             sequence.
601
602             -S and -E specify the starting and ending line numbers, zero is
603             the first line of the visible pane and negative numbers are lines
604             in the history.  The default is to capture only the visible con‐
605             tents of the pane.
606
607     choose-client [-F format] [-t target-window] [template]
608             Put a window into client choice mode, allowing a client to be
609             selected interactively from a list.  After a client is chosen,
610             ‘%%’ is replaced by the client pty(4) path in template and the
611             result executed as a command.  If template is not given, "detach-
612             client -t '%%'" is used.  For the meaning of the -F flag, see the
613             FORMATS section.  This command works only if at least one client
614             is attached.
615
616     choose-list [-l items] [-t target-window] [template]
617             Put a window into list choice mode, allowing items to be
618             selected.  items can be a comma-separated list to display more
619             than one item.  If an item has spaces, that entry must be quoted.
620             After an item is chosen, ‘%%’ is replaced by the chosen item in
621             the template and the result is executed as a command.  If
622             template is not given, "run-shell '%%'" is used.  items also
623             accepts format specifiers.  For the meaning of this see the
624             FORMATS section.  This command works only if at least one client
625             is attached.
626
627     choose-session [-F format] [-t target-window] [template]
628             Put a window into session choice mode, where a session may be
629             selected interactively from a list.  When one is chosen, ‘%%’ is
630             replaced by the session name in template and the result executed
631             as a command.  If template is not given, "switch-client -t '%%'"
632             is used.  For the meaning of the -F flag, see the FORMATS sec‐
633             tion.  This command works only if at least one client is
634             attached.
635
636     choose-tree [-suw] [-b session-template] [-c window-template] [-S format]
637             [-W format] [-t target-window]
638             Put a window into tree choice mode, where either sessions or win‐
639             dows may be selected interactively from a list.  By default, win‐
640             dows belonging to a session are indented to show their relation‐
641             ship to a session.
642
643             Note that the choose-window and choose-session commands are wrap‐
644             pers around choose-tree.
645
646             If -s is given, will show sessions.  If -w is given, will show
647             windows.
648
649             By default, the tree is collapsed and sessions must be expanded
650             to windows with the right arrow key.  The -u option will start
651             with all sessions expanded instead.
652
653             If -b is given, will override the default session command.  Note
654             that ‘%%’ can be used and will be replaced with the session name.
655             The default option if not specified is "switch-client -t '%%'".
656             If -c is given, will override the default window command.  Like
657             -b, ‘%%’ can be used and will be replaced with the session name
658             and window index.  When a window is chosen from the list, the
659             session command is run before the window command.
660
661             If -S is given will display the specified format instead of the
662             default session format.  If -W is given will display the speci‐
663             fied format instead of the default window format.  For the mean‐
664             ing of the -s and -w options, see the FORMATS section.
665
666             This command works only if at least one client is attached.
667
668     choose-window [-F format] [-t target-window] [template]
669             Put a window into window choice mode, where a window may be cho‐
670             sen interactively from a list.  After a window is selected, ‘%%’
671             is replaced by the session name and window index in template and
672             the result executed as a command.  If template is not given,
673             "select-window -t '%%'" is used.  For the meaning of the -F flag,
674             see the FORMATS section.  This command works only if at least one
675             client is attached.
676
677     display-panes [-t target-client]
678                   (alias: displayp)
679             Display a visible indicator of each pane shown by target-client.
680             See the display-panes-time, display-panes-colour, and
681             display-panes-active-colour session options.  While the indicator
682             is on screen, a pane may be selected with the ‘0’ to ‘9’ keys.
683
684     find-window [-CNT] [-F format] [-t target-window] match-string
685                   (alias: findw)
686             Search for the fnmatch(3) pattern match-string in window names,
687             titles, and visible content (but not history).  The flags control
688             matching behavior: -C matches only visible window contents, -N
689             matches only the window name and -T matches only the window
690             title.  The default is -CNT.  If only one window is matched,
691             it'll be automatically selected, otherwise a choice list is
692             shown.  For the meaning of the -F flag, see the FORMATS section.
693             This command works only if at least one client is attached.
694
695     join-pane [-bdhv] [-l size | -p percentage] [-s src-pane] [-t dst-pane]
696                   (alias: joinp)
697             Like split-window, but instead of splitting dst-pane and creating
698             a new pane, split it and move src-pane into the space.  This can
699             be used to reverse break-pane.  The -b option causes src-pane to
700             be joined to left of or above dst-pane.
701
702     kill-pane [-a] [-t target-pane]
703                   (alias: killp)
704             Destroy the given pane.  If no panes remain in the containing
705             window, it is also destroyed.  The -a option kills all but the
706             pane given with -t.
707
708     kill-window [-a] [-t target-window]
709                   (alias: killw)
710             Kill the current window or the window at target-window, removing
711             it from any sessions to which it is linked.  The -a option kills
712             all but the window given with -t.
713
714     last-pane [-t target-window]
715                   (alias: lastp)
716             Select the last (previously selected) pane.
717
718     last-window [-t target-session]
719                   (alias: last)
720             Select the last (previously selected) window.  If no
721             target-session is specified, select the last window of the cur‐
722             rent session.
723
724     link-window [-dk] [-s src-window] [-t dst-window]
725                   (alias: linkw)
726             Link the window at src-window to the specified dst-window.  If
727             dst-window is specified and no such window exists, the src-window
728             is linked there.  If -k is given and dst-window exists, it is
729             killed, otherwise an error is generated.  If -d is given, the
730             newly linked window is not selected.
731
732     list-panes [-as] [-F format] [-t target]
733                   (alias: lsp)
734             If -a is given, target is ignored and all panes on the server are
735             listed.  If -s is given, target is a session (or the current ses‐
736             sion).  If neither is given, target is a window (or the current
737             window).  For the meaning of the -F flag, see the FORMATS sec‐
738             tion.
739
740     list-windows [-a] [-F format] [-t target-session]
741                   (alias: lsw)
742             If -a is given, list all windows on the server.  Otherwise, list
743             windows in the current session or in target-session.  For the
744             meaning of the -F flag, see the FORMATS section.
745
746     move-pane [-bdhv] [-l size | -p percentage] [-s src-pane] [-t dst-pane]
747                   (alias: movep)
748             Like join-pane, but src-pane and dst-pane may belong to the same
749             window.
750
751     move-window [-rdk] [-s src-window] [-t dst-window]
752                   (alias: movew)
753             This is similar to link-window, except the window at src-window
754             is moved to dst-window.  With -r, all windows in the session are
755             renumbered in sequential order, respecting the base-index option.
756
757     new-window [-adkP] [-c start-directory] [-F format] [-n window-name] [-t
758             target-window] [shell-command]
759                   (alias: neww)
760             Create a new window.  With -a, the new window is inserted at the
761             next index up from the specified target-window, moving windows up
762             if necessary, otherwise target-window is the new window location.
763
764             If -d is given, the session does not make the new window the cur‐
765             rent window.  target-window represents the window to be created;
766             if the target already exists an error is shown, unless the -k
767             flag is used, in which case it is destroyed.  shell-command is
768             the command to execute.  If shell-command is not specified, the
769             value of the default-command option is used.  -c specifies the
770             working directory in which the new window is created.  It may
771             have an absolute path or one of the following values (or a subdi‐
772             rectory):
773
774                   Empty string    Current pane's directory
775                   ~               User's home directory
776                   -               Where session was started
777                   .               Where server was started
778
779             When the shell command completes, the window closes.  See the
780             remain-on-exit option to change this behaviour.
781
782             The TERM environment variable must be set to “screen” for all
783             programs running inside tmux.  New windows will automatically
784             have “TERM=screen” added to their environment, but care must be
785             taken not to reset this in shell start-up files.
786
787             The -P option prints information about the new window after it
788             has been created.  By default, it uses the format
789             ‘#{session_name}:#{window_index}’ but a different format may be
790             specified with -F.
791
792     next-layout [-t target-window]
793                   (alias: nextl)
794             Move a window to the next layout and rearrange the panes to fit.
795
796     next-window [-a] [-t target-session]
797                   (alias: next)
798             Move to the next window in the session.  If -a is used, move to
799             the next window with an alert.
800
801     pipe-pane [-o] [-t target-pane] [shell-command]
802                   (alias: pipep)
803             Pipe any output sent by the program in target-pane to a shell
804             command.  A pane may only be piped to one command at a time, any
805             existing pipe is closed before shell-command is executed.  The
806             shell-command string may contain the special character sequences
807             supported by the status-left option.  If no shell-command is
808             given, the current pipe (if any) is closed.
809
810             The -o option only opens a new pipe if no previous pipe exists,
811             allowing a pipe to be toggled with a single key, for example:
812
813                   bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
814
815     previous-layout [-t target-window]
816                   (alias: prevl)
817             Move to the previous layout in the session.
818
819     previous-window [-a] [-t target-session]
820                   (alias: prev)
821             Move to the previous window in the session.  With -a, move to the
822             previous window with an alert.
823
824     rename-window [-t target-window] new-name
825                   (alias: renamew)
826             Rename the current window, or the window at target-window if
827             specified, to new-name.
828
829     resize-pane [-DLRUZ] [-t target-pane] [-x width] [-y height] [adjustment]
830                   (alias: resizep)
831             Resize a pane, up, down, left or right by adjustment with -U, -D,
832             -L or -R, or to an absolute size with -x or -y.  The adjustment
833             is given in lines or cells (the default is 1).
834
835             With -Z, the active pane is toggled between zoomed (occupying the
836             whole of the window) and unzoomed (its normal position in the
837             layout).
838
839     respawn-pane [-k] [-t target-pane] [shell-command]
840                   (alias: respawnp)
841             Reactivate a pane in which the command has exited (see the
842             remain-on-exit window option).  If shell-command is not given,
843             the command used when the pane was created is executed.  The pane
844             must be already inactive, unless -k is given, in which case any
845             existing command is killed.
846
847     respawn-window [-k] [-t target-window] [shell-command]
848                   (alias: respawnw)
849             Reactivate a window in which the command has exited (see the
850             remain-on-exit window option).  If shell-command is not given,
851             the command used when the window was created is executed.  The
852             window must be already inactive, unless -k is given, in which
853             case any existing command is killed.
854
855     rotate-window [-DU] [-t target-window]
856                   (alias: rotatew)
857             Rotate the positions of the panes within a window, either upward
858             (numerically lower) with -U or downward (numerically higher).
859
860     select-layout [-np] [-t target-window] [layout-name]
861                   (alias: selectl)
862             Choose a specific layout for a window.  If layout-name is not
863             given, the last preset layout used (if any) is reapplied.  -n and
864             -p are equivalent to the next-layout and previous-layout com‐
865             mands.
866
867     select-pane [-lDLRU] [-t target-pane]
868                   (alias: selectp)
869             Make pane target-pane the active pane in window target-window.
870             If one of -D, -L, -R, or -U is used, respectively the pane below,
871             to the left, to the right, or above the target pane is used.  -l
872             is the same as using the last-pane command.
873
874     select-window [-lnpT] [-t target-window]
875                   (alias: selectw)
876             Select the window at target-window.  -l, -n and -p are equivalent
877             to the last-window, next-window and previous-window commands.  If
878             -T is given and the selected window is already the current win‐
879             dow, the command behaves like last-window.
880
881     split-window [-dhvP] [-c start-directory] [-l size | -p percentage] [-t
882             target-pane] [shell-command] [-F format]
883                   (alias: splitw)
884             Create a new pane by splitting target-pane: -h does a horizontal
885             split and -v a vertical split; if neither is specified, -v is
886             assumed.  The -l and -p options specify the size of the new pane
887             in lines (for vertical split) or in cells (for horizontal split),
888             or as a percentage, respectively.  All other options have the
889             same meaning as for the new-window command.
890
891     swap-pane [-dDU] [-s src-pane] [-t dst-pane]
892                   (alias: swapp)
893             Swap two panes.  If -U is used and no source pane is specified
894             with -s, dst-pane is swapped with the previous pane (before it
895             numerically); -D swaps with the next pane (after it numerically).
896             -d instructs tmux not to change the active pane.
897
898     swap-window [-d] [-s src-window] [-t dst-window]
899                   (alias: swapw)
900             This is similar to link-window, except the source and destination
901             windows are swapped.  It is an error if no window exists at
902             src-window.
903
904     unlink-window [-k] [-t target-window]
905                   (alias: unlinkw)
906             Unlink target-window.  Unless -k is given, a window may be
907             unlinked only if it is linked to multiple sessions - windows may
908             not be linked to no sessions; if -k is specified and the window
909             is linked to only one session, it is unlinked and destroyed.
910

KEY BINDINGS

912     tmux allows a command to be bound to most keys, with or without a prefix
913     key.  When specifying keys, most represent themselves (for example ‘A’ to
914     ‘Z’).  Ctrl keys may be prefixed with ‘C-’ or ‘^’, and Alt (meta) with
915     ‘M-’.  In addition, the following special key names are accepted: Up,
916     Down, Left, Right, BSpace, BTab, DC (Delete), End, Enter, Escape, F1 to
917     F20, Home, IC (Insert), NPage/PageDown/PgDn, PPage/PageUp/PgUp, Space,
918     and Tab.  Note that to bind the ‘"’ or ‘'’ keys, quotation marks are nec‐
919     essary, for example:
920
921           bind-key '"' split-window
922           bind-key "'" new-window
923
924     Commands related to key bindings are as follows:
925
926     bind-key [-cnr] [-t key-table] key command [arguments]
927                   (alias: bind)
928             Bind key key to command.  By default (without -t) the primary key
929             bindings are modified (those normally activated with the prefix
930             key); in this case, if -n is specified, it is not necessary to
931             use the prefix key, command is bound to key alone.  The -r flag
932             indicates this key may repeat, see the repeat-time option.
933
934             If -t is present, key is bound in key-table: the binding for com‐
935             mand mode with -c or for normal mode without.  To view the
936             default bindings and possible commands, see the list-keys com‐
937             mand.
938
939     list-keys [-t key-table]
940                   (alias: lsk)
941             List all key bindings.  Without -t the primary key bindings -
942             those executed when preceded by the prefix key - are printed.
943
944             With -t, the key bindings in key-table are listed; this may be
945             one of: vi-edit, emacs-edit, vi-choice, emacs-choice, vi-copy or
946             emacs-copy.
947
948     send-keys [-lR] [-t target-pane] key ...
949                   (alias: send)
950             Send a key or keys to a window.  Each argument key is the name of
951             the key (such as ‘C-a’ or ‘npage’ ) to send; if the string is not
952             recognised as a key, it is sent as a series of characters.  The
953             -l flag disables key name lookup and sends the keys literally.
954             All arguments are sent sequentially from first to last.  The -R
955             flag causes the terminal state to be reset.
956
957     send-prefix [-2] [-t target-pane]
958             Send the prefix key, or with -2 the secondary prefix key, to a
959             window as if it was pressed.
960
961     unbind-key [-acn] [-t key-table] key
962                   (alias: unbind)
963             Unbind the command bound to key.  Without -t the primary key
964             bindings are modified; in this case, if -n is specified, the com‐
965             mand bound to key without a prefix (if any) is removed.  If -a is
966             present, all key bindings are removed.
967
968             If -t is present, key in key-table is unbound: the binding for
969             command mode with -c or for normal mode without.
970

OPTIONS

972     The appearance and behaviour of tmux may be modified by changing the
973     value of various options.  There are three types of option: server
974     options, session options and window options.
975
976     The tmux server has a set of global options which do not apply to any
977     particular window or session.  These are altered with the set-option -s
978     command, or displayed with the show-options -s command.
979
980     In addition, each individual session may have a set of session options,
981     and there is a separate set of global session options.  Sessions which do
982     not have a particular option configured inherit the value from the global
983     session options.  Session options are set or unset with the set-option
984     command and may be listed with the show-options command.  The available
985     server and session options are listed under the set-option command.
986
987     Similarly, a set of window options is attached to each window, and there
988     is a set of global window options from which any unset options are inher‐
989     ited.  Window options are altered with the set-window-option command and
990     can be listed with the show-window-options command.  All window options
991     are documented with the set-window-option command.
992
993     tmux also supports user options which are prefixed with a ‘@’.  User
994     options may have any name, so long as they are prefixed with ‘@’, and be
995     set to any string.  For example
996
997           $ tmux setw -q @foo "abc123"
998           $ tmux showw -v @foo
999           abc123
1000
1001     Commands which set options are as follows:
1002
1003     set-option [-agoqsuw] [-t target-session | target-window] option value
1004                   (alias: set)
1005             Set a window option with -w (equivalent to the set-window-option
1006             command), a server option with -s, otherwise a session option.
1007
1008             If -g is specified, the global session or window option is set.
1009             With -a, and if the option expects a string, value is appended to
1010             the existing setting.  The -u flag unsets an option, so a session
1011             inherits the option from the global options.  It is not possible
1012             to unset a global option.
1013
1014             The -o flag prevents setting an option that is already set.
1015
1016             The -q flag suppresses the informational message (as if the quiet
1017             server option was set).
1018
1019             Available window options are listed under set-window-option.
1020
1021             value depends on the option and may be a number, a string, or a
1022             flag (on, off, or omitted to toggle).
1023
1024             Available server options are:
1025
1026             buffer-limit number
1027                     Set the number of buffers; as new buffers are added to
1028                     the top of the stack, old ones are removed from the bot‐
1029                     tom if necessary to maintain this maximum length.
1030
1031             escape-time time
1032                     Set the time in milliseconds for which tmux waits after
1033                     an escape is input to determine if it is part of a func‐
1034                     tion or meta key sequences.  The default is 500 millisec‐
1035                     onds.
1036
1037             exit-unattached [on | off]
1038                     If enabled, the server will exit when there are no
1039                     attached clients.
1040
1041             quiet [on | off]
1042                     Enable or disable the display of various informational
1043                     messages (see also the -q command line flag).
1044
1045             set-clipboard [on | off]
1046                     Attempt to set the terminal clipboard content using the
1047                     \e]52;...\007 xterm(1) escape sequences.  This option is
1048                     on by default if there is an Ms entry in the terminfo(5)
1049                     description for the client terminal.  Note that this fea‐
1050                     ture needs to be enabled in xterm(1) by setting the
1051                     resource:
1052
1053                           disallowedWindowOps: 20,21,SetXprop
1054
1055                     Or changing this property from the xterm(1) interactive
1056                     menu when required.
1057
1058             Available session options are:
1059
1060             assume-paste-time milliseconds
1061                     If keys are entered faster than one in milliseconds, they
1062                     are assumed to have been pasted rather than typed and
1063                     tmux key bindings are not processed.  The default is one
1064                     millisecond and zero disables.
1065
1066             base-index index
1067                     Set the base index from which an unused index should be
1068                     searched when a new window is created.  The default is
1069                     zero.
1070
1071             bell-action [any | none | current]
1072                     Set action on window bell.  any means a bell in any win‐
1073                     dow linked to a session causes a bell in the current win‐
1074                     dow of that session, none means all bells are ignored and
1075                     current means only bells in windows other than the cur‐
1076                     rent window are ignored.
1077
1078             bell-on-alert [on | off]
1079                     If on, ring the terminal bell when an alert occurs.
1080
1081             default-command shell-command
1082                     Set the command used for new windows (if not specified
1083                     when the window is created) to shell-command, which may
1084                     be any sh(1) command.  The default is an empty string,
1085                     which instructs tmux to create a login shell using the
1086                     value of the default-shell option.
1087
1088             default-path path
1089                     Set the default working directory for new panes.  If
1090                     empty (the default), the working directory is determined
1091                     from the process running in the active pane, from the
1092                     command line environment or from the working directory
1093                     where the session was created.  Otherwise the same
1094                     options are available as for the -c flag to new-window.
1095
1096             default-shell path
1097                     Specify the default shell.  This is used as the login
1098                     shell for new windows when the default-command option is
1099                     set to empty, and must be the full path of the exe‐
1100                     cutable.  When started tmux tries to set a default value
1101                     from the first suitable of the SHELL environment vari‐
1102                     able, the shell returned by getpwuid(3), or /bin/sh.
1103                     This option should be configured when tmux is used as a
1104                     login shell.
1105
1106             default-terminal terminal
1107                     Set the default terminal for new windows created in this
1108                     session - the default value of the TERM environment vari‐
1109                     able.  For tmux to work correctly, this must be set to
1110                     ‘screen’ or a derivative of it.
1111
1112             destroy-unattached [on | off]
1113                     If enabled and the session is no longer attached to any
1114                     clients, it is destroyed.
1115
1116             detach-on-destroy [on | off]
1117                     If on (the default), the client is detached when the ses‐
1118                     sion it is attached to is destroyed.  If off, the client
1119                     is switched to the most recently active of the remaining
1120                     sessions.
1121
1122             display-panes-active-colour colour
1123                     Set the colour used by the display-panes command to show
1124                     the indicator for the active pane.
1125
1126             display-panes-colour colour
1127                     Set the colour used by the display-panes command to show
1128                     the indicators for inactive panes.
1129
1130             display-panes-time time
1131                     Set the time in milliseconds for which the indicators
1132                     shown by the display-panes command appear.
1133
1134             display-time time
1135                     Set the amount of time for which status line messages and
1136                     other on-screen indicators are displayed.  time is in
1137                     milliseconds.
1138
1139             history-limit lines
1140                     Set the maximum number of lines held in window history.
1141                     This setting applies only to new windows - existing win‐
1142                     dow histories are not resized and retain the limit at the
1143                     point they were created.
1144
1145             lock-after-time number
1146                     Lock the session (like the lock-session command) after
1147                     number seconds of inactivity, or the entire server (all
1148                     sessions) if the lock-server option is set.  The default
1149                     is not to lock (set to 0).
1150
1151             lock-command shell-command
1152                     Command to run when locking each client.  The default is
1153                     to run lock(1) with -np.
1154
1155             lock-server [on | off]
1156                     If this option is on (the default), instead of each ses‐
1157                     sion locking individually as each has been idle for
1158                     lock-after-time, the entire server will lock after all
1159                     sessions would have locked.  This has no effect as a ses‐
1160                     sion option; it must be set as a global option.
1161
1162             message-attr attributes
1163                     Set status line message attributes, where attributes is
1164                     either none or a comma-delimited list of one or more of:
1165                     bright (or bold), dim, underscore, blink, reverse,
1166                     hidden, or italics.
1167
1168             message-bg colour
1169                     Set status line message background colour, where colour
1170                     is one of: black, red, green, yellow, blue, magenta,
1171                     cyan, white, aixterm bright variants (if supported:
1172                     brightred, brightgreen, and so on), colour0 to colour255
1173                     from the 256-colour set, default, or a hexadecimal RGB
1174                     string such as ‘#ffffff’, which chooses the closest match
1175                     from the default 256-colour set.
1176
1177             message-command-attr attributes
1178                     Set status line message attributes when in command mode.
1179
1180             message-command-bg colour
1181                     Set status line message background colour when in command
1182                     mode.
1183
1184             message-command-fg colour
1185                     Set status line message foreground colour when in command
1186                     mode.
1187
1188             message-fg colour
1189                     Set status line message foreground colour.
1190
1191             message-limit number
1192                     Set the number of error or information messages to save
1193                     in the message log for each client.  The default is 20.
1194
1195             mouse-resize-pane [on | off]
1196                     If on, tmux captures the mouse and allows panes to be
1197                     resized by dragging on their borders.
1198
1199             mouse-select-pane [on | off]
1200                     If on, tmux captures the mouse and when a window is split
1201                     into multiple panes the mouse may be used to select the
1202                     current pane.  The mouse click is also passed through to
1203                     the application as normal.
1204
1205             mouse-select-window [on | off]
1206                     If on, clicking the mouse on a window name in the status
1207                     line will select that window.
1208
1209             mouse-utf8 [on | off]
1210                     If enabled, request mouse input as UTF-8 on UTF-8 termi‐
1211                     nals.
1212
1213             pane-active-border-bg colour
1214
1215             pane-active-border-fg colour
1216                     Set the pane border colour for the currently active pane.
1217
1218             pane-border-bg colour
1219
1220             pane-border-fg colour
1221                     Set the pane border colour for panes aside from the
1222                     active pane.
1223
1224             prefix key
1225                     Set the key accepted as a prefix key.
1226
1227             prefix2 key
1228                     Set a secondary key accepted as a prefix key.
1229
1230             renumber-windows [on | off]
1231                     If on, when a window is closed in a session, automati‐
1232                     cally renumber the other windows in numerical order.
1233                     This respects the base-index option if it has been set.
1234                     If off, do not renumber the windows.
1235
1236             repeat-time time
1237                     Allow multiple commands to be entered without pressing
1238                     the prefix-key again in the specified time milliseconds
1239                     (the default is 500).  Whether a key repeats may be set
1240                     when it is bound using the -r flag to bind-key.  Repeat
1241                     is enabled for the default keys bound to the resize-pane
1242                     command.
1243
1244             set-remain-on-exit [on | off]
1245                     Set the remain-on-exit window option for any windows
1246                     first created in this session.  When this option is true,
1247                     windows in which the running program has exited do not
1248                     close, instead remaining open but inactivate.  Use the
1249                     respawn-window command to reactivate such a window, or
1250                     the kill-window command to destroy it.
1251
1252             set-titles [on | off]
1253                     Attempt to set the client terminal title using the tsl
1254                     and fsl terminfo(5) entries if they exist.  tmux automat‐
1255                     ically sets these to the \e]2;...\007 sequence if the
1256                     terminal appears to be an xterm.  This option is off by
1257                     default.  Note that elinks will only attempt to set the
1258                     window title if the STY environment variable is set.
1259
1260             set-titles-string string
1261                     String used to set the window title if set-titles is on.
1262                     Character sequences are replaced as for the status-left
1263                     option.
1264
1265             status [on | off]
1266                     Show or hide the status line.
1267
1268             status-attr attributes
1269                     Set status line attributes.
1270
1271             status-bg colour
1272                     Set status line background colour.
1273
1274             status-fg colour
1275                     Set status line foreground colour.
1276
1277             status-interval interval
1278                     Update the status bar every interval seconds.  By
1279                     default, updates will occur every 15 seconds.  A setting
1280                     of zero disables redrawing at interval.
1281
1282             status-justify [left | centre | right]
1283                     Set the position of the window list component of the sta‐
1284                     tus line: left, centre or right justified.
1285
1286             status-keys [vi | emacs]
1287                     Use vi or emacs-style key bindings in the status line,
1288                     for example at the command prompt.  The default is emacs,
1289                     unless the VISUAL or EDITOR environment variables are set
1290                     and contain the string ‘vi’.
1291
1292             status-left string
1293                     Display string to the left of the status bar.  string
1294                     will be passed through strftime(3) before being used.  By
1295                     default, the session name is shown.  string may contain
1296                     any of the following special character sequences:
1297
1298                           Character pair    Replaced with
1299                           #(shell-command)  First line of the command's
1300                                                              output
1301                           #[attributes]     Colour or attribute change
1302                           #H                Hostname of local host
1303                           #h                Hostname of local host without
1304                                                              the domain name
1305                           #F                Current window flag
1306                           #I                Current window index
1307                           #D                Current pane unique identifier
1308                           #P                Current pane index
1309                           #S                Session name
1310                           #T                Current pane title
1311                           #W                Current window name
1312                           ##                A literal ‘#’
1313
1314                     The #(shell-command) form executes ‘shell-command’ and
1315                     inserts the first line of its output.  Note that shell
1316                     commands are only executed once at the interval specified
1317                     by the status-interval option: if the status line is
1318                     redrawn in the meantime, the previous result is used.
1319                     Shell commands are executed with the tmux global environ‐
1320                     ment set (see the ENVIRONMENT section).
1321
1322                     For details on how the names and titles can be set see
1323                     the NAMES AND TITLES section.
1324
1325                     #[attributes] allows a comma-separated list of attributes
1326                     to be specified, these may be ‘fg=colour’ to set the
1327                     foreground colour, ‘bg=colour’ to set the background
1328                     colour, the name of one of the attributes (listed under
1329                     the message-attr option) to turn an attribute on, or an
1330                     attribute prefixed with ‘no’ to turn one off, for example
1331                     nobright.  Examples are:
1332
1333                           #(sysctl vm.loadavg)
1334                           #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
1335
1336                     Where appropriate, special character sequences may be
1337                     prefixed with a number to specify the maximum length, for
1338                     example ‘#24T’.
1339
1340                     By default, UTF-8 in string is not interpreted, to enable
1341                     UTF-8, use the status-utf8 option.
1342
1343             status-left-attr attributes
1344                     Set the attribute of the left part of the status line.
1345
1346             status-left-bg colour
1347                     Set the background colour of the left part of the status
1348                     line.
1349
1350             status-left-fg colour
1351                     Set the foreground colour of the left part of the status
1352                     line.
1353
1354             status-left-length length
1355                     Set the maximum length of the left component of the sta‐
1356                     tus bar.  The default is 10.
1357
1358             status-position [top | bottom]
1359                     Set the position of the status line.
1360
1361             status-right string
1362                     Display string to the right of the status bar.  By
1363                     default, the current window title in double quotes, the
1364                     date and the time are shown.  As with status-left, string
1365                     will be passed to strftime(3), character pairs are
1366                     replaced, and UTF-8 is dependent on the status-utf8
1367                     option.
1368
1369             status-right-attr attributes
1370                     Set the attribute of the right part of the status line.
1371
1372             status-right-bg colour
1373                     Set the background colour of the right part of the status
1374                     line.
1375
1376             status-right-fg colour
1377                     Set the foreground colour of the right part of the status
1378                     line.
1379
1380             status-right-length length
1381                     Set the maximum length of the right component of the sta‐
1382                     tus bar.  The default is 40.
1383
1384             status-utf8 [on | off]
1385                     Instruct tmux to treat top-bit-set characters in the
1386                     status-left and status-right strings as UTF-8; notably,
1387                     this is important for wide characters.  This option
1388                     defaults to off.
1389
1390             terminal-overrides string
1391                     Contains a list of entries which override terminal
1392                     descriptions read using terminfo(5).  string is a comma-
1393                     separated list of items each a colon-separated string
1394                     made up of a terminal type pattern (matched using
1395                     fnmatch(3)) and a set of name=value entries.
1396
1397                     For example, to set the ‘clear’ terminfo(5) entry to
1398                     ‘\e[H\e[2J’ for all terminal types and the ‘dch1’ entry
1399                     to ‘\e[P’ for the ‘rxvt’ terminal type, the option could
1400                     be set to the string:
1401
1402                           "*:clear=\e[H\e[2J,rxvt:dch1=\e[P"
1403
1404                     The terminal entry value is passed through strunvis(3)
1405                     before interpretation.  The default value forcibly cor‐
1406                     rects the ‘colors’ entry for terminals which support 88
1407                     or 256 colours:
1408
1409                           "*88col*:colors=88,*256col*:colors=256,xterm*:XT"
1410
1411             update-environment variables
1412                     Set a space-separated string containing a list of envi‐
1413                     ronment variables to be copied into the session environ‐
1414                     ment when a new session is created or an existing session
1415                     is attached.  Any variables that do not exist in the
1416                     source environment are set to be removed from the session
1417                     environment (as if -r was given to the set-environment
1418                     command).  The default is "DISPLAY SSH_ASKPASS
1419                     SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAU‐
1420                     THORITY".
1421
1422             visual-activity [on | off]
1423                     If on, display a status line message when activity occurs
1424                     in a window for which the monitor-activity window option
1425                     is enabled.
1426
1427             visual-bell [on | off]
1428                     If this option is on, a message is shown on a bell
1429                     instead of it being passed through to the terminal (which
1430                     normally makes a sound).  Also see the bell-action
1431                     option.
1432
1433             visual-content [on | off]
1434                     Like visual-activity, display a message when content is
1435                     present in a window for which the monitor-content window
1436                     option is enabled.
1437
1438             visual-silence [on | off]
1439                     If monitor-silence is enabled, prints a message after the
1440                     interval has expired on a given window.
1441
1442             word-separators string
1443                     Sets the session's conception of what characters are con‐
1444                     sidered word separators, for the purposes of the next and
1445                     previous word commands in copy mode.  The default is
1446                     ‘ -_@’.
1447
1448     set-window-option [-agqu] [-t target-window] option value
1449                   (alias: setw)
1450             Set a window option.  The -a, -g, -q and -u flags work similarly
1451             to the set-option command.
1452
1453             Supported window options are:
1454
1455             aggressive-resize [on | off]
1456                     Aggressively resize the chosen window.  This means that
1457                     tmux will resize the window to the size of the smallest
1458                     session for which it is the current window, rather than
1459                     the smallest session to which it is attached.  The window
1460                     may resize when the current window is changed on another
1461                     sessions; this option is good for full-screen programs
1462                     which support SIGWINCH and poor for interactive programs
1463                     such as shells.
1464
1465             allow-rename [on | off]
1466                     Allow programs to change the window name using a terminal
1467                     escape sequence (\033k...\033\\).  The default is on.
1468
1469             alternate-screen [on | off]
1470                     This option configures whether programs running inside
1471                     tmux may use the terminal alternate screen feature, which
1472                     allows the smcup and rmcup terminfo(5) capabilities.  The
1473                     alternate screen feature preserves the contents of the
1474                     window when an interactive application starts and
1475                     restores it on exit, so that any output visible before
1476                     the application starts reappears unchanged after it
1477                     exits.  The default is on.
1478
1479             automatic-rename [on | off]
1480                     Control automatic window renaming.  When this setting is
1481                     enabled, tmux will attempt - on supported platforms - to
1482                     rename the window to reflect the command currently run‐
1483                     ning in it.  This flag is automatically disabled for an
1484                     individual window when a name is specified at creation
1485                     with new-window or new-session, or later with
1486                     rename-window, or with a terminal escape sequence.  It
1487                     may be switched off globally with:
1488
1489                           set-window-option -g automatic-rename off
1490
1491             c0-change-interval interval
1492             c0-change-trigger trigger
1493                     These two options configure a simple form of rate limit‐
1494                     ing for a pane.  If tmux sees more than trigger C0
1495                     sequences that modify the screen (for example, carriage
1496                     returns, linefeeds or backspaces) in one millisecond, it
1497                     will stop updating the pane immediately and instead
1498                     redraw it entirely every interval milliseconds.  This
1499                     helps to prevent fast output (such as yes(1) overwhelming
1500                     the terminal).  The default is a trigger of 250 and an
1501                     interval of 100.  A trigger of zero disables the rate
1502                     limiting.
1503
1504             clock-mode-colour colour
1505                     Set clock colour.
1506
1507             clock-mode-style [12 | 24]
1508                     Set clock hour format.
1509
1510             force-height height
1511             force-width width
1512                     Prevent tmux from resizing a window to greater than width
1513                     or height.  A value of zero restores the default unlim‐
1514                     ited setting.
1515
1516             main-pane-height height
1517             main-pane-width width
1518                     Set the width or height of the main (left or top) pane in
1519                     the main-horizontal or main-vertical layouts.
1520
1521             mode-attr attributes
1522                     Set window modes attributes.
1523
1524             mode-bg colour
1525                     Set window modes background colour.
1526
1527             mode-fg colour
1528                     Set window modes foreground colour.
1529
1530             mode-keys [vi | emacs]
1531                     Use vi or emacs-style key bindings in copy and choice
1532                     modes.  As with the status-keys option, the default is
1533                     emacs, unless VISUAL or EDITOR contains ‘vi’.
1534
1535             mode-mouse [on | off | copy-mode]
1536                     Mouse state in modes.  If on, the mouse may be used to
1537                     enter copy mode and copy a selection by dragging, to
1538                     enter copy mode and scroll with the mouse wheel, or to
1539                     select an option in choice mode.  If set to copy-mode,
1540                     the mouse behaves as set to on, but cannot be used to
1541                     enter copy mode.
1542
1543             monitor-activity [on | off]
1544                     Monitor for activity in the window.  Windows with activ‐
1545                     ity are highlighted in the status line.
1546
1547             monitor-content match-string
1548                     Monitor content in the window.  When fnmatch(3) pattern
1549                     match-string appears in the window, it is highlighted in
1550                     the status line.
1551
1552             monitor-silence [interval]
1553                     Monitor for silence (no activity) in the window within
1554                     interval seconds.  Windows that have been silent for the
1555                     interval are highlighted in the status line.  An interval
1556                     of zero disables the monitoring.
1557
1558             other-pane-height height
1559                     Set the height of the other panes (not the main pane) in
1560                     the main-horizontal layout.  If this option is set to 0
1561                     (the default), it will have no effect.  If both the
1562                     main-pane-height and other-pane-height options are set,
1563                     the main pane will grow taller to make the other panes
1564                     the specified height, but will never shrink to do so.
1565
1566             other-pane-width width
1567                     Like other-pane-height, but set the width of other panes
1568                     in the main-vertical layout.
1569
1570             pane-base-index index
1571                     Like base-index, but set the starting index for pane num‐
1572                     bers.
1573
1574             remain-on-exit [on | off]
1575                     A window with this flag set is not destroyed when the
1576                     program running in it exits.  The window may be reacti‐
1577                     vated with the respawn-window command.
1578
1579             synchronize-panes [on | off]
1580                     Duplicate input to any pane to all other panes in the
1581                     same window (only for panes that are not in any special
1582                     mode).
1583
1584             utf8 [on | off]
1585                     Instructs tmux to expect UTF-8 sequences to appear in
1586                     this window.
1587
1588             window-status-bell-attr attributes
1589                     Set status line attributes for windows which have a bell
1590                     alert.
1591
1592             window-status-bell-bg colour
1593                     Set status line background colour for windows with a bell
1594                     alert.
1595
1596             window-status-bell-fg colour
1597                     Set status line foreground colour for windows with a bell
1598                     alert.
1599
1600             window-status-content-attr attributes
1601                     Set status line attributes for windows which have a con‐
1602                     tent alert.
1603
1604             window-status-content-bg colour
1605                     Set status line background colour for windows with a con‐
1606                     tent alert.
1607
1608             window-status-content-fg colour
1609                     Set status line foreground colour for windows with a con‐
1610                     tent alert.
1611
1612             window-status-activity-attr attributes
1613                     Set status line attributes for windows which have an
1614                     activity (or silence) alert.
1615
1616             window-status-activity-bg colour
1617                     Set status line background colour for windows with an
1618                     activity alert.
1619
1620             window-status-activity-fg colour
1621                     Set status line foreground colour for windows with an
1622                     activity alert.
1623
1624             window-status-attr attributes
1625                     Set status line attributes for a single window.
1626
1627             window-status-bg colour
1628                     Set status line background colour for a single window.
1629
1630             window-status-current-attr attributes
1631                     Set status line attributes for the currently active win‐
1632                     dow.
1633
1634             window-status-current-bg colour
1635                     Set status line background colour for the currently
1636                     active window.
1637
1638             window-status-current-fg colour
1639                     Set status line foreground colour for the currently
1640                     active window.
1641
1642             window-status-current-format string
1643                     Like window-status-format, but is the format used when
1644                     the window is the current window.
1645
1646             window-status-last-attr attributes
1647                     Set status line attributes for the last active window.
1648
1649             window-status-last-bg colour
1650                     Set status line background colour for the last active
1651                     window.
1652
1653             window-status-last-fg colour
1654                     Set status line foreground colour for the last active
1655                     window.
1656
1657             window-status-fg colour
1658                     Set status line foreground colour for a single window.
1659
1660             window-status-format string
1661                     Set the format in which the window is displayed in the
1662                     status line window list.  See the status-left option for
1663                     details of special character sequences available.  The
1664                     default is ‘#I:#W#F’.
1665
1666             window-status-separator string
1667                     Sets the separator drawn between windows in the status
1668                     line.  The default is a single space character.
1669
1670             xterm-keys [on | off]
1671                     If this option is set, tmux will generate xterm(1) -style
1672                     function key sequences; these have a number included to
1673                     indicate modifiers such as Shift, Alt or Ctrl.  The
1674                     default is off.
1675
1676             wrap-search [on | off]
1677                     If this option is set, searches will wrap around the end
1678                     of the pane contents.  The default is on.
1679
1680     show-options [-gqsvw] [-t target-session | target-window] [option]
1681                   (alias: show)
1682             Show the window options (or a single window option if given) with
1683             -w (equivalent to show-window-options), the server options with
1684             -s, otherwise the session options for target session.  Global
1685             session or window options are listed if -g is used.  -v shows
1686             only the option value, not the name.  If -q is set, no error will
1687             be returned if option is unset.
1688
1689     show-window-options [-gv] [-t target-window] [option]
1690                   (alias: showw)
1691             List the window options or a single option for target-window, or
1692             the global window options if -g is used.  -v shows only the
1693             option value, not the name.
1694

FORMATS

1696     Certain commands accept the -F flag with a format argument.  This is a
1697     string which controls the output format of the command.  Special charac‐
1698     ter sequences are replaced as documented under the status-left option and
1699     an additional long form is accepted.  Replacement variables are enclosed
1700     in ‘#{’ and ‘}’, for example ‘#{session_name}’ is equivalent to ‘#S’.
1701     Conditionals are also accepted by prefixing with ‘?’ and separating two
1702     alternatives with a comma; if the specified variable exists and is not
1703     zero, the first alternative is chosen, otherwise the second is used.  For
1704     example ‘#{?session_attached,attached,not attached}’ will include the
1705     string ‘attached’ if the session is attached and the string ‘not
1706     attached’ if it is unattached.
1707
1708     The following variables are available, where appropriate:
1709
1710           Variable name             Replaced with
1711           alternate_on              If pane is in alternate screen
1712           alternate_saved_x         Saved cursor X in alternate screen
1713           alternate_saved_y         Saved cursor Y in alternate screen
1714           buffer_sample             First 50 characters from the specified
1715                                                      buffer
1716           buffer_size               Size of the specified buffer in bytes
1717           client_activity           Integer time client last had activity
1718           client_activity_string    String time client last had activity
1719           client_created            Integer time client created
1720           client_created_string     String time client created
1721           client_cwd                Working directory of client
1722           client_height             Height of client
1723           client_last_session       Name of the client's last session
1724           client_prefix             1 if prefix key has been pressed
1725           client_readonly           1 if client is readonly
1726           client_session            Name of the client's session
1727           client_termname           Terminal name of client
1728           client_tty                Pseudo terminal of client
1729           client_utf8               1 if client supports utf8
1730           client_width              Width of client
1731           cursor_flag               Pane cursor flag
1732           cursor_x                  Cursor X position in pane
1733           cursor_y                  Cursor Y position in pane
1734           history_bytes             Number of bytes in window history
1735           history_limit             Maximum window history lines
1736           history_size              Size of history in bytes
1737           host                      Hostname of local host
1738           insert_flag               Pane insert flag
1739           keypad_cursor_flag        Pane keypad cursor flag
1740           keypad_flag               Pane keypad flag
1741           line                      Line number in the list
1742           mouse_any_flag            Pane mouse any flag
1743           mouse_button_flag         Pane mouse button flag
1744           mouse_standard_flag       Pane mouse standard flag
1745           mouse_utf8_flag           Pane mouse UTF-8 flag
1746           pane_active               1 if active pane
1747           pane_current_command      Current command if available
1748           pane_current_path         Current path if available
1749           pane_dead                 1 if pane is dead
1750           pane_height               Height of pane
1751           pane_id                   Unique pane ID
1752           pane_in_mode              If pane is in a mode
1753           pane_index                Index of pane
1754           pane_pid                  PID of first process in pane
1755           pane_start_command        Command pane started with
1756           pane_start_path           Path pane started with
1757           pane_tabs                 Pane tab positions
1758           pane_title                Title of pane
1759           pane_tty                  Pseudo terminal of pane
1760           pane_width                Width of pane
1761           saved_cursor_x            Saved cursor X in pane
1762           saved_cursor_y            Saved cursor Y in pane
1763           scroll_region_lower       Bottom of scroll region in pane
1764           scroll_region_upper       Top of scroll region in pane
1765           session_attached          1 if session attached
1766           session_created           Integer time session created
1767           session_created_string    String time session created
1768           session_group             Number of session group
1769           session_grouped           1 if session in a group
1770           session_height            Height of session
1771           session_id                Unique session ID
1772           session_name              Name of session
1773           session_width             Width of session
1774           session_windows           Number of windows in session
1775           window_active             1 if window active
1776           window_find_matches       Matched data from the find-window command
1777                                                      if available
1778           window_flags              Window flags
1779           window_height             Height of window
1780           window_id                 Unique window ID
1781           window_index              Index of window
1782           window_layout             Window layout description
1783           window_name               Name of window
1784           window_panes              Number of panes in window
1785           window_width              Width of window
1786           wrap_flag                 Pane wrap flag
1787

NAMES AND TITLES

1789     tmux distinguishes between names and titles.  Windows and sessions have
1790     names, which may be used to specify them in targets and are displayed in
1791     the status line and various lists: the name is the tmux identifier for a
1792     window or session.  Only panes have titles.  A pane's title is typically
1793     set by the program running inside the pane and is not modified by tmux.
1794     It is the same mechanism used to set for example the xterm(1) window
1795     title in an X(7) window manager.  Windows themselves do not have titles -
1796     a window's title is the title of its active pane.  tmux itself may set
1797     the title of the terminal in which the client is running, see the
1798     set-titles option.
1799
1800     A session's name is set with the new-session and rename-session commands.
1801     A window's name is set with one of:
1802
1803     1.      A command argument (such as -n for new-window or new-session).
1804
1805     2.      An escape sequence:
1806
1807                   $ printf '\033kWINDOW_NAME\033\\'
1808
1809     3.      Automatic renaming, which sets the name to the active command in
1810             the window's active pane.  See the automatic-rename option.
1811
1812     When a pane is first created, its title is the hostname.  A pane's title
1813     can be set via the OSC title setting sequence, for example:
1814
1815           $ printf '\033]2;My Title\033\\'
1816

ENVIRONMENT

1818     When the server is started, tmux copies the environment into the global
1819     environment; in addition, each session has a session environment.  When a
1820     window is created, the session and global environments are merged.  If a
1821     variable exists in both, the value from the session environment is used.
1822     The result is the initial environment passed to the new process.
1823
1824     The update-environment session option may be used to update the session
1825     environment from the client when a new session is created or an old reat‐
1826     tached.  tmux also initialises the TMUX variable with some internal
1827     information to allow commands to be executed from inside, and the TERM
1828     variable with the correct terminal setting of ‘screen’.
1829
1830     Commands to alter and view the environment are:
1831
1832     set-environment [-gru] [-t target-session] name [value]
1833                   (alias: setenv)
1834             Set or unset an environment variable.  If -g is used, the change
1835             is made in the global environment; otherwise, it is applied to
1836             the session environment for target-session.  The -u flag unsets a
1837             variable.  -r indicates the variable is to be removed from the
1838             environment before starting a new process.
1839
1840     show-environment [-g] [-t target-session] [variable]
1841                   (alias: showenv)
1842             Display the environment for target-session or the global environ‐
1843             ment with -g.  If variable is omitted, all variables are shown.
1844             Variables removed from the environment are prefixed with ‘-’.
1845

STATUS LINE

1847     tmux includes an optional status line which is displayed in the bottom
1848     line of each terminal.  By default, the status line is enabled (it may be
1849     disabled with the status session option) and contains, from left-to-
1850     right: the name of the current session in square brackets; the window
1851     list; the title of the active pane in double quotes; and the time and
1852     date.
1853
1854     The status line is made of three parts: configurable left and right sec‐
1855     tions (which may contain dynamic content such as the time or output from
1856     a shell command, see the status-left, status-left-length, status-right,
1857     and status-right-length options below), and a central window list.  By
1858     default, the window list shows the index, name and (if any) flag of the
1859     windows present in the current session in ascending numerical order.  It
1860     may be customised with the window-status-format and
1861     window-status-current-format options.  The flag is one of the following
1862     symbols appended to the window name:
1863
1864           Symbol    Meaning
1865           *         Denotes the current window.
1866           -         Marks the last window (previously selected).
1867           #         Window is monitored and activity has been detected.
1868           !         A bell has occurred in the window.
1869           +         Window is monitored for content and it has appeared.
1870           ~         The window has been silent for the monitor-silence
1871                                interval.
1872           Z         The window's active pane is zoomed.
1873
1874     The # symbol relates to the monitor-activity and + to the monitor-content
1875     window options.  The window name is printed in inverted colours if an
1876     alert (bell, activity or content) is present.
1877
1878     The colour and attributes of the status line may be configured, the
1879     entire status line using the status-attr, status-fg and status-bg session
1880     options and individual windows using the window-status-attr,
1881     window-status-fg and window-status-bg window options.
1882
1883     The status line is automatically refreshed at interval if it has changed,
1884     the interval may be controlled with the status-interval session option.
1885
1886     Commands related to the status line are as follows:
1887
1888     command-prompt [-I inputs] [-p prompts] [-t target-client] [template]
1889             Open the command prompt in a client.  This may be used from
1890             inside tmux to execute commands interactively.
1891
1892             If template is specified, it is used as the command.  If present,
1893             -I is a comma-separated list of the initial text for each prompt.
1894             If -p is given, prompts is a comma-separated list of prompts
1895             which are displayed in order; otherwise a single prompt is dis‐
1896             played, constructed from template if it is present, or ‘:’ if
1897             not.
1898
1899             Both inputs and prompts may contain the special character
1900             sequences supported by the status-left option.
1901
1902             Before the command is executed, the first occurrence of the
1903             string ‘%%’ and all occurrences of ‘%1’ are replaced by the
1904             response to the first prompt, the second ‘%%’ and all ‘%2’ are
1905             replaced with the response to the second prompt, and so on for
1906             further prompts.  Up to nine prompt responses may be replaced
1907             (‘%1’ to ‘%9’).
1908
1909     confirm-before [-p prompt] [-t target-client] command
1910                   (alias: confirm)
1911             Ask for confirmation before executing command.  If -p is given,
1912             prompt is the prompt to display; otherwise a prompt is con‐
1913             structed from command.  It may contain the special character
1914             sequences supported by the status-left option.
1915
1916             This command works only from inside tmux.
1917
1918     display-message [-p] [-c target-client] [-t target-pane] [message]
1919                   (alias: display)
1920             Display a message.  If -p is given, the output is printed to std‐
1921             out, otherwise it is displayed in the target-client status line.
1922             The format of message is described in the FORMATS section; infor‐
1923             mation is taken from target-pane if -t is given, otherwise the
1924             active pane for the session attached to target-client.
1925

BUFFERS

1927     tmux maintains a stack of paste buffers.  Up to the value of the
1928     buffer-limit option are kept; when a new buffer is added, the buffer at
1929     the bottom of the stack is removed.  Buffers may be added using copy-mode
1930     or the set-buffer command, and pasted into a window using the
1931     paste-buffer command.
1932
1933     A configurable history buffer is also maintained for each window.  By
1934     default, up to 2000 lines are kept; this can be altered with the
1935     history-limit option (see the set-option command above).
1936
1937     The buffer commands are as follows:
1938
1939     choose-buffer [-F format] [-t target-window] [template]
1940             Put a window into buffer choice mode, where a buffer may be cho‐
1941             sen interactively from a list.  After a buffer is selected, ‘%%’
1942             is replaced by the buffer index in template and the result exe‐
1943             cuted as a command.  If template is not given, "paste-buffer -b
1944             '%%'" is used.  For the meaning of the -F flag, see the FORMATS
1945             section.  This command works only if at least one client is
1946             attached.
1947
1948     clear-history [-t target-pane]
1949                   (alias: clearhist)
1950             Remove and free the history for the specified pane.
1951
1952     delete-buffer [-b buffer-index]
1953                   (alias: deleteb)
1954             Delete the buffer at buffer-index, or the top buffer if not spec‐
1955             ified.
1956
1957     list-buffers [-F format]
1958                   (alias: lsb)
1959             List the global buffers.  For the meaning of the -F flag, see the
1960             FORMATS section.
1961
1962     load-buffer [-b buffer-index] path
1963                   (alias: loadb)
1964             Load the contents of the specified paste buffer from path.
1965
1966     paste-buffer [-dpr] [-b buffer-index] [-s separator] [-t target-pane]
1967                   (alias: pasteb)
1968             Insert the contents of a paste buffer into the specified pane.
1969             If not specified, paste into the current one.  With -d, also
1970             delete the paste buffer from the stack.  When output, any line‐
1971             feed (LF) characters in the paste buffer are replaced with a sep‐
1972             arator, by default carriage return (CR).  A custom separator may
1973             be specified using the -s flag.  The -r flag means to do no
1974             replacement (equivalent to a separator of LF).  If -p is speci‐
1975             fied, paste bracket control codes are inserted around the buffer
1976             if the application has requested bracketed paste mode.
1977
1978     save-buffer [-a] [-b buffer-index] path
1979                   (alias: saveb)
1980             Save the contents of the specified paste buffer to path.  The -a
1981             option appends to rather than overwriting the file.
1982
1983     set-buffer [-b buffer-index] data
1984                   (alias: setb)
1985             Set the contents of the specified buffer to data.
1986
1987     show-buffer [-b buffer-index]
1988                   (alias: showb)
1989             Display the contents of the specified buffer.
1990

MISCELLANEOUS

1992     Miscellaneous commands are as follows:
1993
1994     clock-mode [-t target-pane]
1995             Display a large clock.
1996
1997     if-shell [-b] [-t target-pane] shell-command command [command]
1998                   (alias: if)
1999             Execute the first command if shell-command returns success or the
2000             second command otherwise.  Before being executed, shell-command
2001             is expanded using the rules specified in the FORMATS section,
2002             including those relevant to target-pane.  With -b, shell-command
2003             is run in the background.
2004
2005     lock-server
2006                   (alias: lock)
2007             Lock each client individually by running the command specified by
2008             the lock-command option.
2009
2010     run-shell -b [-t target-pane] shell-command
2011                   (alias: run)
2012             Execute shell-command in the background without creating a win‐
2013             dow.  Before being executed, shell-command is expanded using the
2014             rules specified in the FORMATS section.  With -b, the command is
2015             run in the background.  After it finishes, any output to stdout
2016             is displayed in copy mode (in the pane specified by -t or the
2017             current pane if omitted).  If the command doesn't return success,
2018             the exit status is also displayed.
2019
2020     server-info
2021                   (alias: info)
2022             Show server information and terminal details.
2023
2024     wait-for -LSU channel
2025                   (alias: wait)
2026             When used without options, prevents the client from exiting until
2027             woken using wait-for -S with the same channel.  When -L is used,
2028             the channel is locked and any clients that try to lock the same
2029             channel are made to wait until the channel is unlocked with
2030             wait-for -U.  This command only works from outside tmux.
2031

TERMINFO EXTENSIONS

2033     tmux understands some extensions to terminfo(5):
2034
2035     Cc, Cr  Set the cursor colour.  The first takes a single string argument
2036             and is used to set the colour; the second takes no arguments and
2037             restores the default cursor colour.  If set, a sequence such as
2038             this may be used to change the cursor colour from inside tmux:
2039
2040                   $ printf '\033]12;red\033\\'
2041
2042     Cs, Csr
2043             Change the cursor style.  If set, a sequence such as this may be
2044             used to change the cursor to an underline:
2045
2046                   $ printf '\033[4 q'
2047
2048             If Csr is set, it will be used to reset the cursor style instead
2049             of Cs.
2050
2051     Ms      This sequence can be used by tmux to store the current buffer in
2052             the host terminal's selection (clipboard).  See the set-clipboard
2053             option above and the xterm(1) man page.
2054

CONTROL MODE

2056     tmux offers a textual interface called control mode.  This allows appli‐
2057     cations to communicate with tmux using a simple text-only protocol.
2058
2059     In control mode, a client sends tmux commands or command sequences termi‐
2060     nated by newlines on standard input.  Each command will produce one block
2061     of output on standard output.  An output block consists of a %begin line
2062     followed by the output (which may be empty).  The output block ends with
2063     a %end or %error.  %begin and matching %end or %error have two arguments:
2064     an integer time (as seconds from epoch) and command number.  For example:
2065
2066           %begin 1363006971 2
2067           0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active)
2068           %end 1363006971 2
2069
2070     In control mode, tmux outputs notifications.  A notification will never
2071     occur inside an output block.
2072
2073     The following notifications are defined:
2074
2075     %exit [reason]
2076             The tmux client is exiting immediately, either because it is not
2077             attached to any session or an error occurred.  If present, reason
2078             describes why the client exited.
2079
2080     %layout-change window-id window-layout
2081             The layout of a window with ID window-id changed.  The new layout
2082             is window-layout.
2083
2084     %output pane-id value
2085             A window pane produced output.  value escapes non-printable char‐
2086             acters and backslash as octal \xxx.
2087
2088     %session-changed session-id name
2089             The client is now attached to the session with ID session-id,
2090             which is named name.
2091
2092     %session-renamed name
2093             The current session was renamed to name.
2094
2095     %sessions-changed
2096             A session was created or destroyed.
2097
2098     %unlinked-window-add window-id
2099             The window with ID window-id was created but is not linked to the
2100             current session.
2101
2102     %window-add window-id
2103             The window with ID window-id was linked to the current session.
2104
2105     %window-close window-id
2106             The window with ID window-id closed.
2107
2108     %window-renamed window-id name
2109             The window with ID window-id was renamed to name.
2110

FILES

2112     ~/.tmux.conf       Default tmux configuration file.
2113     /etc/tmux.conf     System-wide configuration file.
2114

EXAMPLES

2116     To create a new tmux session running vi(1):
2117
2118           $ tmux new-session vi
2119
2120     Most commands have a shorter form, known as an alias.  For new-session,
2121     this is new:
2122
2123           $ tmux new vi
2124
2125     Alternatively, the shortest unambiguous form of a command is accepted.
2126     If there are several options, they are listed:
2127
2128           $ tmux n
2129           ambiguous command: n, could be: new-session, new-window, next-window
2130
2131     Within an active session, a new window may be created by typing ‘C-b c’
2132     (Ctrl followed by the ‘b’ key followed by the ‘c’ key).
2133
2134     Windows may be navigated with: ‘C-b 0’ (to select window 0), ‘C-b 1’ (to
2135     select window 1), and so on; ‘C-b n’ to select the next window; and ‘C-b
2136     p’ to select the previous window.
2137
2138     A session may be detached using ‘C-b d’ (or by an external event such as
2139     ssh(1) disconnection) and reattached with:
2140
2141           $ tmux attach-session
2142
2143     Typing ‘C-b ?’ lists the current key bindings in the current window; up
2144     and down may be used to navigate the list or ‘q’ to exit from it.
2145
2146     Commands to be run when the tmux server is started may be placed in the
2147     ~/.tmux.conf configuration file.  Common examples include:
2148
2149     Changing the default prefix key:
2150
2151           set-option -g prefix C-a
2152           unbind-key C-b
2153           bind-key C-a send-prefix
2154
2155     Turning the status line off, or changing its colour:
2156
2157           set-option -g status off
2158           set-option -g status-bg blue
2159
2160     Setting other options, such as the default command, or locking after 30
2161     minutes of inactivity:
2162
2163           set-option -g default-command "exec /bin/ksh"
2164           set-option -g lock-after-time 1800
2165
2166     Creating new key bindings:
2167
2168           bind-key b set-option status
2169           bind-key / command-prompt "split-window 'exec man %%'"
2170           bind-key S command-prompt "new-window -n %1 'ssh %1'"
2171

SEE ALSO

2173     pty(4)
2174

AUTHORS

2176     Nicholas Marriott <nicm@users.sourceforge.net>
2177
2178BSD                              June 21, 2019                             BSD
Impressum