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 Split the current pane into two, left and right.
239 Kill the current window.
241 Prompt for a window index to select.
243 Rename the current window.
245 Delete the most recently copied buffer of text.
247 Prompt for an index to move the current window.
249 Select windows 0 to 9.
255 Move to the previously active pane.
257 Choose which buffer to paste interactively from a list.
259 List all key bindings.
261 Choose a client to detach.
263 Enter copy mode to copy text or view the history.
265 Paste the most recently copied buffer of text.
269 Detach the current client.
271 Prompt to search for text in open windows.
273 Display some information about the current window.
275 Move to the previously selected window.
277 Change to the next window.
279 Select the next pane in the current window.
281 Change to the previous window.
283 Briefly display pane indexes.
285 Force redraw of the attached client.
287 Select a new session for the attached client interactively.
289 Switch the attached client back to the last session.
293 Choose the current window interactively.
295 Kill the current pane.
297 Swap the current pane with the previous pane.
299 Swap the current pane with the next pane.
301 Show previous messages from
305 Enter copy mode and scroll one page up.
308 Change to the pane above, below, to the left, or to the right of the current
311 Arrange panes in one of the five preset layouts: even-horizontal,
312 even-vertical, main-horizontal, main-vertical, or tiled.
314 Move to the next window with a bell or activity marker.
316 Rotate the panes in the current window backwards.
318 Move to the previous window with a bell or activity marker.
321 Resize the current pane in steps of one cell.
324 Resize the current pane in steps of five cells.
327 Key bindings may be changed with the
333 This section contains a list of the commands supported by
335 Most commands accept the optional
343 These specify the client, session, window or pane which a command should affect.
347 file to which the client is connected, for example either of
351 for the client attached to
353 If no client is specified, the current client is chosen, if possible, or an
355 Clients may be listed with the
360 is either the name of a session (as listed by the
362 command) or the name of a client with the same syntax as
364 in which case the session attached to the client is used.
365 When looking for the session name,
367 initially searches for an exact match; if none is found, the session names
368 are checked for any for which
370 is a prefix or for which it matches as an
373 If a single match is found, it is used as the target session; multiple matches
375 If a session is omitted, the current session is used if available; if no
376 current session is available, the most recently used is chosen.
379 specifies a window in the form
380 .Em session Ns \&: Ns Em window .
382 follows the same rules as for
386 is looked for in order: as a window index, for example mysession:1; as an exact
387 window name, such as mysession:mywindow; then as an
389 pattern or the start of a window name, such as mysession:mywin* or
391 An empty window name specifies the next unused index if appropriate (for
397 otherwise the current window in
400 The special character
402 uses the last (previously current) window, or
406 are the next window or the previous window by number.
407 When the argument does not contain a colon,
409 first attempts to parse it as window; if that fails, an attempt is made to
413 takes a similar form to
415 but with the optional addition of a period followed by a pane index, for
416 example: mysession:mywindow.1.
417 If the pane index is omitted, the currently active pane in the specified
419 If neither a colon nor period appears,
421 first attempts to use the argument as a pane index; if that fails, it is looked
428 indicate the next or previous pane index, respectively.
438 may be used instead of a pane index.
440 The special characters
444 may be followed by an offset, for example:
445 .Bd -literal -offset indent
449 When dealing with a session that doesn't contain sequential window indexes,
450 they will be correctly skipped.
453 also gives each pane created in a server an identifier consisting of a
455 and a number, starting from zero.
456 A pane's identifier is unique for the life of the
458 server and is passed to the child process of the pane in the
460 environment variable.
461 It may be used alone to target a pane or the window containing it.
467 These must be passed as a single item, which typically means quoting them, for
469 .Bd -literal -offset indent
470 new-window 'vi /etc/passwd'
477 command, passed with the command and arguments separately, for example:
478 .Bd -literal -offset indent
479 bind-key F1 set-window-option force-width 81
484 .Bd -literal -offset indent
485 $ tmux bind-key F1 set-window-option force-width 81
488 Multiple commands may be specified together as part of a
489 .Em command sequence .
490 Each command should be separated by spaces and a semicolon;
491 commands are executed sequentially from left to right.
492 A literal semicolon may be included by escaping it with a backslash (for
493 example, when specifying a command sequence to
499 .Bd -literal -offset indent
500 refresh-client -t/dev/ttyp2
502 rename-session -tfirst newname
504 set-window-option -t:0 monitor-activity on
506 new-window ; split-window -d
511 .Bd -literal -offset indent
512 $ tmux kill-window -t :1
514 $ tmux new-window \e; split-window -d
516 $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
518 .Sh CLIENTS AND SESSIONS
521 server manages clients, sessions, windows and panes.
522 Clients are attached to sessions to interact with them, either
523 when they are created with the
525 command, or later with the
528 Each session has one or more windows
531 Windows may be linked to multiple sessions and are made up of one or
533 each of which contains a pseudo terminal.
534 Commands for creating, linking and otherwise manipulating windows
537 .Sx WINDOWS AND PANES
540 The following commands are available to manage clients and sessions:
542 .It Xo Ic attach-session
544 .Op Fl t Ar target-session
546 .D1 (alias: Ic attach )
549 create a new client in the current terminal and attach it to
551 If used from inside, switch the current client.
554 is specified, any other clients attached to the session are detached.
556 signifies the client is read-only (only keys bound to the
558 command have any effect)
560 If no server is started,
562 will attempt to start it; this will fail unless sessions are created in the
564 .It Xo Ic detach-client
566 .Op Fl t Ar target-client
568 .D1 (alias: Ic detach )
569 Detach the current client if bound to a key, or the specified client with
573 is given, send SIGHUP to the parent process of the client, typically causing it
575 .It Ic has-session Op Fl t Ar target-session
577 Report an error and exit with 1 if the specified session does not exist.
578 If it does exist, exit with 0.
582 server and clients and destroy all sessions.
583 .It Ic kill-session Op Fl t Ar target-session
584 Destroy the given session, closing any windows linked to it and no other
585 sessions, and detaching all clients attached to it.
588 List all clients attached to the server.
590 .D1 (alias: Ic lscm )
591 List the syntax of all commands supported by
595 List all sessions managed by the server.
596 .It Ic lock-client Op Fl t Ar target-client
597 .D1 (alias: Ic lockc )
603 .It Ic lock-session Op Fl t Ar target-session
604 .D1 (alias: Ic locks )
605 Lock all clients attached to
607 .It Xo Ic new-session
609 .Op Fl n Ar window-name
610 .Op Fl s Ar session-name
611 .Op Fl t Ar target-session
617 Create a new session with name
620 The new session is attached to the current terminal unless
626 are the name of and shell command to execute in the initial window.
633 specify the size of the initial window (80 by 24 if not given).
635 If run from a terminal, any
637 special characters are saved and used for new windows in the new session.
641 is given, the new session is
645 This means they share the same set of windows - all windows from
647 are linked to the new session and any subsequent new windows or windows being
648 closed are applied to both sessions.
649 The current and previous window and any session options remain independent and
650 either session may be killed without affecting the other.
658 .It Ic refresh-client Op Fl t Ar target-client
659 .D1 (alias: Ic refresh )
660 Refresh the current client if bound to a key, or a single client if one is given
663 .It Xo Ic rename-session
664 .Op Fl t Ar target-session
667 .D1 (alias: Ic rename )
668 Rename the session to
670 .It Xo Ic show-messages
671 .Op Fl t Ar target-client
673 .D1 (alias: Ic showmsgs )
674 Any messages displayed on the status line are saved in a per-client message
675 log, up to a maximum of the limit set by the
677 session option for the session attached to that client.
678 This command displays the log for
680 .It Ic source-file Ar path
681 .D1 (alias: Ic source )
682 Execute commands from
685 .D1 (alias: Ic start )
688 server, if not already running, without creating any sessions.
689 .It Xo Ic suspend-client
690 .Op Fl t Ar target-client
692 .D1 (alias: Ic suspendc )
693 Suspend a client by sending
696 .It Xo Ic switch-client
698 .Op Fl c Ar target-client
699 .Op Fl t Ar target-session
701 .D1 (alias: Ic switchc )
702 Switch the current session for client
711 is used, the client is moved to the last, next or previous session
714 .Sh WINDOWS AND PANES
717 window may be in one of several modes.
718 The default permits direct access to the terminal attached to the window.
719 The other is copy mode, which permits a section of a window or its
720 history to be copied to a
722 for later insertion into another window.
723 This mode is entered with the
728 It is also entered when a command that produces output, such as
730 is executed from a key binding.
732 The keys available depend on whether emacs or vi mode is selected
736 The following keys are supported as appropriate for the mode:
737 .Bl -column "FunctionXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
738 .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
739 .It Li "Back to indentation" Ta "^" Ta "M-m"
740 .It Li "Bottom of history" Ta "G" Ta "M-<"
741 .It Li "Clear selection" Ta "Escape" Ta "C-g"
742 .It Li "Copy selection" Ta "Enter" Ta "M-w"
743 .It Li "Cursor down" Ta "j" Ta "Down"
744 .It Li "Cursor left" Ta "h" Ta "Left"
745 .It Li "Cursor right" Ta "l" Ta "Right"
746 .It Li "Cursor to bottom line" Ta "L" Ta ""
747 .It Li "Cursor to middle line" Ta "M" Ta "M-r"
748 .It Li "Cursor to top line" Ta "H" Ta "M-R"
749 .It Li "Cursor up" Ta "k" Ta "Up"
750 .It Li "Delete entire line" Ta "d" Ta "C-u"
751 .It Li "Delete to end of line" Ta "D" Ta "C-k"
752 .It Li "End of line" Ta "$" Ta "C-e"
753 .It Li "Go to line" Ta ":" Ta "g"
754 .It Li "Half page down" Ta "C-d" Ta "M-Down"
755 .It Li "Half page up" Ta "C-u" Ta "M-Up"
756 .It Li "Jump forward" Ta "f" Ta "f"
757 .It Li "Jump backward" Ta "F" Ta "F"
758 .It Li "Jump again" Ta ";" Ta ";"
759 .It Li "Jump again in reverse" Ta "," Ta ","
760 .It Li "Next page" Ta "C-f" Ta "Page down"
761 .It Li "Next space" Ta "W" Ta ""
762 .It Li "Next space, end of word" Ta "E" Ta ""
763 .It Li "Next word" Ta "w" Ta ""
764 .It Li "Next word end" Ta "e" Ta "M-f"
765 .It Li "Paste buffer" Ta "p" Ta "C-y"
766 .It Li "Previous page" Ta "C-b" Ta "Page up"
767 .It Li "Previous word" Ta "b" Ta "M-b"
768 .It Li "Previous space" Ta "B" Ta ""
769 .It Li "Quit mode" Ta "q" Ta "Escape"
770 .It Li "Rectangle toggle" Ta "v" Ta "R"
771 .It Li "Scroll down" Ta "C-Down or C-e" Ta "C-Down"
772 .It Li "Scroll up" Ta "C-Up or C-y" Ta "C-Up"
773 .It Li "Search again" Ta "n" Ta "n"
774 .It Li "Search again in reverse" Ta "N" Ta "N"
775 .It Li "Search backward" Ta "?" Ta "C-r"
776 .It Li "Search forward" Ta "/" Ta "C-s"
777 .It Li "Start of line" Ta "0" Ta "C-a"
778 .It Li "Start selection" Ta "Space" Ta "C-Space"
779 .It Li "Top of history" Ta "g" Ta "M->"
780 .It Li "Transpose chars" Ta "" Ta "C-t"
783 The next and previous word keys use space and the
788 characters as word delimiters by default, but this can be adjusted by
792 Next word moves to the start of the next word, next word end to the end of the
793 next word and previous word to the start of the previous word.
794 The three next and previous space keys work similarly but use a space alone as
797 The jump commands enable quick movement within a line.
802 will move the cursor to the next
804 character on the current line.
807 will then jump to the next occurrence.
809 Commands in copy mode may be prefaced by an optional repeat count.
810 With vi key bindings, a prefix is entered using the number keys; with
811 emacs, the Alt (meta) key and a number begins prefix entry.
812 For example, to move the cursor forward by ten words, use
818 Mode key bindings are defined in a set of named tables:
822 for keys used when line editing at the command prompt;
826 for keys used when choosing from lists (such as produced by the
833 The tables may be viewed with the
835 command and keys modified or removed with
840 The paste buffer key pastes the first line from the top paste buffer on the
849 .Op Fl t Ar target-pane
854 option scrolls one page up.
857 Each window displayed by
859 may be split into one or more
861 each pane takes up a certain area of the display and is a separate terminal.
862 A window may be split into panes using the
865 Windows may be split horizontally (with the
868 Panes may be resized with the
876 by default), the current pane may be changed with the
882 commands may be used to swap panes without changing their position.
883 Panes are numbered beginning from zero in the order they are created.
888 These may be selected with the
890 command or cycled with
894 by default); once a layout is chosen, panes within it may be moved and resized
897 The following layouts are supported:
899 .It Ic even-horizontal
900 Panes are spread out evenly from left to right across the window.
902 Panes are spread evenly from top to bottom.
903 .It Ic main-horizontal
904 A large (main) pane is shown at the top of the window and the remaining panes
905 are spread from left to right in the leftover space at the bottom.
908 window option to specify the height of the top pane.
912 but the large pane is placed on the left and the others spread from top to
913 bottom along the right.
918 Panes are spread out as evenly as possible over the window in both rows and
924 may be used to apply a previously used layout - the
926 command displays the layout of each window in a form suitable for use with
929 .Bd -literal -offset indent
932 layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
933 $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
937 automatically adjusts the size of the layout for the current window size.
938 Note that a layout cannot be applied to a window with more panes than that
939 from which the layout was originally defined.
941 Commands related to windows and panes are as follows:
945 .Op Fl t Ar target-pane
947 .D1 (alias: Ic breakp )
950 off from its containing window to make it the only pane in a new window.
953 is given, the new window does not become the current window.
954 .It Xo Ic capture-pane
955 .Op Fl b Ar buffer-index
957 .Op Fl S Ar start-line
958 .Op Fl t Ar target-pane
960 .D1 (alias: Ic capturep )
961 Capture the contents of a pane to the specified buffer, or a new buffer if none
967 specify the starting and ending line numbers, zero is the first line of the
968 visible pane and negative numbers are lines in the history.
969 The default is to capture only the visible contents of the pane.
972 .Op Fl t Ar target-window
975 Put a window into client choice mode, allowing a client to be selected
976 interactively from a list.
977 After a client is chosen,
979 is replaced by the client
983 and the result executed as a command.
986 is not given, "detach-client -t '%%'" is used.
987 This command works only from inside
991 .Op Fl t Ar target-window
994 Put a window into session choice mode, where a session may be selected
995 interactively from a list.
998 is replaced by the session name in
1000 and the result executed as a command.
1003 is not given, "switch-client -t '%%'" is used.
1004 This command works only from inside
1008 .Op Fl t Ar target-window
1011 Put a window into window choice mode, where a window may be chosen
1012 interactively from a list.
1013 After a window is selected,
1015 is replaced by the session name and window index in
1017 and the result executed as a command.
1020 is not given, "select-window -t '%%'" is used.
1021 This command works only from inside
1023 .It Ic display-panes Op Fl t Ar target-client
1024 .D1 (alias: Ic displayp)
1025 Display a visible indicator of each pane shown by
1028 .Ic display-panes-time ,
1029 .Ic display-panes-colour ,
1031 .Ic display-panes-active-colour
1033 While the indicator is on screen, a pane may be selected with the
1038 .It Xo Ic find-window
1039 .Op Fl t Ar target-window
1042 .D1 (alias: Ic findw )
1047 in window names, titles, and visible content (but not history).
1048 If only one window is matched, it'll be automatically selected, otherwise a
1049 choice list is shown.
1050 This command only works from inside
1056 .Fl p Ar percentage Oc
1057 .Op Fl s Ar src-pane
1058 .Op Fl t Ar dst-pane
1060 .D1 (alias: Ic joinp )
1063 but instead of splitting
1065 and creating a new pane, split it and move
1068 This can be used to reverse
1072 .Op Fl t Ar target-pane
1074 .D1 (alias: Ic killp )
1075 Destroy the given pane.
1076 If no panes remain in the containing window, it is also destroyed.
1079 option kills all but the pane given with
1081 .It Ic kill-window Op Fl t Ar target-window
1082 .D1 (alias: Ic killw )
1083 Kill the current window or the window at
1085 removing it from any sessions to which it is linked.
1086 .It Ic last-pane Op Fl t Ar target-window
1087 .D1 (alias: Ic lastp )
1088 Select the last (previously selected) pane.
1089 .It Ic last-window Op Fl t Ar target-session
1090 .D1 (alias: Ic last )
1091 Select the last (previously selected) window.
1094 is specified, select the last window of the current session.
1095 .It Xo Ic link-window
1097 .Op Fl s Ar src-window
1098 .Op Fl t Ar dst-window
1100 .D1 (alias: Ic linkw )
1107 is specified and no such window exists, the
1114 exists, it is killed, otherwise an error is generated.
1117 is given, the newly linked window is not selected.
1118 .It Xo Ic list-panes
1122 .D1 (alias: Ic lsp )
1127 is ignored and all panes on the server are listed.
1132 is a session (or the current session).
1133 If neither is given,
1135 is a window (or the current window).
1136 .It Xo Ic list-windows
1138 .Op Fl t Ar target-session
1140 .D1 (alias: Ic lsw )
1143 is given, list all windows on the server.
1144 Otherwise, list windows in the current session or in
1145 .Ar target-session .
1146 .It Xo Ic move-window
1148 .Op Fl s Ar src-window
1149 .Op Fl t Ar dst-window
1151 .D1 (alias: Ic movew )
1154 except the window at
1158 .It Xo Ic new-window
1160 .Op Fl n Ar window-name
1161 .Op Fl t Ar target-window
1162 .Op Ar shell-command
1164 .D1 (alias: Ic neww )
1165 Create a new window.
1168 the new window is inserted at the next index up from the specified
1170 moving windows up if necessary,
1173 is the new window location.
1177 is given, the session does not make the new window the current window.
1179 represents the window to be created; if the target already exists an error is
1182 flag is used, in which case it is destroyed.
1184 is the command to execute.
1187 is not specified, the value of the
1191 When the shell command completes, the window closes.
1194 option to change this behaviour.
1198 environment variable must be set to
1200 for all programs running
1203 New windows will automatically have
1205 added to their environment, but care must be taken not to reset this in shell
1210 option prints the location of the new window after it has been created.
1211 .It Ic next-layout Op Fl t Ar target-window
1212 .D1 (alias: Ic nextl )
1213 Move a window to the next layout and rearrange the panes to fit.
1214 .It Xo Ic next-window
1216 .Op Fl t Ar target-session
1218 .D1 (alias: Ic next )
1219 Move to the next window in the session.
1222 is used, move to the next window with a bell, activity or content alert.
1225 .Op Fl t Ar target-pane
1226 .Op Ar shell-command
1228 .D1 (alias: Ic pipep )
1229 Pipe any output sent by the program in
1232 A pane may only be piped to one command at a time, any existing pipe is
1238 string may contain the special character sequences supported by the
1243 is given, the current pipe (if any) is closed.
1247 option only opens a new pipe if no previous pipe exists, allowing a pipe to
1248 be toggled with a single key, for example:
1249 .Bd -literal -offset indent
1250 bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1252 .It Xo Ic previous-layout
1253 .Op Fl t Ar target-window
1255 .D1 (alias: Ic prevl )
1256 Move to the previous layout in the session.
1257 .It Xo Ic previous-window
1259 .Op Fl t Ar target-session
1261 .D1 (alias: Ic prev )
1262 Move to the previous window in the session.
1265 move to the previous window with a bell, activity or content alert.
1266 .It Xo Ic rename-window
1267 .Op Fl t Ar target-window
1270 .D1 (alias: Ic renamew )
1271 Rename the current window, or the window at
1275 .It Xo Ic resize-pane
1277 .Op Fl t Ar target-pane
1280 .D1 (alias: Ic resizep )
1281 Resize a pane, upward with
1283 (the default), downward with
1287 and to the right with
1291 is given in lines or cells (the default is 1).
1292 .It Xo Ic respawn-window
1294 .Op Fl t Ar target-window
1295 .Op Ar shell-command
1297 .D1 (alias: Ic respawnw )
1298 Reactivate a window in which the command has exited (see the
1303 is not given, the command used when the window was created is executed.
1304 The window must be already inactive, unless
1306 is given, in which case any existing command is killed.
1307 .It Xo Ic rotate-window
1309 .Op Fl t Ar target-window
1311 .D1 (alias: Ic rotatew )
1312 Rotate the positions of the panes within a window, either upward (numerically
1315 or downward (numerically higher).
1316 .It Xo Ic select-layout
1318 .Op Fl t Ar target-window
1321 .D1 (alias: Ic selectl )
1322 Choose a specific layout for a window.
1325 is not given, the last preset layout used (if any) is reapplied.
1329 are equivalent to the
1334 .It Xo Ic select-pane
1336 .Op Fl t Ar target-pane
1338 .D1 (alias: Ic selectp )
1341 the active pane in window
1349 is used, respectively the pane below, to the left, to the right, or above the
1350 target pane is used.
1352 is the same as using the
1355 .It Xo Ic select-window
1357 .Op Fl t Ar target-window
1359 .D1 (alias: Ic selectw )
1360 Select the window at
1366 are equivalent to the
1372 .It Xo Ic split-window
1376 .Fl p Ar percentage Oc
1377 .Op Fl t Ar target-pane
1378 .Op Ar shell-command
1380 .D1 (alias: Ic splitw )
1381 Create a new pane by splitting
1384 does a horizontal split and
1386 a vertical split; if neither is specified,
1393 options specify the size of the new pane in lines (for vertical split) or in
1394 cells (for horizontal split), or as a percentage, respectively.
1395 All other options have the same meaning as for the
1400 .Op Fl s Ar src-pane
1401 .Op Fl t Ar dst-pane
1403 .D1 (alias: Ic swapp )
1407 is used and no source pane is specified with
1410 is swapped with the previous pane (before it numerically);
1412 swaps with the next pane (after it numerically).
1416 not to change the active pane.
1417 .It Xo Ic swap-window
1419 .Op Fl s Ar src-window
1420 .Op Fl t Ar dst-window
1422 .D1 (alias: Ic swapw )
1425 except the source and destination windows are swapped.
1426 It is an error if no window exists at
1428 .It Xo Ic unlink-window
1430 .Op Fl t Ar target-window
1432 .D1 (alias: Ic unlinkw )
1437 is given, a window may be unlinked only if it is linked to multiple sessions -
1438 windows may not be linked to no sessions;
1441 is specified and the window is linked to only one session, it is unlinked and
1446 allows a command to be bound to most keys, with or without a prefix key.
1447 When specifying keys, most represent themselves (for example
1451 Ctrl keys may be prefixed with
1457 In addition, the following special key names are accepted:
1482 Note that to bind the
1486 keys, quotation marks are necessary, for example:
1487 .Bd -literal -offset indent
1488 bind-key '"' split-window
1489 bind-key "'" new-window
1492 Commands related to key bindings are as follows:
1496 .Op Fl t Ar key-table
1497 .Ar key Ar command Op Ar arguments
1499 .D1 (alias: Ic bind )
1506 the primary key bindings are modified (those normally activated with the prefix
1507 key); in this case, if
1509 is specified, it is not necessary to use the prefix key,
1516 flag indicates this key may repeat, see the
1526 the binding for command mode with
1528 or for normal mode without.
1529 To view the default bindings and possible commands, see the
1532 .It Ic list-keys Op Fl t Ar key-table
1533 .D1 (alias: Ic lsk )
1534 List all key bindings.
1537 the primary key bindings - those executed when preceded by the prefix key -
1539 Keys bound without the prefix key (see
1549 are listed; this may be one of:
1558 .Op Fl t Ar target-pane
1561 .D1 (alias: Ic send )
1562 Send a key or keys to a window.
1565 is the name of the key (such as
1569 ) to send; if the string is not recognised as a key, it is sent as a series of
1571 All arguments are sent sequentially from first to last.
1572 .It Ic send-prefix Op Fl t Ar target-pane
1573 Send the prefix key to a window as if it was pressed.
1574 If multiple prefix keys are configured, only the first is sent.
1575 .It Xo Ic unbind-key
1577 .Op Fl t Ar key-table
1580 .D1 (alias: Ic unbind )
1581 Unbind the command bound to
1585 the primary key bindings are modified; in this case, if
1587 is specified, the command bound to
1589 without a prefix (if any) is removed.
1592 is present, all key bindings are removed.
1600 is unbound: the binding for command mode with
1602 or for normal mode without.
1605 The appearance and behaviour of
1607 may be modified by changing the value of various options.
1608 There are three types of option:
1609 .Em server options ,
1612 .Em window options .
1616 server has a set of global options which do not apply to any particular
1618 These are altered with the
1621 command, or displayed with the
1626 In addition, each individual session may have a set of session options, and
1627 there is a separate set of global session options.
1628 Sessions which do not have a particular option configured inherit the value
1629 from the global session options.
1630 Session options are set or unset with the
1632 command and may be listed with the
1635 The available server and session options are listed under the
1639 Similarly, a set of window options is attached to each window, and there is
1640 a set of global window options from which any unset options are inherited.
1641 Window options are altered with the
1642 .Ic set-window-option
1643 command and can be listed with the
1644 .Ic show-window-options
1646 All window options are documented with the
1647 .Ic set-window-option
1650 Commands which set options are as follows:
1652 .It Xo Ic set-option
1654 .Op Fl t Ar target-session | Ar target-window
1657 .D1 (alias: Ic set )
1658 Set a window option with
1661 .Ic set-window-option
1663 a server option with
1665 otherwise a session option.
1669 is specified, the global session or window option is set.
1672 and if the option expects a string,
1674 is appended to the existing setting.
1677 flag unsets an option, so a session inherits the option from the global
1679 It is not possible to unset a global option.
1681 Available window options are listed under
1682 .Ic set-window-option .
1684 Available server options are:
1686 .It Ic buffer-limit Ar number
1687 Set the number of buffers; as new buffers are added to the top of the stack,
1688 old ones are removed from the bottom if necessary to maintain this maximum
1690 .It Ic escape-time Ar time
1691 Set the time in milliseconds for which
1693 waits after an escape is input to determine if it is part of a function or meta
1695 The default is 500 milliseconds.
1696 .It Xo Ic exit-unattached
1699 If enabled, the server will exit when there are no attached clients.
1703 Enable or disable the display of various informational messages (see also the
1708 Available session options are:
1710 .It Ic base-index Ar index
1711 Set the base index from which an unused index should be searched when a new
1713 The default is zero.
1714 .It Xo Ic bell-action
1715 .Op Ic any | none | current
1717 Set action on window bell.
1719 means a bell in any window linked to a session causes a bell in the current
1720 window of that session,
1722 means all bells are ignored and
1724 means only bell in windows other than the current window are ignored.
1725 .It Ic default-command Ar shell-command
1726 Set the command used for new windows (if not specified when the window is
1732 The default is an empty string, which instructs
1734 to create a login shell using the value of the
1737 .It Ic default-path Ar path
1738 Set the default working directory for processes created from keys, or
1739 interactively from the prompt.
1740 The default is empty, which means to use the working directory of the shell
1741 from which the server was started if it is available or the user's home if not.
1742 .It Ic default-shell Ar path
1743 Specify the default shell.
1744 This is used as the login shell for new windows when the
1746 option is set to empty, and must be the full path of the executable.
1749 tries to set a default value from the first suitable of the
1751 environment variable, the shell returned by
1755 This option should be configured when
1757 is used as a login shell.
1758 .It Ic default-terminal Ar terminal
1759 Set the default terminal for new windows created in this session - the
1760 default value of the
1762 environment variable.
1765 to work correctly, this
1769 or a derivative of it.
1770 .It Xo Ic destroy-unattached
1773 If enabled and the session is no longer attached to any clients, it is
1775 .It Xo Ic detach-on-destroy
1778 If on (the default), the client is detached when the session it is attached to
1780 If off, the client is switched to the most recently active of the remaining
1782 .It Ic display-panes-active-colour Ar colour
1783 Set the colour used by the
1785 command to show the indicator for the active pane.
1786 .It Ic display-panes-colour Ar colour
1787 Set the colour used by the
1789 command to show the indicators for inactive panes.
1790 .It Ic display-panes-time Ar time
1791 Set the time in milliseconds for which the indicators shown by the
1794 .It Ic display-time Ar time
1795 Set the amount of time for which status line messages and other on-screen
1796 indicators are displayed.
1799 .It Ic history-limit Ar lines
1800 Set the maximum number of lines held in window history.
1801 This setting applies only to new windows - existing window histories are not
1802 resized and retain the limit at the point they were created.
1803 .It Ic lock-after-time Ar number
1804 Lock the session (like the
1808 seconds of inactivity, or the entire server (all sessions) if the
1811 The default is not to lock (set to 0).
1812 .It Ic lock-command Ar shell-command
1813 Command to run when locking each client.
1814 The default is to run
1818 .It Xo Ic lock-server
1824 instead of each session locking individually as each has been
1826 .Ic lock-after-time ,
1827 the entire server will lock after
1829 sessions would have locked.
1830 This has no effect as a session option; it must be set as a global option.
1831 .It Ic message-attr Ar attributes
1832 Set status line message attributes, where
1836 or a comma-delimited list of one or more of:
1847 .It Ic message-bg Ar colour
1848 Set status line message background colour, where
1862 from the 256-colour set,
1864 or a hexadecimal RGB string such as
1866 which chooses the closest match from the default 256-colour set.
1867 .It Ic message-fg Ar colour
1868 Set status line message foreground colour.
1869 .It Ic message-limit Ar number
1870 Set the number of error or information messages to save in the message log for
1873 .It Xo Ic mouse-select-pane
1878 captures the mouse and when a window is split into multiple panes the mouse may
1879 be used to select the current pane.
1880 The mouse click is also passed through to the application as normal.
1881 .It Ic pane-active-border-bg Ar colour
1882 .It Ic pane-active-border-fg Ar colour
1883 Set the pane border colour for the currently active pane.
1884 .It Ic pane-border-bg Ar colour
1885 .It Ic pane-border-fg Ar colour
1886 Set the pane border colour for panes aside from the active pane.
1887 .It Ic prefix Ar keys
1888 Set the keys accepted as a prefix key.
1890 is a comma-separated list of key names, each of which individually behave as
1892 .It Ic repeat-time Ar time
1893 Allow multiple commands to be entered without pressing the prefix-key again
1896 milliseconds (the default is 500).
1897 Whether a key repeats may be set when it is bound using the
1901 Repeat is enabled for the default keys bound to the
1904 .It Xo Ic mouse-utf8
1907 If enabled, request mouse input as UTF-8 on UTF-8 terminals.
1908 .It Xo Ic set-remain-on-exit
1913 window option for any windows first created in this session.
1914 When this option is true, windows in which the running program has
1915 exited do not close, instead remaining open but inactivate.
1918 command to reactivate such a window, or the
1920 command to destroy it.
1921 .It Xo Ic set-titles
1924 Attempt to set the window title using the \ee]2;...\e007 xterm code if
1925 the terminal appears to be an xterm.
1926 This option is off by default.
1928 will only attempt to set the window title if the STY environment
1930 .It Ic set-titles-string Ar string
1931 String used to set the window title if
1934 Character sequences are replaced as for the
1940 Show or hide the status line.
1941 .It Ic status-attr Ar attributes
1942 Set status line attributes.
1943 .It Ic status-bg Ar colour
1944 Set status line background colour.
1945 .It Ic status-fg Ar colour
1946 Set status line foreground colour.
1947 .It Ic status-interval Ar interval
1948 Update the status bar every
1951 By default, updates will occur every 15 seconds.
1952 A setting of zero disables redrawing at interval.
1953 .It Xo Ic status-justify
1954 .Op Ic left | centre | right
1956 Set the position of the window list component of the status line: left, centre
1958 .It Xo Ic status-keys
1961 Use vi or emacs-style
1962 key bindings in the status line, for example at the command prompt.
1963 The default is emacs, unless the
1967 environment variables are set and contain the string
1969 .It Ic status-left Ar string
1972 to the left of the status bar.
1974 will be passed through
1977 By default, the session name is shown.
1979 may contain any of the following special character sequences:
1980 .Bl -column "Character pair" "Replaced with" -offset indent
1981 .It Sy "Character pair" Ta Sy "Replaced with"
1982 .It Li "#(shell-command)" Ta "First line of the command's output"
1983 .It Li "#[attributes]" Ta "Colour or attribute change"
1984 .It Li "#H" Ta "Hostname of local host"
1985 .It Li "#F" Ta "Current window flag"
1986 .It Li "#I" Ta "Current window index"
1987 .It Li "#P" Ta "Current pane index"
1988 .It Li "#S" Ta "Session name"
1989 .It Li "#T" Ta "Current window title"
1990 .It Li "#W" Ta "Current window name"
1991 .It Li "##" Ta "A literal" Ql #
1994 The #(shell-command) form executes
1996 and inserts the first line of its output.
1997 Note that shell commands are only executed once at the interval specified by
2000 option: if the status line is redrawn in the meantime, the previous result is
2002 Shell commands are executed with the
2004 global environment set (see the
2008 The window title (#T) is the title set by the program running within the window
2009 using the OSC title setting sequence, for example:
2010 .Bd -literal -offset indent
2011 $ printf '\e033]2;My Title\e033\e\e'
2014 When a window is first created, its title is the hostname.
2016 #[attributes] allows a comma-separated list of attributes to be specified,
2019 to set the foreground colour,
2021 to set the background colour, the name of one of the attributes (listed under
2024 option) to turn an attribute on, or an attribute prefixed with
2026 to turn one off, for example
2029 .Bd -literal -offset indent
2030 #(sysctl vm.loadavg)
2031 #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
2034 Where appropriate, special character sequences may be prefixed with a number to
2035 specify the maximum length, for example
2038 By default, UTF-8 in
2040 is not interpreted, to enable UTF-8, use the
2043 .It Ic status-left-attr Ar attributes
2044 Set the attribute of the left part of the status line.
2045 .It Ic status-left-bg Ar colour
2046 Set the background colour of the left part of the status line.
2047 .It Ic status-left-fg Ar colour
2048 Set the foreground colour of the left part of the status line.
2049 .It Ic status-left-length Ar length
2052 of the left component of the status bar.
2054 .It Ic status-right Ar string
2057 to the right of the status bar.
2058 By default, the current window title in double quotes, the date and the time
2065 character pairs are replaced, and UTF-8 is dependent on the
2068 .It Ic status-right-attr Ar attributes
2069 Set the attribute of the right part of the status line.
2070 .It Ic status-right-bg Ar colour
2071 Set the background colour of the right part of the status line.
2072 .It Ic status-right-fg Ar colour
2073 Set the foreground colour of the right part of the status line.
2074 .It Ic status-right-length Ar length
2077 of the right component of the status bar.
2079 .It Xo Ic status-utf8
2084 to treat top-bit-set characters in the
2088 strings as UTF-8; notably, this is important for wide characters.
2089 This option defaults to off.
2090 .It Ic terminal-overrides Ar string
2091 Contains a list of entries which override terminal descriptions read using
2094 is a comma-separated list of items each a colon-separated string made up of a
2095 terminal type pattern (matched using
2101 For example, to set the
2106 for all terminal types and the
2112 terminal type, the option could be set to the string:
2113 .Bd -literal -offset indent
2114 "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
2117 The terminal entry value is passed through
2119 before interpretation.
2120 The default value forcibly corrects the
2122 entry for terminals which support 88 or 256 colours:
2123 .Bd -literal -offset indent
2124 "*88col*:colors=88,*256col*:colors=256"
2126 .It Ic update-environment Ar variables
2127 Set a space-separated string containing a list of environment variables to be
2128 copied into the session environment when a new session is created or an
2129 existing session is attached.
2130 Any variables that do not exist in the source environment are set to be
2131 removed from the session environment (as if
2137 "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID
2139 .It Xo Ic visual-activity
2142 If on, display a status line message when activity occurs in a window
2144 .Ic monitor-activity
2145 window option is enabled.
2146 .It Xo Ic visual-bell
2149 If this option is on, a message is shown on a bell instead of it being passed
2150 through to the terminal (which normally makes a sound).
2154 .It Xo Ic visual-content
2158 .Ic visual-activity ,
2159 display a message when content is present in a window
2162 window option is enabled.
2163 .It Xo Ic visual-silence
2168 is enabled, prints a message after the interval has expired on a given window.
2170 .It Xo Ic set-window-option
2172 .Op Fl t Ar target-window
2175 .D1 (alias: Ic setw )
2176 Set a window option.
2182 flags work similarly to the
2186 Supported window options are:
2188 .Bl -tag -width Ds -compact
2189 .It Xo Ic aggressive-resize
2192 Aggressively resize the chosen window.
2195 will resize the window to the size of the smallest session for which it is the
2196 current window, rather than the smallest session to which it is attached.
2197 The window may resize when the current window is changed on another sessions;
2198 this option is good for full-screen programs which support
2200 and poor for interactive programs such as shells.
2202 .It Xo Ic alternate-screen
2205 This option configures whether programs running inside
2207 may use the terminal alternate screen feature, which allows the
2213 The alternate screen feature preserves the contents of the window when an
2214 interactive application starts and restores it on exit, so that any output
2215 visible before the application starts reappears unchanged after it exits.
2218 .It Xo Ic automatic-rename
2221 Control automatic window renaming.
2222 When this setting is enabled,
2224 will attempt - on supported platforms - to rename the window to reflect the
2225 command currently running in it.
2226 This flag is automatically disabled for an individual window when a name
2227 is specified at creation with
2233 It may be switched off globally with:
2234 .Bd -literal -offset indent
2235 set-window-option -g automatic-rename off
2238 .It Ic clock-mode-colour Ar colour
2241 .It Xo Ic clock-mode-style
2244 Set clock hour format.
2246 .It Ic force-height Ar height
2247 .It Ic force-width Ar width
2250 from resizing a window to greater than
2254 A value of zero restores the default unlimited setting.
2256 .It Ic main-pane-height Ar height
2257 .It Ic main-pane-width Ar width
2258 Set the width or height of the main (left or top) pane in the
2264 .It Ic mode-attr Ar attributes
2265 Set window modes attributes.
2267 .It Ic mode-bg Ar colour
2268 Set window modes background colour.
2270 .It Ic mode-fg Ar colour
2271 Set window modes foreground colour.
2276 Use vi or emacs-style key bindings in copy and choice modes.
2279 option, the default is emacs, unless
2286 .It Xo Ic mode-mouse
2289 Mouse state in modes.
2290 If on, the mouse may be used to copy a selection by dragging in copy mode, or
2291 to select an option in choice mode.
2293 .It Xo Ic monitor-activity
2296 Monitor for activity in the window.
2297 Windows with activity are highlighted in the status line.
2299 .It Ic monitor-content Ar match-string
2300 Monitor content in the window.
2305 appears in the window, it is highlighted in the status line.
2307 .It Xo Ic monitor-silence
2310 Monitor for silence (no activity) in the window within
2313 Windows that have been silent for the interval are highlighted in the
2315 An interval of zero disables the monitoring.
2317 .It Ic other-pane-height Ar height
2318 Set the height of the other panes (not the main pane) in the
2321 If this option is set to 0 (the default), it will have no effect.
2323 .Ic main-pane-height
2325 .Ic other-pane-height
2326 options are set, the main pane will grow taller to make the other panes the
2327 specified height, but will never shrink to do so.
2329 .It Ic other-pane-width Ar width
2331 .Ic other-pane-height ,
2332 but set the width of other panes in the
2336 .It Xo Ic remain-on-exit
2339 A window with this flag set is not destroyed when the program running in it
2341 The window may be reactivated with the
2345 .It Xo Ic synchronize-panes
2348 Duplicate input to any pane to all other panes in the same window (only
2349 for panes that are not in any special mode).
2356 to expect UTF-8 sequences to appear in this window.
2358 .It Ic window-status-attr Ar attributes
2359 Set status line attributes for a single window.
2361 .It Ic window-status-bg Ar colour
2362 Set status line background colour for a single window.
2364 .It Ic window-status-fg Ar colour
2365 Set status line foreground colour for a single window.
2367 .It Ic window-status-format Ar string
2368 Set the format in which the window is displayed in the status line window list.
2371 option for details of special character sequences available.
2375 .It Ic window-status-alert-attr Ar attributes
2376 Set status line attributes for windows which have an alert (bell, activity
2379 .It Ic window-status-alert-bg Ar colour
2380 Set status line background colour for windows with an alert.
2382 .It Ic window-status-alert-fg Ar colour
2383 Set status line foreground colour for windows with an alert.
2385 .It Ic window-status-current-attr Ar attributes
2386 Set status line attributes for the currently active window.
2388 .It Ic window-status-current-bg Ar colour
2389 Set status line background colour for the currently active window.
2391 .It Ic window-status-current-fg Ar colour
2392 Set status line foreground colour for the currently active window.
2394 .It Ic window-status-current-format Ar string
2396 .Ar window-status-format ,
2397 but is the format used when the window is the current window.
2399 .It Ic word-separators Ar string
2400 Sets the window's conception of what characters are considered word
2401 separators, for the purposes of the next and previous word commands in
2406 .It Xo Ic xterm-keys
2409 If this option is set,
2413 function key sequences; these have a number included to indicate modifiers such
2414 as Shift, Alt or Ctrl.
2417 .It Xo Ic show-options
2419 .Op Fl t Ar target-session | Ar target-window
2421 .D1 (alias: Ic show )
2422 Show the window options with
2425 .Ic show-window-options ) ,
2426 the server options with
2428 otherwise the session options for
2429 .Ar target session .
2430 Global session or window options are listed if
2433 .It Xo Ic show-window-options
2435 .Op Fl t Ar target-window
2437 .D1 (alias: Ic showw )
2438 List the window options for
2440 or the global window options if
2445 When the server is started,
2447 copies the environment into the
2448 .Em global environment ;
2449 in addition, each session has a
2450 .Em session environment .
2451 When a window is created, the session and global environments are merged.
2452 If a variable exists in both, the value from the session environment is used.
2453 The result is the initial environment passed to the new process.
2456 .Ic update-environment
2457 session option may be used to update the session environment from the client
2458 when a new session is created or an old reattached.
2460 also initialises the
2462 variable with some internal information to allow commands to be executed
2463 from inside, and the
2465 variable with the correct terminal setting of
2468 Commands to alter and view the environment are:
2470 .It Xo Ic set-environment
2472 .Op Fl t Ar target-session
2473 .Ar name Op Ar value
2475 .D1 (alias: Ic setenv )
2476 Set or unset an environment variable.
2479 is used, the change is made in the global environment; otherwise, it is applied
2480 to the session environment for
2481 .Ar target-session .
2484 flag unsets a variable.
2486 indicates the variable is to be removed from the environment before starting a
2488 .It Xo Ic show-environment
2490 .Op Fl t Ar target-session
2492 .D1 (alias: Ic showenv )
2493 Display the environment for
2495 or the global environment with
2497 Variables removed from the environment are prefixed with
2502 includes an optional status line which is displayed in the bottom line of each
2504 By default, the status line is enabled (it may be disabled with the
2506 session option) and contains, from left-to-right: the name of the current
2507 session in square brackets; the window list; the current window title in double
2508 quotes; and the time and date.
2510 The status line is made of three parts: configurable left and right sections
2511 (which may contain dynamic content such as the time or output from a shell
2514 .Ic status-left-length ,
2517 .Ic status-right-length
2518 options below), and a central window list.
2519 By default, the window list shows the index, name and (if any) flag of the
2520 windows present in the current session in ascending numerical order.
2521 It may be customised with the
2522 .Ar window-status-format
2524 .Ar window-status-current-format
2526 The flag is one of the following symbols appended to the window name:
2527 .Bl -column "Symbol" "Meaning" -offset indent
2528 .It Sy "Symbol" Ta Sy "Meaning"
2529 .It Li "*" Ta "Denotes the current window."
2530 .It Li "-" Ta "Marks the last window (previously selected)."
2531 .It Li "#" Ta "Window is monitored and activity has been detected."
2532 .It Li "!" Ta "A bell has occurred in the window."
2533 .It Li "+" Ta "Window is monitored for content and it has appeared."
2534 .It Li "~" Ta "The window has been silent for the monitor-silence interval."
2537 The # symbol relates to the
2538 .Ic monitor-activity
2542 The window name is printed in inverted colours if an alert (bell, activity or
2543 content) is present.
2545 The colour and attributes of the status line may be configured, the entire
2546 status line using the
2551 session options and individual windows using the
2552 .Ic window-status-attr ,
2553 .Ic window-status-fg
2555 .Ic window-status-bg
2558 The status line is automatically refreshed at interval if it has changed, the
2559 interval may be controlled with the
2563 Commands related to the status line are as follows:
2565 .It Xo Ic command-prompt
2567 .Op Fl t Ar target-client
2570 Open the command prompt in a client.
2571 This may be used from inside
2573 to execute commands interactively.
2576 is specified, it is used as the command.
2581 is a comma-separated list of prompts which are displayed in order; otherwise
2582 a single prompt is displayed, constructed from
2584 if it is present, or
2587 Before the command is executed, the first occurrence of the string
2589 and all occurrences of
2591 are replaced by the response to the first prompt, the second
2595 are replaced with the response to the second prompt, and so on for further
2597 Up to nine prompt responses may be replaced
2603 .It Xo Ic confirm-before
2604 .Op Fl t Ar target-client
2607 .D1 (alias: Ic confirm )
2608 Ask for confirmation before executing
2610 This command works only from inside
2612 .It Xo Ic display-message
2614 .Op Fl t Ar target-client
2617 .D1 (alias: Ic display )
2621 is given, the output is printed to stdout, otherwise it is displayed in the
2628 with the exception that #() are not handled.
2632 maintains a stack of
2634 Up to the value of the
2636 option are kept; when a new buffer is added, the buffer at the bottom of the
2638 Buffers may be added using
2642 command, and pasted into a window using the
2646 A configurable history buffer is also maintained for each window.
2647 By default, up to 2000 lines are kept; this can be altered with the
2653 The buffer commands are as follows:
2657 .Op Fl t Ar target-window
2660 Put a window into buffer choice mode, where a buffer may be chosen
2661 interactively from a list.
2662 After a buffer is selected,
2664 is replaced by the buffer index in
2666 and the result executed as a command.
2669 is not given, "paste-buffer -b '%%'" is used.
2670 This command works only from inside
2672 .It Ic clear-history Op Fl t Ar target-pane
2673 .D1 (alias: Ic clearhist )
2674 Remove and free the history for the specified pane.
2675 .It Ic delete-buffer Op Fl b Ar buffer-index
2676 .D1 (alias: Ic deleteb )
2677 Delete the buffer at
2679 or the top buffer if not specified.
2681 .D1 (alias: Ic lsb )
2682 List the global buffers.
2683 .It Xo Ic load-buffer
2684 .Op Fl b Ar buffer-index
2687 .D1 (alias: Ic loadb )
2688 Load the contents of the specified paste buffer from
2690 .It Xo Ic paste-buffer
2692 .Op Fl b Ar buffer-index
2693 .Op Fl s Ar separator
2694 .Op Fl t Ar target-pane
2696 .D1 (alias: Ic pasteb )
2697 Insert the contents of a paste buffer into the specified pane.
2698 If not specified, paste into the current one.
2701 also delete the paste buffer from the stack.
2702 When output, any linefeed (LF) characters in the paste buffer are replaced with
2703 a separator, by default carriage return (CR).
2704 A custom separator may be specified using the
2709 flag means to do no replacement (equivalent to a separator of LF).
2710 .It Xo Ic save-buffer
2712 .Op Fl b Ar buffer-index
2715 .D1 (alias: Ic saveb )
2716 Save the contents of the specified paste buffer to
2720 option appends to rather than overwriting the file.
2721 .It Xo Ic set-buffer
2722 .Op Fl b Ar buffer-index
2725 .D1 (alias: Ic setb )
2726 Set the contents of the specified buffer to
2728 .It Xo Ic show-buffer
2729 .Op Fl b Ar buffer-index
2731 .D1 (alias: Ic showb )
2732 Display the contents of the specified buffer.
2735 Miscellaneous commands are as follows:
2737 .It Ic clock-mode Op Fl t Ar target-pane
2738 Display a large clock.
2739 .It Ic if-shell Ar shell-command command
2747 .D1 (alias: Ic lock )
2748 Lock each client individually by running the command specified by the
2751 .It Ic run-shell Ar shell-command
2752 .D1 (alias: Ic run )
2755 in the background without creating a window.
2756 After it finishes, any output to stdout is displayed in copy mode.
2757 If the command doesn't return success, the exit status is also displayed.
2759 .D1 (alias: Ic info )
2760 Show server information and terminal details.
2763 .Bl -tag -width "/etc/tmux.confXXX" -compact
2768 .It Pa /etc/tmux.conf
2769 System-wide configuration file.
2777 .Dl $ tmux new-session vi
2779 Most commands have a shorter form, known as an alias.
2780 For new-session, this is
2785 Alternatively, the shortest unambiguous form of a command is accepted.
2786 If there are several options, they are listed:
2787 .Bd -literal -offset indent
2789 ambiguous command: n, could be: new-session, new-window, next-window
2792 Within an active session, a new window may be created by typing
2802 Windows may be navigated with:
2804 (to select window 0),
2806 (to select window 1), and so on;
2808 to select the next window; and
2810 to select the previous window.
2812 A session may be detached using
2814 (or by an external event such as
2816 disconnection) and reattached with:
2818 .Dl $ tmux attach-session
2822 lists the current key bindings in the current window; up and down may be used
2823 to navigate the list or
2827 Commands to be run when the
2829 server is started may be placed in the
2832 Common examples include:
2834 Changing the default prefix key:
2835 .Bd -literal -offset indent
2836 set-option -g prefix C-a
2838 bind-key C-a send-prefix
2841 Turning the status line off, or changing its colour:
2842 .Bd -literal -offset indent
2843 set-option -g status off
2844 set-option -g status-bg blue
2847 Setting other options, such as the default command,
2848 or locking after 30 minutes of inactivity:
2849 .Bd -literal -offset indent
2850 set-option -g default-command "exec /bin/ksh"
2851 set-option -g lock-after-time 1800
2854 Creating new key bindings:
2855 .Bd -literal -offset indent
2856 bind-key b set-option status
2857 bind-key / command-prompt "split-window 'exec man %%'"
2858 bind-key S command-prompt "new-window -n %1 'ssh %1'"
2863 .An Nicholas Marriott Aq nicm@users.sourceforge.net