3 .\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
14 .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
15 .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 .Nd terminal multiplexer
27 .Op Fl c Ar shell-command
29 .Op Fl L Ar socket-name
30 .Op Fl S Ar socket-path
31 .Op Ar command Op Ar flags
35 is a terminal multiplexer:
36 it enables a number of terminals to be created, accessed, and
37 controlled from a single screen.
39 may be detached from a screen
40 and continue running in the background,
41 then later reattached.
45 is started it creates a new
49 and displays it on screen.
50 A status line at the bottom of the screen
51 shows information on the current session
52 and is used to enter interactive commands.
54 A session is a single collection of
56 under the management of
58 Each session has one or more
60 A window occupies the entire screen
61 and may be split into rectangular panes,
62 each of which is a separate pseudo terminal
65 manual page documents the technical details of pseudo terminals).
68 instances may connect to the same session,
69 and any number of windows may be present in the same session.
70 Once all sessions are killed,
74 Each session is persistent and will survive accidental disconnection
77 connection timeout) or intentional detaching (with the
81 may be reattached using:
87 a session is displayed on screen by a
89 and all sessions are managed by a single
91 The server and each client are separate processes which communicate through a
95 The options are as follows:
96 .Bl -tag -width "XXXXXXXXXXXX"
100 to assume the terminal supports 256 colours.
104 but indicates that the terminal supports 88 colours.
105 .It Fl c Ar shell-command
108 using the default shell.
111 server will be started to retrieve the
114 This option is for compatibility with
118 is used as a login shell.
120 Specify an alternative configuration file.
123 loads the system configuration file from
125 if present, then looks for a user configuration file at
127 The configuration file is a set of
129 commands which are executed in sequence when the server is first started.
131 If a command in the configuration file fails,
133 will report an error and exit without executing further commands.
134 .It Fl L Ar socket-name
136 stores the server socket in a directory under
141 the default socket is named
143 This option allows a different socket name to be specified, allowing several
149 a full path is not necessary: the sockets are all created in the same
152 If the socket is accidentally removed, the
154 signal may be sent to the
156 server process to recreate it.
158 Behave as a login shell.
159 This flag currently has no effect and is for compatibility with other shells
160 when using tmux as a login shell.
164 server option to prevent the server sending various informational messages.
165 .It Fl S Ar socket-path
166 Specify a full alternative path to the server socket.
169 is specified, the default socket directory is not used and any
174 attempts to guess if the terminal is likely to support UTF-8 by checking the
180 environment variables to be set for the string "UTF-8".
181 This is not always correct: the
183 flag explicitly informs
185 that UTF-8 is supported.
187 If the server is started from a client passed
189 or where UTF-8 is detected, the
193 options are enabled in the global window and session options respectively.
195 Request verbose logging.
196 This option may be specified multiple times for increasing verbosity.
197 Log messages will be saved into
198 .Pa tmux-client-PID.log
200 .Pa tmux-server-PID.log
201 files in the current directory, where
203 is the PID of the server or client process.
204 .It Ar command Op Ar flags
205 This specifies one of a set of commands used to control
207 as described in the following sections.
208 If no commands are specified, the
214 may be controlled from an attached client by using a key combination of a
217 (Ctrl-b) by default, followed by a command key.
219 The default command key bindings are:
221 .Bl -tag -width "XXXXXXXXXX" -offset indent -compact
223 Send the prefix key (C-b) through to the application.
225 Rotate the panes in the current window forwards.
231 Break the current pane out of the window.
233 Split the current pane into two, top and bottom.
235 List all paste buffers.
237 Rename the current session.
239 Split the current pane into two, left and right.
241 Kill the current window.
243 Prompt for a window index to select.
245 Rename the current window.
247 Delete the most recently copied buffer of text.
249 Prompt for an index to move the current window.
251 Select windows 0 to 9.
257 Move to the previously active pane.
259 Choose which buffer to paste interactively from a list.
261 List all key bindings.
263 Choose a client to detach.
265 Enter copy mode to copy text or view the history.
267 Paste the most recently copied buffer of text.
271 Detach the current client.
273 Prompt to search for text in open windows.
275 Display some information about the current window.
277 Move to the previously selected window.
279 Change to the next window.
281 Select the next pane in the current window.
283 Change to the previous window.
285 Briefly display pane indexes.
287 Force redraw of the attached client.
289 Select a new session for the attached client interactively.
291 Switch the attached client back to the last session.
295 Choose the current window interactively.
297 Kill the current pane.
299 Swap the current pane with the previous pane.
301 Swap the current pane with the next pane.
303 Show previous messages from
307 Enter copy mode and scroll one page up.
310 Change to the pane above, below, to the left, or to the right of the current
313 Arrange panes in one of the five preset layouts: even-horizontal,
314 even-vertical, main-horizontal, main-vertical, or tiled.
316 Move to the next window with a bell or activity marker.
318 Rotate the panes in the current window backwards.
320 Move to the previous window with a bell or activity marker.
323 Resize the current pane in steps of one cell.
326 Resize the current pane in steps of five cells.
329 Key bindings may be changed with the
335 This section contains a list of the commands supported by
337 Most commands accept the optional
345 These specify the client, session, window or pane which a command should affect.
349 file to which the client is connected, for example either of
353 for the client attached to
355 If no client is specified, the current client is chosen, if possible, or an
357 Clients may be listed with the
362 is either the name of a session (as listed by the
364 command) or the name of a client with the same syntax as
366 in which case the session attached to the client is used.
367 When looking for the session name,
369 initially searches for an exact match; if none is found, the session names
370 are checked for any for which
372 is a prefix or for which it matches as an
375 If a single match is found, it is used as the target session; multiple matches
377 If a session is omitted, the current session is used if available; if no
378 current session is available, the most recently used is chosen.
381 specifies a window in the form
382 .Em session Ns \&: Ns Em window .
384 follows the same rules as for
388 is looked for in order: as a window index, for example mysession:1; as an exact
389 window name, such as mysession:mywindow; then as an
391 pattern or the start of a window name, such as mysession:mywin* or
393 An empty window name specifies the next unused index if appropriate (for
399 otherwise the current window in
402 The special character
404 uses the last (previously current) window, or
408 are the next window or the previous window by number.
409 When the argument does not contain a colon,
411 first attempts to parse it as window; if that fails, an attempt is made to
415 takes a similar form to
417 but with the optional addition of a period followed by a pane index, for
418 example: mysession:mywindow.1.
419 If the pane index is omitted, the currently active pane in the specified
421 If neither a colon nor period appears,
423 first attempts to use the argument as a pane index; if that fails, it is looked
430 indicate the next or previous pane index, respectively.
441 may be used instead of a pane index.
443 The special characters
447 may be followed by an offset, for example:
448 .Bd -literal -offset indent
452 When dealing with a session that doesn't contain sequential window indexes,
453 they will be correctly skipped.
456 also gives each pane created in a server an identifier consisting of a
458 and a number, starting from zero.
459 A pane's identifier is unique for the life of the
461 server and is passed to the child process of the pane in the
463 environment variable.
464 It may be used alone to target a pane or the window containing it.
470 These must be passed as a single item, which typically means quoting them, for
472 .Bd -literal -offset indent
473 new-window 'vi /etc/passwd'
480 command, passed with the command and arguments separately, for example:
481 .Bd -literal -offset indent
482 bind-key F1 set-window-option force-width 81
487 .Bd -literal -offset indent
488 $ tmux bind-key F1 set-window-option force-width 81
491 Multiple commands may be specified together as part of a
492 .Em command sequence .
493 Each command should be separated by spaces and a semicolon;
494 commands are executed sequentially from left to right and
495 lines ending with a backslash continue on to the next line.
496 A literal semicolon may be included by escaping it with a backslash (for
497 example, when specifying a command sequence to
503 .Bd -literal -offset indent
504 refresh-client -t/dev/ttyp2
506 rename-session -tfirst newname
508 set-window-option -t:0 monitor-activity on
510 new-window ; split-window -d
512 bind-key R source-file ~/.tmux.conf \e; \e
513 display-message "source-file done"
518 .Bd -literal -offset indent
519 $ tmux kill-window -t :1
521 $ tmux new-window \e; split-window -d
523 $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
525 .Sh CLIENTS AND SESSIONS
528 server manages clients, sessions, windows and panes.
529 Clients are attached to sessions to interact with them, either
530 when they are created with the
532 command, or later with the
535 Each session has one or more windows
538 Windows may be linked to multiple sessions and are made up of one or
540 each of which contains a pseudo terminal.
541 Commands for creating, linking and otherwise manipulating windows
544 .Sx WINDOWS AND PANES
547 The following commands are available to manage clients and sessions:
549 .It Xo Ic attach-session
551 .Op Fl t Ar target-session
553 .D1 (alias: Ic attach )
556 create a new client in the current terminal and attach it to
558 If used from inside, switch the current client.
561 is specified, any other clients attached to the session are detached.
563 signifies the client is read-only (only keys bound to the
567 commands have any effect)
569 If no server is started,
571 will attempt to start it; this will fail unless sessions are created in the
578 are slightly adjusted: if
580 needs to select the most recently used session, it will prefer the most
584 .It Xo Ic detach-client
586 .Op Fl s Ar target-session
587 .Op Fl t Ar target-client
589 .D1 (alias: Ic detach )
590 Detach the current client if bound to a key, the client specified with
592 or all clients currently attached to the session specified by
596 is given, send SIGHUP to the parent process of the client, typically causing it
598 .It Ic has-session Op Fl t Ar target-session
600 Report an error and exit with 1 if the specified session does not exist.
601 If it does exist, exit with 0.
605 server and clients and destroy all sessions.
606 .It Ic kill-session Op Fl t Ar target-session
607 Destroy the given session, closing any windows linked to it and no other
608 sessions, and detaching all clients attached to it.
609 .It Xo Ic list-clients
611 .Op Fl t Ar target-session
614 List all clients attached to the server.
615 For the meaning of the
622 is specified, list only clients connected to that session.
624 .D1 (alias: Ic lscm )
625 List the syntax of all commands supported by
627 .It Ic list-sessions Op Fl F Ar format
629 List all sessions managed by the server.
630 For the meaning of the
635 .It Ic lock-client Op Fl t Ar target-client
636 .D1 (alias: Ic lockc )
642 .It Ic lock-session Op Fl t Ar target-session
643 .D1 (alias: Ic locks )
644 Lock all clients attached to
646 .It Xo Ic new-session
648 .Op Fl n Ar window-name
649 .Op Fl s Ar session-name
650 .Op Fl t Ar target-session
656 Create a new session with name
659 The new session is attached to the current terminal unless
665 are the name of and shell command to execute in the initial window.
672 specify the size of the initial window (80 by 24 if not given).
674 If run from a terminal, any
676 special characters are saved and used for new windows in the new session.
680 is given, the new session is
684 This means they share the same set of windows - all windows from
686 are linked to the new session and any subsequent new windows or windows being
687 closed are applied to both sessions.
688 The current and previous window and any session options remain independent and
689 either session may be killed without affecting the other.
697 .It Xo Ic refresh-client
699 .Op Fl t Ar target-client
701 .D1 (alias: Ic refresh )
702 Refresh the current client if bound to a key, or a single client if one is given
707 is specified, only update the client's status bar.
708 .It Xo Ic rename-session
709 .Op Fl t Ar target-session
712 .D1 (alias: Ic rename )
713 Rename the session to
715 .It Xo Ic show-messages
716 .Op Fl t Ar target-client
718 .D1 (alias: Ic showmsgs )
719 Any messages displayed on the status line are saved in a per-client message
720 log, up to a maximum of the limit set by the
722 session option for the session attached to that client.
723 This command displays the log for
725 .It Ic source-file Ar path
726 .D1 (alias: Ic source )
727 Execute commands from
730 .D1 (alias: Ic start )
733 server, if not already running, without creating any sessions.
734 .It Xo Ic suspend-client
735 .Op Fl t Ar target-client
737 .D1 (alias: Ic suspendc )
738 Suspend a client by sending
741 .It Xo Ic switch-client
743 .Op Fl c Ar target-client
744 .Op Fl t Ar target-session
746 .D1 (alias: Ic switchc )
747 Switch the current session for client
756 is used, the client is moved to the last, next or previous session
759 toggles whether a client is read-only (see the
763 .Sh WINDOWS AND PANES
766 window may be in one of several modes.
767 The default permits direct access to the terminal attached to the window.
768 The other is copy mode, which permits a section of a window or its
769 history to be copied to a
771 for later insertion into another window.
772 This mode is entered with the
777 It is also entered when a command that produces output, such as
779 is executed from a key binding.
781 The keys available depend on whether emacs or vi mode is selected
785 The following keys are supported as appropriate for the mode:
786 .Bl -column "FunctionXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
787 .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
788 .It Li "Back to indentation" Ta "^" Ta "M-m"
789 .It Li "Bottom of history" Ta "G" Ta "M-<"
790 .It Li "Clear selection" Ta "Escape" Ta "C-g"
791 .It Li "Copy selection" Ta "Enter" Ta "M-w"
792 .It Li "Cursor down" Ta "j" Ta "Down"
793 .It Li "Cursor left" Ta "h" Ta "Left"
794 .It Li "Cursor right" Ta "l" Ta "Right"
795 .It Li "Cursor to bottom line" Ta "L" Ta ""
796 .It Li "Cursor to middle line" Ta "M" Ta "M-r"
797 .It Li "Cursor to top line" Ta "H" Ta "M-R"
798 .It Li "Cursor up" Ta "k" Ta "Up"
799 .It Li "Delete entire line" Ta "d" Ta "C-u"
800 .It Li "Delete/Copy to end of line" Ta "D" Ta "C-k"
801 .It Li "End of line" Ta "$" Ta "C-e"
802 .It Li "Go to line" Ta ":" Ta "g"
803 .It Li "Half page down" Ta "C-d" Ta "M-Down"
804 .It Li "Half page up" Ta "C-u" Ta "M-Up"
805 .It Li "Jump forward" Ta "f" Ta "f"
806 .It Li "Jump to forward" Ta "t" Ta ""
807 .It Li "Jump backward" Ta "F" Ta "F"
808 .It Li "Jump to backward" Ta "T" Ta ""
809 .It Li "Jump again" Ta ";" Ta ";"
810 .It Li "Jump again in reverse" Ta "," Ta ","
811 .It Li "Next page" Ta "C-f" Ta "Page down"
812 .It Li "Next space" Ta "W" Ta ""
813 .It Li "Next space, end of word" Ta "E" Ta ""
814 .It Li "Next word" Ta "w" Ta ""
815 .It Li "Next word end" Ta "e" Ta "M-f"
816 .It Li "Paste buffer" Ta "p" Ta "C-y"
817 .It Li "Previous page" Ta "C-b" Ta "Page up"
818 .It Li "Previous word" Ta "b" Ta "M-b"
819 .It Li "Previous space" Ta "B" Ta ""
820 .It Li "Quit mode" Ta "q" Ta "Escape"
821 .It Li "Rectangle toggle" Ta "v" Ta "R"
822 .It Li "Scroll down" Ta "C-Down or C-e" Ta "C-Down"
823 .It Li "Scroll up" Ta "C-Up or C-y" Ta "C-Up"
824 .It Li "Search again" Ta "n" Ta "n"
825 .It Li "Search again in reverse" Ta "N" Ta "N"
826 .It Li "Search backward" Ta "?" Ta "C-r"
827 .It Li "Search forward" Ta "/" Ta "C-s"
828 .It Li "Start of line" Ta "0" Ta "C-a"
829 .It Li "Start selection" Ta "Space" Ta "C-Space"
830 .It Li "Top of history" Ta "g" Ta "M->"
831 .It Li "Transpose chars" Ta "" Ta "C-t"
834 The next and previous word keys use space and the
839 characters as word delimiters by default, but this can be adjusted by
843 Next word moves to the start of the next word, next word end to the end of the
844 next word and previous word to the start of the previous word.
845 The three next and previous space keys work similarly but use a space alone as
848 The jump commands enable quick movement within a line.
853 will move the cursor to the next
855 character on the current line.
858 will then jump to the next occurrence.
860 Commands in copy mode may be prefaced by an optional repeat count.
861 With vi key bindings, a prefix is entered using the number keys; with
862 emacs, the Alt (meta) key and a number begins prefix entry.
863 For example, to move the cursor forward by ten words, use
869 When copying the selection, the repeat count indicates the buffer index to
872 Mode key bindings are defined in a set of named tables:
876 for keys used when line editing at the command prompt;
880 for keys used when choosing from lists (such as produced by the
887 The tables may be viewed with the
889 command and keys modified or removed with
894 The paste buffer key pastes the first line from the top paste buffer on the
903 .Op Fl t Ar target-pane
908 option scrolls one page up.
911 Each window displayed by
913 may be split into one or more
915 each pane takes up a certain area of the display and is a separate terminal.
916 A window may be split into panes using the
919 Windows may be split horizontally (with the
922 Panes may be resized with the
930 by default), the current pane may be changed with the
936 commands may be used to swap panes without changing their position.
937 Panes are numbered beginning from zero in the order they are created.
942 These may be selected with the
944 command or cycled with
948 by default); once a layout is chosen, panes within it may be moved and resized
951 The following layouts are supported:
953 .It Ic even-horizontal
954 Panes are spread out evenly from left to right across the window.
956 Panes are spread evenly from top to bottom.
957 .It Ic main-horizontal
958 A large (main) pane is shown at the top of the window and the remaining panes
959 are spread from left to right in the leftover space at the bottom.
962 window option to specify the height of the top pane.
966 but the large pane is placed on the left and the others spread from top to
967 bottom along the right.
972 Panes are spread out as evenly as possible over the window in both rows and
978 may be used to apply a previously used layout - the
980 command displays the layout of each window in a form suitable for use with
983 .Bd -literal -offset indent
986 layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
987 $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
991 automatically adjusts the size of the layout for the current window size.
992 Note that a layout cannot be applied to a window with more panes than that
993 from which the layout was originally defined.
995 Commands related to windows and panes are as follows:
999 .Op Fl t Ar target-pane
1001 .D1 (alias: Ic breakp )
1004 off from its containing window to make it the only pane in a new window.
1007 is given, the new window does not become the current window.
1008 .It Xo Ic capture-pane
1009 .Op Fl b Ar buffer-index
1010 .Op Fl E Ar end-line
1011 .Op Fl S Ar start-line
1012 .Op Fl t Ar target-pane
1014 .D1 (alias: Ic capturep )
1015 Capture the contents of a pane to the specified buffer, or a new buffer if none
1021 specify the starting and ending line numbers, zero is the first line of the
1022 visible pane and negative numbers are lines in the history.
1023 The default is to capture only the visible contents of the pane.
1026 .Op Fl t Ar target-window
1029 Put a window into client choice mode, allowing a client to be selected
1030 interactively from a list.
1031 After a client is chosen,
1033 is replaced by the client
1037 and the result executed as a command.
1040 is not given, "detach-client -t '%%'" is used.
1041 This command works only from inside
1045 .Op Fl t Ar target-window
1048 Put a window into session choice mode, where a session may be selected
1049 interactively from a list.
1052 is replaced by the session name in
1054 and the result executed as a command.
1057 is not given, "switch-client -t '%%'" is used.
1058 This command works only from inside
1062 .Op Fl t Ar target-window
1065 Put a window into window choice mode, where a window may be chosen
1066 interactively from a list.
1067 After a window is selected,
1069 is replaced by the session name and window index in
1071 and the result executed as a command.
1074 is not given, "select-window -t '%%'" is used.
1075 This command works only from inside
1077 .It Ic display-panes Op Fl t Ar target-client
1078 .D1 (alias: Ic displayp)
1079 Display a visible indicator of each pane shown by
1082 .Ic display-panes-time ,
1083 .Ic display-panes-colour ,
1085 .Ic display-panes-active-colour
1087 While the indicator is on screen, a pane may be selected with the
1092 .It Xo Ic find-window
1093 .Op Fl t Ar target-window
1096 .D1 (alias: Ic findw )
1101 in window names, titles, and visible content (but not history).
1102 If only one window is matched, it'll be automatically selected, otherwise a
1103 choice list is shown.
1104 This command only works from inside
1110 .Fl p Ar percentage Oc
1111 .Op Fl s Ar src-pane
1112 .Op Fl t Ar dst-pane
1114 .D1 (alias: Ic joinp )
1117 but instead of splitting
1119 and creating a new pane, split it and move
1122 This can be used to reverse
1126 .Op Fl t Ar target-pane
1128 .D1 (alias: Ic killp )
1129 Destroy the given pane.
1130 If no panes remain in the containing window, it is also destroyed.
1133 option kills all but the pane given with
1135 .It Ic kill-window Op Fl t Ar target-window
1136 .D1 (alias: Ic killw )
1137 Kill the current window or the window at
1139 removing it from any sessions to which it is linked.
1140 .It Ic last-pane Op Fl t Ar target-window
1141 .D1 (alias: Ic lastp )
1142 Select the last (previously selected) pane.
1143 .It Ic last-window Op Fl t Ar target-session
1144 .D1 (alias: Ic last )
1145 Select the last (previously selected) window.
1148 is specified, select the last window of the current session.
1149 .It Xo Ic link-window
1151 .Op Fl s Ar src-window
1152 .Op Fl t Ar dst-window
1154 .D1 (alias: Ic linkw )
1161 is specified and no such window exists, the
1168 exists, it is killed, otherwise an error is generated.
1171 is given, the newly linked window is not selected.
1172 .It Xo Ic list-panes
1177 .D1 (alias: Ic lsp )
1182 is ignored and all panes on the server are listed.
1187 is a session (or the current session).
1188 If neither is given,
1190 is a window (or the current window).
1191 For the meaning of the
1196 .It Xo Ic list-windows
1199 .Op Fl t Ar target-session
1201 .D1 (alias: Ic lsw )
1204 is given, list all windows on the server.
1205 Otherwise, list windows in the current session or in
1206 .Ar target-session .
1207 For the meaning of the
1212 .It Xo Ic move-window
1214 .Op Fl s Ar src-window
1215 .Op Fl t Ar dst-window
1217 .D1 (alias: Ic movew )
1220 except the window at
1224 .It Xo Ic new-window
1226 .Op Fl n Ar window-name
1227 .Op Fl t Ar target-window
1228 .Op Ar shell-command
1230 .D1 (alias: Ic neww )
1231 Create a new window.
1234 the new window is inserted at the next index up from the specified
1236 moving windows up if necessary,
1239 is the new window location.
1243 is given, the session does not make the new window the current window.
1245 represents the window to be created; if the target already exists an error is
1248 flag is used, in which case it is destroyed.
1250 is the command to execute.
1253 is not specified, the value of the
1257 When the shell command completes, the window closes.
1260 option to change this behaviour.
1264 environment variable must be set to
1266 for all programs running
1269 New windows will automatically have
1271 added to their environment, but care must be taken not to reset this in shell
1276 option prints the location of the new window after it has been created.
1277 .It Ic next-layout Op Fl t Ar target-window
1278 .D1 (alias: Ic nextl )
1279 Move a window to the next layout and rearrange the panes to fit.
1280 .It Xo Ic next-window
1282 .Op Fl t Ar target-session
1284 .D1 (alias: Ic next )
1285 Move to the next window in the session.
1288 is used, move to the next window with a bell, activity or content alert.
1291 .Op Fl t Ar target-pane
1292 .Op Ar shell-command
1294 .D1 (alias: Ic pipep )
1295 Pipe any output sent by the program in
1298 A pane may only be piped to one command at a time, any existing pipe is
1304 string may contain the special character sequences supported by the
1309 is given, the current pipe (if any) is closed.
1313 option only opens a new pipe if no previous pipe exists, allowing a pipe to
1314 be toggled with a single key, for example:
1315 .Bd -literal -offset indent
1316 bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1318 .It Xo Ic previous-layout
1319 .Op Fl t Ar target-window
1321 .D1 (alias: Ic prevl )
1322 Move to the previous layout in the session.
1323 .It Xo Ic previous-window
1325 .Op Fl t Ar target-session
1327 .D1 (alias: Ic prev )
1328 Move to the previous window in the session.
1331 move to the previous window with a bell, activity or content alert.
1332 .It Xo Ic rename-window
1333 .Op Fl t Ar target-window
1336 .D1 (alias: Ic renamew )
1337 Rename the current window, or the window at
1341 .It Xo Ic resize-pane
1343 .Op Fl t Ar target-pane
1346 .D1 (alias: Ic resizep )
1347 Resize a pane, upward with
1349 (the default), downward with
1353 and to the right with
1357 is given in lines or cells (the default is 1).
1358 .It Xo Ic respawn-pane
1360 .Op Fl t Ar target-pane
1361 .Op Ar shell-command
1363 .D1 (alias: Ic respawnp )
1364 Reactivate a pane in which the command has exited (see the
1369 is not given, the command used when the pane was created is executed.
1370 The pane must be already inactive, unless
1372 is given, in which case any existing command is killed.
1373 .It Xo Ic respawn-window
1375 .Op Fl t Ar target-window
1376 .Op Ar shell-command
1378 .D1 (alias: Ic respawnw )
1379 Reactivate a window in which the command has exited (see the
1384 is not given, the command used when the window was created is executed.
1385 The window must be already inactive, unless
1387 is given, in which case any existing command is killed.
1388 .It Xo Ic rotate-window
1390 .Op Fl t Ar target-window
1392 .D1 (alias: Ic rotatew )
1393 Rotate the positions of the panes within a window, either upward (numerically
1396 or downward (numerically higher).
1397 .It Xo Ic select-layout
1399 .Op Fl t Ar target-window
1402 .D1 (alias: Ic selectl )
1403 Choose a specific layout for a window.
1406 is not given, the last preset layout used (if any) is reapplied.
1410 are equivalent to the
1415 .It Xo Ic select-pane
1417 .Op Fl t Ar target-pane
1419 .D1 (alias: Ic selectp )
1422 the active pane in window
1430 is used, respectively the pane below, to the left, to the right, or above the
1431 target pane is used.
1433 is the same as using the
1436 .It Xo Ic select-window
1438 .Op Fl t Ar target-window
1440 .D1 (alias: Ic selectw )
1441 Select the window at
1447 are equivalent to the
1453 .It Xo Ic split-window
1457 .Fl p Ar percentage Oc
1458 .Op Fl t Ar target-pane
1459 .Op Ar shell-command
1461 .D1 (alias: Ic splitw )
1462 Create a new pane by splitting
1465 does a horizontal split and
1467 a vertical split; if neither is specified,
1474 options specify the size of the new pane in lines (for vertical split) or in
1475 cells (for horizontal split), or as a percentage, respectively.
1476 All other options have the same meaning as for the
1481 .Op Fl s Ar src-pane
1482 .Op Fl t Ar dst-pane
1484 .D1 (alias: Ic swapp )
1488 is used and no source pane is specified with
1491 is swapped with the previous pane (before it numerically);
1493 swaps with the next pane (after it numerically).
1497 not to change the active pane.
1498 .It Xo Ic swap-window
1500 .Op Fl s Ar src-window
1501 .Op Fl t Ar dst-window
1503 .D1 (alias: Ic swapw )
1506 except the source and destination windows are swapped.
1507 It is an error if no window exists at
1509 .It Xo Ic unlink-window
1511 .Op Fl t Ar target-window
1513 .D1 (alias: Ic unlinkw )
1518 is given, a window may be unlinked only if it is linked to multiple sessions -
1519 windows may not be linked to no sessions;
1522 is specified and the window is linked to only one session, it is unlinked and
1527 allows a command to be bound to most keys, with or without a prefix key.
1528 When specifying keys, most represent themselves (for example
1532 Ctrl keys may be prefixed with
1538 In addition, the following special key names are accepted:
1556 .Em NPage/PageDown/PgDn ,
1557 .Em PPage/PageUp/PgUp ,
1561 Note that to bind the
1565 keys, quotation marks are necessary, for example:
1566 .Bd -literal -offset indent
1567 bind-key '"' split-window
1568 bind-key "'" new-window
1571 Commands related to key bindings are as follows:
1575 .Op Fl t Ar key-table
1576 .Ar key Ar command Op Ar arguments
1578 .D1 (alias: Ic bind )
1585 the primary key bindings are modified (those normally activated with the prefix
1586 key); in this case, if
1588 is specified, it is not necessary to use the prefix key,
1595 flag indicates this key may repeat, see the
1605 the binding for command mode with
1607 or for normal mode without.
1608 To view the default bindings and possible commands, see the
1611 .It Ic list-keys Op Fl t Ar key-table
1612 .D1 (alias: Ic lsk )
1613 List all key bindings.
1616 the primary key bindings - those executed when preceded by the prefix key -
1618 Keys bound without the prefix key (see
1628 are listed; this may be one of:
1637 .Op Fl t Ar target-pane
1640 .D1 (alias: Ic send )
1641 Send a key or keys to a window.
1644 is the name of the key (such as
1648 ) to send; if the string is not recognised as a key, it is sent as a series of
1650 All arguments are sent sequentially from first to last.
1651 .It Ic send-prefix Op Fl t Ar target-pane
1652 Send the prefix key to a window as if it was pressed.
1653 If multiple prefix keys are configured, only the first is sent.
1654 .It Xo Ic unbind-key
1656 .Op Fl t Ar key-table
1659 .D1 (alias: Ic unbind )
1660 Unbind the command bound to
1664 the primary key bindings are modified; in this case, if
1666 is specified, the command bound to
1668 without a prefix (if any) is removed.
1671 is present, all key bindings are removed.
1679 is unbound: the binding for command mode with
1681 or for normal mode without.
1684 The appearance and behaviour of
1686 may be modified by changing the value of various options.
1687 There are three types of option:
1688 .Em server options ,
1691 .Em window options .
1695 server has a set of global options which do not apply to any particular
1697 These are altered with the
1700 command, or displayed with the
1705 In addition, each individual session may have a set of session options, and
1706 there is a separate set of global session options.
1707 Sessions which do not have a particular option configured inherit the value
1708 from the global session options.
1709 Session options are set or unset with the
1711 command and may be listed with the
1714 The available server and session options are listed under the
1718 Similarly, a set of window options is attached to each window, and there is
1719 a set of global window options from which any unset options are inherited.
1720 Window options are altered with the
1721 .Ic set-window-option
1722 command and can be listed with the
1723 .Ic show-window-options
1725 All window options are documented with the
1726 .Ic set-window-option
1729 Commands which set options are as follows:
1731 .It Xo Ic set-option
1733 .Op Fl t Ar target-session | Ar target-window
1736 .D1 (alias: Ic set )
1737 Set a window option with
1740 .Ic set-window-option
1742 a server option with
1744 otherwise a session option.
1748 is specified, the global session or window option is set.
1751 and if the option expects a string,
1753 is appended to the existing setting.
1756 flag unsets an option, so a session inherits the option from the global
1758 It is not possible to unset a global option.
1760 Available window options are listed under
1761 .Ic set-window-option .
1763 Available server options are:
1765 .It Ic buffer-limit Ar number
1766 Set the number of buffers; as new buffers are added to the top of the stack,
1767 old ones are removed from the bottom if necessary to maintain this maximum
1769 .It Ic escape-time Ar time
1770 Set the time in milliseconds for which
1772 waits after an escape is input to determine if it is part of a function or meta
1774 The default is 500 milliseconds.
1775 .It Xo Ic exit-unattached
1778 If enabled, the server will exit when there are no attached clients.
1782 Enable or disable the display of various informational messages (see also the
1785 .It Xo Ic set-clipboard
1788 Attempt to set the terminal clipboard content using the
1792 This option is on by default if there is an
1796 description for the client terminal.
1797 Note that this feature needs to be enabled in
1799 by setting the resource:
1800 .Bd -literal -offset indent
1801 disallowedWindowOps: 20,21,SetXprop
1804 Or changing this property from the
1806 interactive menu when required.
1809 Available session options are:
1811 .It Ic base-index Ar index
1812 Set the base index from which an unused index should be searched when a new
1814 The default is zero.
1815 .It Xo Ic bell-action
1816 .Op Ic any | none | current
1818 Set action on window bell.
1820 means a bell in any window linked to a session causes a bell in the current
1821 window of that session,
1823 means all bells are ignored and
1825 means only bell in windows other than the current window are ignored.
1826 .It Xo Ic bell-on-alert
1829 If on, ring the terminal bell when an activity, content or silence alert
1831 .It Ic default-command Ar shell-command
1832 Set the command used for new windows (if not specified when the window is
1838 The default is an empty string, which instructs
1840 to create a login shell using the value of the
1843 .It Ic default-path Ar path
1844 Set the default working directory for new panes.
1845 If empty (the default), the working directory is determined from the process
1846 running in the active pane, from the command line environment or from the
1847 working directory where the session was created.
1850 is "$HOME" or "~", the value of the
1852 environment variable is used.
1855 is ".", the working directory when
1857 was started is used.
1858 .It Ic default-shell Ar path
1859 Specify the default shell.
1860 This is used as the login shell for new windows when the
1862 option is set to empty, and must be the full path of the executable.
1865 tries to set a default value from the first suitable of the
1867 environment variable, the shell returned by
1871 This option should be configured when
1873 is used as a login shell.
1874 .It Ic default-terminal Ar terminal
1875 Set the default terminal for new windows created in this session - the
1876 default value of the
1878 environment variable.
1881 to work correctly, this
1885 or a derivative of it.
1886 .It Xo Ic destroy-unattached
1889 If enabled and the session is no longer attached to any clients, it is
1891 .It Xo Ic detach-on-destroy
1894 If on (the default), the client is detached when the session it is attached to
1896 If off, the client is switched to the most recently active of the remaining
1898 .It Ic display-panes-active-colour Ar colour
1899 Set the colour used by the
1901 command to show the indicator for the active pane.
1902 .It Ic display-panes-colour Ar colour
1903 Set the colour used by the
1905 command to show the indicators for inactive panes.
1906 .It Ic display-panes-time Ar time
1907 Set the time in milliseconds for which the indicators shown by the
1910 .It Ic display-time Ar time
1911 Set the amount of time for which status line messages and other on-screen
1912 indicators are displayed.
1915 .It Ic history-limit Ar lines
1916 Set the maximum number of lines held in window history.
1917 This setting applies only to new windows - existing window histories are not
1918 resized and retain the limit at the point they were created.
1919 .It Ic lock-after-time Ar number
1920 Lock the session (like the
1924 seconds of inactivity, or the entire server (all sessions) if the
1927 The default is not to lock (set to 0).
1928 .It Ic lock-command Ar shell-command
1929 Command to run when locking each client.
1930 The default is to run
1934 .It Xo Ic lock-server
1940 instead of each session locking individually as each has been
1942 .Ic lock-after-time ,
1943 the entire server will lock after
1945 sessions would have locked.
1946 This has no effect as a session option; it must be set as a global option.
1947 .It Ic message-attr Ar attributes
1948 Set status line message attributes, where
1952 or a comma-delimited list of one or more of:
1963 .It Ic message-bg Ar colour
1964 Set status line message background colour, where
1978 from the 256-colour set,
1980 or a hexadecimal RGB string such as
1982 which chooses the closest match from the default 256-colour set.
1983 .It Ic message-command-attr Ar attributes
1984 Set status line message attributes when in command mode.
1985 .It Ic message-command-bg Ar colour
1986 Set status line message background colour when in command mode.
1987 .It Ic message-command-fg Ar colour
1988 Set status line message foreground colour when in command mode.
1989 .It Ic message-fg Ar colour
1990 Set status line message foreground colour.
1991 .It Ic message-limit Ar number
1992 Set the number of error or information messages to save in the message log for
1995 .It Xo Ic mouse-resize-pane
2000 captures the mouse and allows panes to be resized by dragging on their borders.
2001 .It Xo Ic mouse-select-pane
2006 captures the mouse and when a window is split into multiple panes the mouse may
2007 be used to select the current pane.
2008 The mouse click is also passed through to the application as normal.
2009 .It Xo Ic mouse-select-window
2012 If on, clicking the mouse on a window name in the status line will select that
2014 .It Xo Ic mouse-utf8
2017 If enabled, request mouse input as UTF-8 on UTF-8 terminals.
2018 .It Ic pane-active-border-bg Ar colour
2019 .It Ic pane-active-border-fg Ar colour
2020 Set the pane border colour for the currently active pane.
2021 .It Ic pane-border-bg Ar colour
2022 .It Ic pane-border-fg Ar colour
2023 Set the pane border colour for panes aside from the active pane.
2024 .It Ic prefix Ar keys
2025 Set the keys accepted as a prefix key.
2027 is a comma-separated list of key names, each of which individually behave as
2029 .It Ic repeat-time Ar time
2030 Allow multiple commands to be entered without pressing the prefix-key again
2033 milliseconds (the default is 500).
2034 Whether a key repeats may be set when it is bound using the
2038 Repeat is enabled for the default keys bound to the
2041 .It Xo Ic set-remain-on-exit
2046 window option for any windows first created in this session.
2047 When this option is true, windows in which the running program has
2048 exited do not close, instead remaining open but inactivate.
2051 command to reactivate such a window, or the
2053 command to destroy it.
2054 .It Xo Ic set-titles
2057 Attempt to set the client terminal title using the
2062 entries if they exist.
2064 automatically sets these to the \ee]2;...\e007 sequence if
2065 the terminal appears to be an xterm.
2066 This option is off by default.
2068 will only attempt to set the window title if the STY environment
2070 .It Ic set-titles-string Ar string
2071 String used to set the window title if
2074 Character sequences are replaced as for the
2080 Show or hide the status line.
2081 .It Ic status-attr Ar attributes
2082 Set status line attributes.
2083 .It Ic status-bg Ar colour
2084 Set status line background colour.
2085 .It Ic status-fg Ar colour
2086 Set status line foreground colour.
2087 .It Ic status-interval Ar interval
2088 Update the status bar every
2091 By default, updates will occur every 15 seconds.
2092 A setting of zero disables redrawing at interval.
2093 .It Xo Ic status-justify
2094 .Op Ic left | centre | right
2096 Set the position of the window list component of the status line: left, centre
2098 .It Xo Ic status-keys
2101 Use vi or emacs-style
2102 key bindings in the status line, for example at the command prompt.
2103 The default is emacs, unless the
2107 environment variables are set and contain the string
2109 .It Ic status-left Ar string
2112 to the left of the status bar.
2114 will be passed through
2117 By default, the session name is shown.
2119 may contain any of the following special character sequences:
2120 .Bl -column "Character pair" "Replaced with" -offset indent
2121 .It Sy "Character pair" Ta Sy "Replaced with"
2122 .It Li "#(shell-command)" Ta "First line of the command's output"
2123 .It Li "#[attributes]" Ta "Colour or attribute change"
2124 .It Li "#H" Ta "Hostname of local host"
2125 .It Li "#h" Ta "Hostname of local host without the domain name"
2126 .It Li "#F" Ta "Current window flag"
2127 .It Li "#I" Ta "Current window index"
2128 .It Li "#P" Ta "Current pane index"
2129 .It Li "#S" Ta "Session name"
2130 .It Li "#T" Ta "Current pane title"
2131 .It Li "#W" Ta "Current window name"
2132 .It Li "##" Ta "A literal" Ql #
2135 The #(shell-command) form executes
2137 and inserts the first line of its output.
2138 Note that shell commands are only executed once at the interval specified by
2141 option: if the status line is redrawn in the meantime, the previous result is
2143 Shell commands are executed with the
2145 global environment set (see the
2149 For details on how the names and titles can be set see the
2150 .Sx "NAMES AND TITLES"
2153 #[attributes] allows a comma-separated list of attributes to be specified,
2156 to set the foreground colour,
2158 to set the background colour, the name of one of the attributes (listed under
2161 option) to turn an attribute on, or an attribute prefixed with
2163 to turn one off, for example
2166 .Bd -literal -offset indent
2167 #(sysctl vm.loadavg)
2168 #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
2171 Where appropriate, special character sequences may be prefixed with a number to
2172 specify the maximum length, for example
2175 By default, UTF-8 in
2177 is not interpreted, to enable UTF-8, use the
2180 .It Ic status-left-attr Ar attributes
2181 Set the attribute of the left part of the status line.
2182 .It Ic status-left-bg Ar colour
2183 Set the background colour of the left part of the status line.
2184 .It Ic status-left-fg Ar colour
2185 Set the foreground colour of the left part of the status line.
2186 .It Ic status-left-length Ar length
2189 of the left component of the status bar.
2191 .It Ic status-right Ar string
2194 to the right of the status bar.
2195 By default, the current window title in double quotes, the date and the time
2202 character pairs are replaced, and UTF-8 is dependent on the
2205 .It Ic status-right-attr Ar attributes
2206 Set the attribute of the right part of the status line.
2207 .It Ic status-right-bg Ar colour
2208 Set the background colour of the right part of the status line.
2209 .It Ic status-right-fg Ar colour
2210 Set the foreground colour of the right part of the status line.
2211 .It Ic status-right-length Ar length
2214 of the right component of the status bar.
2216 .It Xo Ic status-utf8
2221 to treat top-bit-set characters in the
2225 strings as UTF-8; notably, this is important for wide characters.
2226 This option defaults to off.
2227 .It Ic terminal-overrides Ar string
2228 Contains a list of entries which override terminal descriptions read using
2231 is a comma-separated list of items each a colon-separated string made up of a
2232 terminal type pattern (matched using
2238 For example, to set the
2243 for all terminal types and the
2249 terminal type, the option could be set to the string:
2250 .Bd -literal -offset indent
2251 "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
2254 The terminal entry value is passed through
2256 before interpretation.
2257 The default value forcibly corrects the
2259 entry for terminals which support 88 or 256 colours:
2260 .Bd -literal -offset indent
2261 "*88col*:colors=88,*256col*:colors=256,xterm*:XT"
2263 .It Ic update-environment Ar variables
2264 Set a space-separated string containing a list of environment variables to be
2265 copied into the session environment when a new session is created or an
2266 existing session is attached.
2267 Any variables that do not exist in the source environment are set to be
2268 removed from the session environment (as if
2274 "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID
2276 .It Xo Ic visual-activity
2279 If on, display a status line message when activity occurs in a window
2281 .Ic monitor-activity
2282 window option is enabled.
2283 .It Xo Ic visual-bell
2286 If this option is on, a message is shown on a bell instead of it being passed
2287 through to the terminal (which normally makes a sound).
2291 .It Xo Ic visual-content
2295 .Ic visual-activity ,
2296 display a message when content is present in a window
2299 window option is enabled.
2300 .It Xo Ic visual-silence
2305 is enabled, prints a message after the interval has expired on a given window.
2306 .It Ic word-separators Ar string
2307 Sets the session's conception of what characters are considered word
2308 separators, for the purposes of the next and previous word commands in
2313 .It Xo Ic set-window-option
2315 .Op Fl t Ar target-window
2318 .D1 (alias: Ic setw )
2319 Set a window option.
2325 flags work similarly to the
2329 Supported window options are:
2331 .Bl -tag -width Ds -compact
2332 .It Xo Ic aggressive-resize
2335 Aggressively resize the chosen window.
2338 will resize the window to the size of the smallest session for which it is the
2339 current window, rather than the smallest session to which it is attached.
2340 The window may resize when the current window is changed on another sessions;
2341 this option is good for full-screen programs which support
2343 and poor for interactive programs such as shells.
2345 .It Xo Ic alternate-screen
2348 This option configures whether programs running inside
2350 may use the terminal alternate screen feature, which allows the
2356 The alternate screen feature preserves the contents of the window when an
2357 interactive application starts and restores it on exit, so that any output
2358 visible before the application starts reappears unchanged after it exits.
2361 .It Xo Ic automatic-rename
2364 Control automatic window renaming.
2365 When this setting is enabled,
2367 will attempt - on supported platforms - to rename the window to reflect the
2368 command currently running in it.
2369 This flag is automatically disabled for an individual window when a name
2370 is specified at creation with
2376 or with a terminal escape sequence.
2377 It may be switched off globally with:
2378 .Bd -literal -offset indent
2379 set-window-option -g automatic-rename off
2382 .It Ic clock-mode-colour Ar colour
2385 .It Xo Ic clock-mode-style
2388 Set clock hour format.
2390 .It Ic force-height Ar height
2391 .It Ic force-width Ar width
2394 from resizing a window to greater than
2398 A value of zero restores the default unlimited setting.
2400 .It Ic main-pane-height Ar height
2401 .It Ic main-pane-width Ar width
2402 Set the width or height of the main (left or top) pane in the
2408 .It Ic mode-attr Ar attributes
2409 Set window modes attributes.
2411 .It Ic mode-bg Ar colour
2412 Set window modes background colour.
2414 .It Ic mode-fg Ar colour
2415 Set window modes foreground colour.
2420 Use vi or emacs-style key bindings in copy and choice modes.
2423 option, the default is emacs, unless
2430 .It Xo Ic mode-mouse
2431 .Op Ic on | off | copy-mode
2433 Mouse state in modes.
2434 If on, the mouse may be used to enter copy mode and copy a selection by
2435 dragging, to enter copy mode and scroll with the mouse wheel, or to select an
2436 option in choice mode.
2439 the mouse behaves as set to on, but cannot be used to enter copy
2442 .It Xo Ic monitor-activity
2445 Monitor for activity in the window.
2446 Windows with activity are highlighted in the status line.
2448 .It Ic monitor-content Ar match-string
2449 Monitor content in the window.
2454 appears in the window, it is highlighted in the status line.
2456 .It Xo Ic monitor-silence
2459 Monitor for silence (no activity) in the window within
2462 Windows that have been silent for the interval are highlighted in the
2464 An interval of zero disables the monitoring.
2466 .It Ic other-pane-height Ar height
2467 Set the height of the other panes (not the main pane) in the
2470 If this option is set to 0 (the default), it will have no effect.
2472 .Ic main-pane-height
2474 .Ic other-pane-height
2475 options are set, the main pane will grow taller to make the other panes the
2476 specified height, but will never shrink to do so.
2478 .It Ic other-pane-width Ar width
2480 .Ic other-pane-height ,
2481 but set the width of other panes in the
2485 .It Ic pane-base-index Ar index
2488 but set the starting index for pane numbers.
2490 .It Xo Ic remain-on-exit
2493 A window with this flag set is not destroyed when the program running in it
2495 The window may be reactivated with the
2499 .It Xo Ic synchronize-panes
2502 Duplicate input to any pane to all other panes in the same window (only
2503 for panes that are not in any special mode).
2510 to expect UTF-8 sequences to appear in this window.
2512 .It Ic window-status-alert-attr Ar attributes
2513 Set status line attributes for windows which have an alert (bell, activity
2516 .It Ic window-status-alert-bg Ar colour
2517 Set status line background colour for windows with an alert.
2519 .It Ic window-status-alert-fg Ar colour
2520 Set status line foreground colour for windows with an alert.
2522 .It Ic window-status-attr Ar attributes
2523 Set status line attributes for a single window.
2525 .It Ic window-status-bg Ar colour
2526 Set status line background colour for a single window.
2528 .It Ic window-status-current-attr Ar attributes
2529 Set status line attributes for the currently active window.
2531 .It Ic window-status-current-bg Ar colour
2532 Set status line background colour for the currently active window.
2534 .It Ic window-status-current-fg Ar colour
2535 Set status line foreground colour for the currently active window.
2537 .It Ic window-status-current-format Ar string
2539 .Ar window-status-format ,
2540 but is the format used when the window is the current window.
2542 .It Ic window-status-fg Ar colour
2543 Set status line foreground colour for a single window.
2545 .It Ic window-status-format Ar string
2546 Set the format in which the window is displayed in the status line window list.
2549 option for details of special character sequences available.
2553 .It Xo Ic xterm-keys
2556 If this option is set,
2560 function key sequences; these have a number included to indicate modifiers such
2561 as Shift, Alt or Ctrl.
2564 .It Xo Ic show-options
2566 .Op Fl t Ar target-session | Ar target-window
2568 .D1 (alias: Ic show )
2569 Show the window options with
2572 .Ic show-window-options ) ,
2573 the server options with
2575 otherwise the session options for
2576 .Ar target session .
2577 Global session or window options are listed if
2580 .It Xo Ic show-window-options
2582 .Op Fl t Ar target-window
2584 .D1 (alias: Ic showw )
2585 List the window options for
2587 or the global window options if
2603 This is a string which controls the output format of the command.
2604 Special character sequences are replaced as documented under the
2606 option and an additional long form is accepted.
2607 Replacement variables are enclosed in
2615 Conditionals are also accepted by prefixing with
2617 and separating two alternatives with a comma;
2618 if the specified variable exists and is not zero, the first alternative
2619 is chosen, otherwise the second is used.
2621 .Ql #{?session_attached,attached,not attached}
2622 will include the string
2624 if the session is attached and the string
2626 if it is unattached.
2628 The following variables are available, where appropriate:
2629 .Bl -column "session_created_string" "Replaced with" -offset indent
2630 .It Sy "Variable name" Ta Sy "Replaced with"
2631 .It Li "client_activity" Ta "Integer time client last had activity"
2632 .It Li "client_activity_string" Ta "String time client last had activity"
2633 .It Li "client_created" Ta "Integer time client created"
2634 .It Li "client_created_string" Ta "String time client created"
2635 .It Li "client_cwd" Ta "Working directory of client"
2636 .It Li "client_height" Ta "Height of client"
2637 .It Li "client_readonly" Ta "1 if client is readonly"
2638 .It Li "client_termname" Ta "Terminal name of client"
2639 .It Li "client_tty" Ta "Pseudo terminal of client"
2640 .It Li "client_utf8" Ta "1 if client supports utf8"
2641 .It Li "client_width" Ta "Width of client"
2642 .It Li "host" Ta "Hostname of local host"
2643 .It Li "line" Ta "Line number in the list"
2644 .It Li "pane_active" Ta "1 if active pane"
2645 .It Li "pane_dead" Ta "1 if pane is dead"
2646 .It Li "pane_height" Ta "Height of pane"
2647 .It Li "pane_id" Ta "Unique pane id"
2648 .It Li "pane_pid" Ta "PID of first process in pane"
2649 .It Li "pane_start_command" Ta "Command pane started with"
2650 .It Li "pane_start_path" Ta "Path pane started with"
2651 .It Li "pane_title" Ta "Title of pane"
2652 .It Li "pane_tty" Ta "Pseudo terminal of pane"
2653 .It Li "pane_width" Ta "Width of pane"
2654 .It Li "session_attached" Ta "1 if session attached"
2655 .It Li "session_created" Ta "Integer time session created"
2656 .It Li "session_created_string" Ta "String time session created"
2657 .It Li "session_group" Ta "Number of session group"
2658 .It Li "session_grouped" Ta "1 if session in a group"
2659 .It Li "session_height" Ta "Height of session"
2660 .It Li "session_name" Ta "Name of session"
2661 .It Li "session_width" Ta "Width of session"
2662 .It Li "session_windows" Ta "Number of windows in session"
2663 .It Li "window_active" Ta "1 if window active"
2664 .It Li "window_flags" Ta "Window flags"
2665 .It Li "window_height" Ta "Height of window"
2666 .It Li "window_index" Ta "Index of window"
2667 .It Li "window_layout" Ta "Window layout description"
2668 .It Li "window_name" Ta "Name of window"
2669 .It Li "window_width" Ta "Width of window"
2671 .Sh NAMES AND TITLES
2673 distinguishes between names and titles.
2674 Windows and sessions have names, which may be used to specify them in targets
2675 and are displayed in the status line and various lists: the name is the
2677 identifier for a window or session.
2678 Only panes have titles.
2679 A pane's title is typically set by the program running inside the pane and
2682 It is the same mechanism used to set for example the
2687 Windows themselves do not have titles - a window's title is the title of it's
2690 itself may set the title of the terminal in which the client is running, see
2695 A session's name is set with the
2700 A window's name is set with one of:
2703 A command argument (such as
2711 .Bd -literal -offset indent
2712 $ printf '\e033kWINDOW_NAME\e033\e\e'
2715 Automatic renaming, which sets the name to the active command in the window's
2718 .Ic automatic-rename
2722 When a pane is first created, its title is the hostname.
2723 A pane's title can be set via the OSC title setting sequence, for example:
2724 .Bd -literal -offset indent
2725 $ printf '\e033]2;My Title\e033\e\e'
2728 When the server is started,
2730 copies the environment into the
2731 .Em global environment ;
2732 in addition, each session has a
2733 .Em session environment .
2734 When a window is created, the session and global environments are merged.
2735 If a variable exists in both, the value from the session environment is used.
2736 The result is the initial environment passed to the new process.
2739 .Ic update-environment
2740 session option may be used to update the session environment from the client
2741 when a new session is created or an old reattached.
2743 also initialises the
2745 variable with some internal information to allow commands to be executed
2746 from inside, and the
2748 variable with the correct terminal setting of
2751 Commands to alter and view the environment are:
2753 .It Xo Ic set-environment
2755 .Op Fl t Ar target-session
2756 .Ar name Op Ar value
2758 .D1 (alias: Ic setenv )
2759 Set or unset an environment variable.
2762 is used, the change is made in the global environment; otherwise, it is applied
2763 to the session environment for
2764 .Ar target-session .
2767 flag unsets a variable.
2769 indicates the variable is to be removed from the environment before starting a
2771 .It Xo Ic show-environment
2773 .Op Fl t Ar target-session
2775 .D1 (alias: Ic showenv )
2776 Display the environment for
2778 or the global environment with
2780 Variables removed from the environment are prefixed with
2785 includes an optional status line which is displayed in the bottom line of each
2787 By default, the status line is enabled (it may be disabled with the
2789 session option) and contains, from left-to-right: the name of the current
2790 session in square brackets; the window list; the title of the active pane
2791 in double quotes; and the time and date.
2793 The status line is made of three parts: configurable left and right sections
2794 (which may contain dynamic content such as the time or output from a shell
2797 .Ic status-left-length ,
2800 .Ic status-right-length
2801 options below), and a central window list.
2802 By default, the window list shows the index, name and (if any) flag of the
2803 windows present in the current session in ascending numerical order.
2804 It may be customised with the
2805 .Ar window-status-format
2807 .Ar window-status-current-format
2809 The flag is one of the following symbols appended to the window name:
2810 .Bl -column "Symbol" "Meaning" -offset indent
2811 .It Sy "Symbol" Ta Sy "Meaning"
2812 .It Li "*" Ta "Denotes the current window."
2813 .It Li "-" Ta "Marks the last window (previously selected)."
2814 .It Li "#" Ta "Window is monitored and activity has been detected."
2815 .It Li "!" Ta "A bell has occurred in the window."
2816 .It Li "+" Ta "Window is monitored for content and it has appeared."
2817 .It Li "~" Ta "The window has been silent for the monitor-silence interval."
2820 The # symbol relates to the
2821 .Ic monitor-activity
2825 The window name is printed in inverted colours if an alert (bell, activity or
2826 content) is present.
2828 The colour and attributes of the status line may be configured, the entire
2829 status line using the
2834 session options and individual windows using the
2835 .Ic window-status-attr ,
2836 .Ic window-status-fg
2838 .Ic window-status-bg
2841 The status line is automatically refreshed at interval if it has changed, the
2842 interval may be controlled with the
2846 Commands related to the status line are as follows:
2848 .It Xo Ic command-prompt
2851 .Op Fl t Ar target-client
2854 Open the command prompt in a client.
2855 This may be used from inside
2857 to execute commands interactively.
2861 is specified, it is used as the command.
2864 is a comma-separated list of the initial text for each prompt.
2869 is a comma-separated list of prompts which are displayed in order; otherwise
2870 a single prompt is displayed, constructed from
2872 if it is present, or
2880 may contain the special character sequences supported by the
2884 Before the command is executed, the first occurrence of the string
2886 and all occurrences of
2888 are replaced by the response to the first prompt, the second
2892 are replaced with the response to the second prompt, and so on for further
2894 Up to nine prompt responses may be replaced
2900 .It Xo Ic confirm-before
2902 .Op Fl t Ar target-client
2905 .D1 (alias: Ic confirm )
2906 Ask for confirmation before executing
2912 is the prompt to display; otherwise a prompt is constructed from
2914 It may contain the special character sequences supported by the
2918 This command works only from inside
2920 .It Xo Ic display-message
2922 .Op Fl c Ar target-client
2923 .Op Fl t Ar target-pane
2926 .D1 (alias: Ic display )
2930 is given, the output is printed to stdout, otherwise it is displayed in the
2937 with the exception that #() are not handled; information is taken from
2941 is given, otherwise the active pane for the session attached to
2946 maintains a stack of
2948 Up to the value of the
2950 option are kept; when a new buffer is added, the buffer at the bottom of the
2952 Buffers may be added using
2956 command, and pasted into a window using the
2960 A configurable history buffer is also maintained for each window.
2961 By default, up to 2000 lines are kept; this can be altered with the
2967 The buffer commands are as follows:
2971 .Op Fl t Ar target-window
2974 Put a window into buffer choice mode, where a buffer may be chosen
2975 interactively from a list.
2976 After a buffer is selected,
2978 is replaced by the buffer index in
2980 and the result executed as a command.
2983 is not given, "paste-buffer -b '%%'" is used.
2984 This command works only from inside
2986 .It Ic clear-history Op Fl t Ar target-pane
2987 .D1 (alias: Ic clearhist )
2988 Remove and free the history for the specified pane.
2989 .It Ic delete-buffer Op Fl b Ar buffer-index
2990 .D1 (alias: Ic deleteb )
2991 Delete the buffer at
2993 or the top buffer if not specified.
2995 .D1 (alias: Ic lsb )
2996 List the global buffers.
2997 .It Xo Ic load-buffer
2998 .Op Fl b Ar buffer-index
3001 .D1 (alias: Ic loadb )
3002 Load the contents of the specified paste buffer from
3004 .It Xo Ic paste-buffer
3006 .Op Fl b Ar buffer-index
3007 .Op Fl s Ar separator
3008 .Op Fl t Ar target-pane
3010 .D1 (alias: Ic pasteb )
3011 Insert the contents of a paste buffer into the specified pane.
3012 If not specified, paste into the current one.
3015 also delete the paste buffer from the stack.
3016 When output, any linefeed (LF) characters in the paste buffer are replaced with
3017 a separator, by default carriage return (CR).
3018 A custom separator may be specified using the
3023 flag means to do no replacement (equivalent to a separator of LF).
3024 .It Xo Ic save-buffer
3026 .Op Fl b Ar buffer-index
3029 .D1 (alias: Ic saveb )
3030 Save the contents of the specified paste buffer to
3034 option appends to rather than overwriting the file.
3035 .It Xo Ic set-buffer
3036 .Op Fl b Ar buffer-index
3039 .D1 (alias: Ic setb )
3040 Set the contents of the specified buffer to
3042 .It Xo Ic show-buffer
3043 .Op Fl b Ar buffer-index
3045 .D1 (alias: Ic showb )
3046 Display the contents of the specified buffer.
3049 Miscellaneous commands are as follows:
3051 .It Ic clock-mode Op Fl t Ar target-pane
3052 Display a large clock.
3053 .It Ic if-shell Ar shell-command command Op Ar command
3059 returns success or the second
3063 .D1 (alias: Ic lock )
3064 Lock each client individually by running the command specified by the
3067 .It Ic run-shell Ar shell-command
3068 .D1 (alias: Ic run )
3071 in the background without creating a window.
3072 After it finishes, any output to stdout is displayed in copy mode.
3073 If the command doesn't return success, the exit status is also displayed.
3075 .D1 (alias: Ic info )
3076 Show server information and terminal details.
3078 .Sh TERMINFO EXTENSIONS
3080 understands some extensions to
3084 Set the cursor colour.
3085 The first takes a single string argument and is used to set the colour;
3086 the second takes no arguments and restores the default cursor colour.
3087 If set, a sequence such as this may be used
3088 to change the cursor colour from inside
3090 .Bd -literal -offset indent
3091 $ printf '\e033]12;red\e033\e\e'
3094 Change the cursor style.
3095 If set, a sequence such as this may be used
3096 to change the cursor to an underline:
3097 .Bd -literal -offset indent
3098 $ printf '\e033[4 q'
3103 is set, it will be used to reset the cursor style instead
3107 This sequence can be used by
3109 to store the current buffer in the host terminal's selection (clipboard).
3112 option above and the
3117 .Bl -tag -width "/etc/tmux.confXXX" -compact
3122 .It Pa /etc/tmux.conf
3123 System-wide configuration file.
3131 .Dl $ tmux new-session vi
3133 Most commands have a shorter form, known as an alias.
3134 For new-session, this is
3139 Alternatively, the shortest unambiguous form of a command is accepted.
3140 If there are several options, they are listed:
3141 .Bd -literal -offset indent
3143 ambiguous command: n, could be: new-session, new-window, next-window
3146 Within an active session, a new window may be created by typing
3156 Windows may be navigated with:
3158 (to select window 0),
3160 (to select window 1), and so on;
3162 to select the next window; and
3164 to select the previous window.
3166 A session may be detached using
3168 (or by an external event such as
3170 disconnection) and reattached with:
3172 .Dl $ tmux attach-session
3176 lists the current key bindings in the current window; up and down may be used
3177 to navigate the list or
3181 Commands to be run when the
3183 server is started may be placed in the
3186 Common examples include:
3188 Changing the default prefix key:
3189 .Bd -literal -offset indent
3190 set-option -g prefix C-a
3192 bind-key C-a send-prefix
3195 Turning the status line off, or changing its colour:
3196 .Bd -literal -offset indent
3197 set-option -g status off
3198 set-option -g status-bg blue
3201 Setting other options, such as the default command,
3202 or locking after 30 minutes of inactivity:
3203 .Bd -literal -offset indent
3204 set-option -g default-command "exec /bin/ksh"
3205 set-option -g lock-after-time 1800
3208 Creating new key bindings:
3209 .Bd -literal -offset indent
3210 bind-key b set-option status
3211 bind-key / command-prompt "split-window 'exec man %%'"
3212 bind-key S command-prompt "new-window -n %1 'ssh %1'"
3217 .An Nicholas Marriott Aq nicm@users.sourceforge.net