Add -a and -s options to lsp to list all panes in the server or session
[tmux-openbsd.git] / tmux.1
blob939a433361791718cbda4450c2a258dc1f6d83f3
1 .\" $OpenBSD$
2 .\"
3 .\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
4 .\"
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.
8 .\"
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.
16 .\"
17 .Dd $Mdocdate$
18 .Dt TMUX 1
19 .Os
20 .Sh NAME
21 .Nm tmux
22 .Nd terminal multiplexer
23 .Sh SYNOPSIS
24 .Nm tmux
25 .Bk -words
26 .Op Fl 28lquv
27 .Op Fl c Ar shell-command
28 .Op Fl f Ar file
29 .Op Fl L Ar socket-name
30 .Op Fl S Ar socket-path
31 .Op Ar command Op Ar flags
32 .Ek
33 .Sh DESCRIPTION
34 .Nm
35 is a terminal multiplexer:
36 it enables a number of terminals to be created, accessed, and
37 controlled from a single screen.
38 .Nm
39 may be detached from a screen
40 and continue running in the background,
41 then later reattached.
42 .Pp
43 When
44 .Nm
45 is started it creates a new
46 .Em session
47 with a single
48 .Em window
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.
53 .Pp
54 A session is a single collection of
55 .Em pseudo terminals
56 under the management of
57 .Nm .
58 Each session has one or more
59 windows linked to it.
60 A window occupies the entire screen
61 and may be split into rectangular panes,
62 each of which is a separate pseudo terminal
63 (the
64 .Xr pty 4
65 manual page documents the technical details of pseudo terminals).
66 Any number of
67 .Nm
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,
71 .Nm
72 exits.
73 .Pp
74 Each session is persistent and will survive accidental disconnection
75 (such as
76 .Xr ssh 1
77 connection timeout) or intentional detaching (with the
78 .Ql C-b d
79 key strokes).
80 .Nm
81 may be reattached using:
82 .Pp
83 .Dl $ tmux attach
84 .Pp
86 .Nm ,
87 a session is displayed on screen by a
88 .Em client
89 and all sessions are managed by a single
90 .Em server .
91 The server and each client are separate processes which communicate through a
92 socket in
93 .Pa /tmp .
94 .Pp
95 The options are as follows:
96 .Bl -tag -width "XXXXXXXXXXXX"
97 .It Fl 2
98 Force
99 .Nm
100 to assume the terminal supports 256 colours.
101 .It Fl 8
102 Like
103 .Fl 2 ,
104 but indicates that the terminal supports 88 colours.
105 .It Fl c Ar shell-command
106 Execute
107 .Ar shell-command
108 using the default shell.
109 If necessary, the
111 server will be started to retrieve the
112 .Ic default-shell
113 option.
114 This option is for compatibility with
115 .Xr sh 1
116 when
118 is used as a login shell.
119 .It Fl f Ar file
120 Specify an alternative configuration file.
121 By default,
123 loads the system configuration file from
124 .Pa /etc/tmux.conf ,
125 if present, then looks for a user configuration file at
126 .Pa ~/.tmux.conf .
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
137 .Pa /tmp
139 .Ev TMPDIR
140 if set);
141 the default socket is named
142 .Em default .
143 This option allows a different socket name to be specified, allowing several
144 independent
146 servers to be run.
147 Unlike
148 .Fl S
149 a full path is not necessary: the sockets are all created in the same
150 directory.
152 If the socket is accidentally removed, the
153 .Dv SIGUSR1
154 signal may be sent to the
156 server process to recreate it.
157 .It Fl l
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.
161 .It Fl q
162 Set the
163 .Ic quiet
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.
168 .Fl S
169 is specified, the default socket directory is not used and any
170 .Fl L
171 flag is ignored.
172 .It Fl u
174 attempts to guess if the terminal is likely to support UTF-8 by checking the
175 first of the
176 .Ev LC_ALL ,
177 .Ev LC_CTYPE
179 .Ev LANG
180 environment variables to be set for the string "UTF-8".
181 This is not always correct: the
182 .Fl u
183 flag explicitly informs
185 that UTF-8 is supported.
187 If the server is started from a client passed
188 .Fl u
189 or where UTF-8 is detected, the
190 .Ic utf8
192 .Ic status-utf8
193 options are enabled in the global window and session options respectively.
194 .It Fl v
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
202 .Em PID
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
206 .Nm ,
207 as described in the following sections.
208 If no commands are specified, the
209 .Ic new-session
210 command is assumed.
212 .Sh KEY BINDINGS
214 may be controlled from an attached client by using a key combination of a
215 prefix key,
216 .Ql C-b
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
222 .It C-b
223 Send the prefix key (C-b) through to the application.
224 .It C-o
225 Rotate the panes in the current window forwards.
226 .It C-z
227 Suspend the
229 client.
230 .It !
231 Break the current pane out of the window.
232 .It \&"
233 Split the current pane into two, top and bottom.
234 .It #
235 List all paste buffers.
236 .It %
237 Split the current pane into two, left and right.
238 .It &
239 Kill the current window.
240 .It '
241 Prompt for a window index to select.
242 .It ,
243 Rename the current window.
244 .It -
245 Delete the most recently copied buffer of text.
246 .It .
247 Prompt for an index to move the current window.
248 .It 0 to 9
249 Select windows 0 to 9.
250 .It :
251 Enter the
253 command prompt.
254 .It ;
255 Move to the previously active pane.
256 .It =
257 Choose which buffer to paste interactively from a list.
258 .It \&?
259 List all key bindings.
260 .It D
261 Choose a client to detach.
262 .It \&[
263 Enter copy mode to copy text or view the history.
264 .It \&]
265 Paste the most recently copied buffer of text.
266 .It c
267 Create a new window.
268 .It d
269 Detach the current client.
270 .It f
271 Prompt to search for text in open windows.
272 .It i
273 Display some information about the current window.
274 .It l
275 Move to the previously selected window.
276 .It n
277 Change to the next window.
278 .It o
279 Select the next pane in the current window.
280 .It p
281 Change to the previous window.
282 .It q
283 Briefly display pane indexes.
284 .It r
285 Force redraw of the attached client.
286 .It s
287 Select a new session for the attached client interactively.
288 .It L
289 Switch the attached client back to the last session.
290 .It t
291 Show the time.
292 .It w
293 Choose the current window interactively.
294 .It x
295 Kill the current pane.
296 .It {
297 Swap the current pane with the previous pane.
298 .It }
299 Swap the current pane with the next pane.
300 .It ~
301 Show previous messages from
302 .Nm ,
303 if any.
304 .It Page Up
305 Enter copy mode and scroll one page up.
306 .It Up, Down
307 .It Left, Right
308 Change to the pane above, below, to the left, or to the right of the current
309 pane.
310 .It M-1 to M-5
311 Arrange panes in one of the five preset layouts: even-horizontal,
312 even-vertical, main-horizontal, main-vertical, or tiled.
313 .It M-n
314 Move to the next window with a bell or activity marker.
315 .It M-o
316 Rotate the panes in the current window backwards.
317 .It M-p
318 Move to the previous window with a bell or activity marker.
319 .It C-Up, C-Down
320 .It C-Left, C-Right
321 Resize the current pane in steps of one cell.
322 .It M-Up, M-Down
323 .It M-Left, M-Right
324 Resize the current pane in steps of five cells.
327 Key bindings may be changed with the
328 .Ic bind-key
330 .Ic unbind-key
331 commands.
332 .Sh COMMANDS
333 This section contains a list of the commands supported by
334 .Nm .
335 Most commands accept the optional
336 .Fl t
337 argument with one of
338 .Ar target-client ,
339 .Ar target-session
340 .Ar target-window ,
342 .Ar target-pane .
343 These specify the client, session, window or pane which a command should affect.
344 .Ar target-client
345 is the name of the
346 .Xr pty 4
347 file to which the client is connected, for example either of
348 .Pa /dev/ttyp1
350 .Pa ttyp1
351 for the client attached to
352 .Pa /dev/ttyp1 .
353 If no client is specified, the current client is chosen, if possible, or an
354 error is reported.
355 Clients may be listed with the
356 .Ic list-clients
357 command.
359 .Ar target-session
360 is either the name of a session (as listed by the
361 .Ic list-sessions
362 command) or the name of a client with the same syntax as
363 .Ar target-client ,
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
369 .Ar target-session
370 is a prefix or for which it matches as an
371 .Xr fnmatch 3
372 pattern.
373 If a single match is found, it is used as the target session; multiple matches
374 produce an error.
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.
378 .Ar target-window
379 specifies a window in the form
380 .Em session Ns \&: Ns Em window .
381 .Em session
382 follows the same rules as for
383 .Ar target-session ,
385 .Em window
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
388 .Xr fnmatch 3
389 pattern or the start of a window name, such as mysession:mywin* or
390 mysession:mywin.
391 An empty window name specifies the next unused index if appropriate (for
392 example the
393 .Ic new-window
395 .Ic link-window
396 commands)
397 otherwise the current window in
398 .Em session
399 is chosen.
400 The special character
401 .Ql \&!
402 uses the last (previously current) window, or
403 .Ql +
405 .Ql -
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
410 match a session.
412 .Ar target-pane
413 takes a similar form to
414 .Ar target-window
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
418 window is used.
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
422 up as for
423 .Ar target-window .
425 .Ql +
427 .Ql -
428 indicate the next or previous pane index, respectively.
429 One of the strings
430 .Em top ,
431 .Em bottom ,
432 .Em left ,
433 .Em right ,
434 .Em top-left ,
435 .Em top-right ,
436 .Em bottom-left or
437 .Em bottom-right
438 may be used instead of a pane index.
440 The special characters
441 .Ql +
443 .Ql -
444 may be followed by an offset, for example:
445 .Bd -literal -offset indent
446 select-window -t:+2
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
454 .Ql %
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
459 .Ev TMUX_PANE
460 environment variable.
461 It may be used alone to target a pane or the window containing it.
463 .Ar shell-command
464 arguments are
465 .Xr sh 1
466 commands.
467 These must be passed as a single item, which typically means quoting them, for
468 example:
469 .Bd -literal -offset indent
470 new-window 'vi /etc/passwd'
473 .Ar command
474 .Op Ar arguments
475 refers to a
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
482 Or if using
483 .Xr sh 1 :
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
494 .Ic bind-key ) .
496 Example
498 commands include:
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
509 Or from
510 .Xr sh 1 :
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
524 .Ic new-session
525 command, or later with the
526 .Ic attach-session
527 command.
528 Each session has one or more windows
529 .Em linked
530 into it.
531 Windows may be linked to multiple sessions and are made up of one or
532 more panes,
533 each of which contains a pseudo terminal.
534 Commands for creating, linking and otherwise manipulating windows
535 are covered
536 in the
537 .Sx WINDOWS AND PANES
538 section.
540 The following commands are available to manage clients and sessions:
541 .Bl -tag -width Ds
542 .It Xo Ic attach-session
543 .Op Fl dr
544 .Op Fl t Ar target-session
546 .D1 (alias: Ic attach )
547 If run from outside
548 .Nm ,
549 create a new client in the current terminal and attach it to
550 .Ar target-session .
551 If used from inside, switch the current client.
553 .Fl d
554 is specified, any other clients attached to the session are detached.
555 .Fl r
556 signifies the client is read-only (only keys bound to the
557 .Ic detach-client
558 command have any effect)
560 If no server is started,
561 .Ic attach-session
562 will attempt to start it; this will fail unless sessions are created in the
563 configuration file.
564 .It Xo Ic detach-client
565 .Op Fl P
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
570 .Fl t .
572 .Fl P
573 is given, send SIGHUP to the parent process of the client, typically causing it
574 to exit.
575 .It Ic has-session Op Fl t Ar target-session
576 .D1 (alias: Ic has )
577 Report an error and exit with 1 if the specified session does not exist.
578 If it does exist, exit with 0.
579 .It Ic kill-server
580 Kill the
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.
586 .It Ic list-clients
587 .D1 (alias: Ic lsc )
588 List all clients attached to the server.
589 .It Ic list-commands
590 .D1 (alias: Ic lscm )
591 List the syntax of all commands supported by
592 .Nm .
593 .It Ic list-sessions
594 .D1 (alias: Ic ls )
595 List all sessions managed by the server.
596 .It Ic lock-client Op Fl t Ar target-client
597 .D1 (alias: Ic lockc )
598 Lock
599 .Ar target-client ,
600 see the
601 .Ic lock-server
602 command.
603 .It Ic lock-session Op Fl t Ar target-session
604 .D1 (alias: Ic locks )
605 Lock all clients attached to
606 .Ar target-session .
607 .It Xo Ic new-session
608 .Op Fl d
609 .Op Fl n Ar window-name
610 .Op Fl s Ar session-name
611 .Op Fl t Ar target-session
612 .Op Fl x Ar width
613 .Op Fl y Ar height
614 .Op Ar shell-command
616 .D1 (alias: Ic new )
617 Create a new session with name
618 .Ar session-name .
620 The new session is attached to the current terminal unless
621 .Fl d
622 is given.
623 .Ar window-name
625 .Ar shell-command
626 are the name of and shell command to execute in the initial window.
628 .Fl d
629 is used,
630 .Fl x
632 .Fl y
633 specify the size of the initial window (80 by 24 if not given).
635 If run from a terminal, any
636 .Xr termios 4
637 special characters are saved and used for new windows in the new session.
640 .Fl t
641 is given, the new session is
642 .Em grouped
643 with
644 .Ar target-session .
645 This means they share the same set of windows - all windows from
646 .Ar target-session
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.
651 Giving
652 .Fl n
654 .Ar shell-command
655 are invalid if
656 .Fl t
657 is used.
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
661 with
662 .Fl t .
663 .It Xo Ic rename-session
664 .Op Fl t Ar target-session
665 .Ar new-name
667 .D1 (alias: Ic rename )
668 Rename the session to
669 .Ar new-name .
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
676 .Ar message-limit
677 session option for the session attached to that client.
678 This command displays the log for
679 .Ar target-client .
680 .It Ic source-file Ar path
681 .D1 (alias: Ic source )
682 Execute commands from
683 .Ar path .
684 .It Ic start-server
685 .D1 (alias: Ic start )
686 Start the
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
694 .Dv SIGTSTP
695 (tty stop).
696 .It Xo Ic switch-client
697 .Op Fl lnp
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
703 .Ar target-client
705 .Ar target-session .
707 .Fl l ,
708 .Fl n
710 .Fl p
711 is used, the client is moved to the last, next or previous session
712 respectively.
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
721 .Em paste buffer
722 for later insertion into another window.
723 This mode is entered with the
724 .Ic copy-mode
725 command, bound to
726 .Ql \&[
727 by default.
728 It is also entered when a command that produces output, such as
729 .Ic list-keys ,
730 is executed from a key binding.
732 The keys available depend on whether emacs or vi mode is selected
733 (see the
734 .Ic mode-keys
735 option).
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
784 .Ql - ,
785 .Ql _
787 .Ql @
788 characters as word delimiters by default, but this can be adjusted by
789 setting the
790 .Em word-separators
791 window option.
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
795 the word separator.
797 The jump commands enable quick movement within a line.
798 For instance, typing
799 .Ql f
800 followed by
801 .Ql /
802 will move the cursor to the next
803 .Ql /
804 character on the current line.
806 .Ql \&;
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
813 .Ql M-1 0 M-f
814 in emacs mode, and
815 .Ql 10w
816 in vi.
818 Mode key bindings are defined in a set of named tables:
819 .Em vi-edit
821 .Em emacs-edit
822 for keys used when line editing at the command prompt;
823 .Em vi-choice
825 .Em emacs-choice
826 for keys used when choosing from lists (such as produced by the
827 .Ic choose-window
828 command); and
829 .Em vi-copy
831 .Em emacs-copy
832 used in copy mode.
833 The tables may be viewed with the
834 .Ic list-keys
835 command and keys modified or removed with
836 .Ic bind-key
838 .Ic unbind-key .
840 The paste buffer key pastes the first line from the top paste buffer on the
841 stack.
843 The synopsis for the
844 .Ic copy-mode
845 command is:
846 .Bl -tag -width Ds
847 .It Xo Ic copy-mode
848 .Op Fl u
849 .Op Fl t Ar target-pane
851 Enter copy mode.
853 .Fl u
854 option scrolls one page up.
857 Each window displayed by
859 may be split into one or more
860 .Em panes ;
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
863 .Ic split-window
864 command.
865 Windows may be split horizontally (with the
866 .Fl h
867 flag) or vertically.
868 Panes may be resized with the
869 .Ic resize-pane
870 command (bound to
871 .Ql C-up ,
872 .Ql C-down
873 .Ql C-left
875 .Ql C-right
876 by default), the current pane may be changed with the
877 .Ic select-pane
878 command and the
879 .Ic rotate-window
881 .Ic swap-pane
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.
885 A number of preset
886 .Em layouts
887 are available.
888 These may be selected with the
889 .Ic select-layout
890 command or cycled with
891 .Ic next-layout
892 (bound to
893 .Ql Space
894 by default); once a layout is chosen, panes within it may be moved and resized
895 as normal.
897 The following layouts are supported:
898 .Bl -tag -width Ds
899 .It Ic even-horizontal
900 Panes are spread out evenly from left to right across the window.
901 .It Ic even-vertical
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.
906 Use the
907 .Em main-pane-height
908 window option to specify the height of the top pane.
909 .It Ic main-vertical
910 Similar to
911 .Ic main-horizontal
912 but the large pane is placed on the left and the others spread from top to
913 bottom along the right.
914 See the
915 .Em main-pane-width
916 window option.
917 .It Ic tiled
918 Panes are spread out as evenly as possible over the window in both rows and
919 columns.
922 In addition,
923 .Ic select-layout
924 may be used to apply a previously used layout - the
925 .Ic list-windows
926 command displays the layout of each window in a form suitable for use with
927 .Ic select-layout .
928 For example:
929 .Bd -literal -offset indent
930 $ tmux list-windows
931 0: ksh [159x48]
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:
942 .Bl -tag -width Ds
943 .It Xo Ic break-pane
944 .Op Fl d
945 .Op Fl t Ar target-pane
947 .D1 (alias: Ic breakp )
948 Break
949 .Ar target-pane
950 off from its containing window to make it the only pane in a new window.
952 .Fl d
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
956 .Op Fl E Ar end-line
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
962 is specified.
964 .Fl S
966 .Fl E
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.
970 .It Xo
971 .Ic choose-client
972 .Op Fl t Ar target-window
973 .Op Ar template
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,
978 .Ql %%
979 is replaced by the client
980 .Xr pty 4
981 path in
982 .Ar template
983 and the result executed as a command.
985 .Ar template
986 is not given, "detach-client -t '%%'" is used.
987 This command works only from inside
988 .Nm .
989 .It Xo
990 .Ic choose-session
991 .Op Fl t Ar target-window
992 .Op Ar template
994 Put a window into session choice mode, where a session may be selected
995 interactively from a list.
996 When one is chosen,
997 .Ql %%
998 is replaced by the session name in
999 .Ar template
1000 and the result executed as a command.
1002 .Ar template
1003 is not given, "switch-client -t '%%'" is used.
1004 This command works only from inside
1005 .Nm .
1006 .It Xo
1007 .Ic choose-window
1008 .Op Fl t Ar target-window
1009 .Op Ar template
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,
1014 .Ql %%
1015 is replaced by the session name and window index in
1016 .Ar template
1017 and the result executed as a command.
1019 .Ar template
1020 is not given, "select-window -t '%%'" is used.
1021 This command works only from inside
1022 .Nm .
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
1026 .Ar target-client .
1027 See the
1028 .Ic display-panes-time ,
1029 .Ic display-panes-colour ,
1031 .Ic display-panes-active-colour
1032 session options.
1033 While the indicator is on screen, a pane may be selected with the
1034 .Ql 0
1036 .Ql 9
1037 keys.
1038 .It Xo Ic find-window
1039 .Op Fl t Ar target-window
1040 .Ar match-string
1042 .D1 (alias: Ic findw )
1043 Search for the
1044 .Xr fnmatch 3
1045 pattern
1046 .Ar match-string
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
1051 .Nm .
1052 .It Xo Ic join-pane
1053 .Op Fl dhv
1054 .Oo Fl l
1055 .Ar size |
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 )
1061 Like
1062 .Ic split-window ,
1063 but instead of splitting
1064 .Ar dst-pane
1065 and creating a new pane, split it and move
1066 .Ar src-pane
1067 into the space.
1068 This can be used to reverse
1069 .Ic break-pane .
1070 .It Xo Ic kill-pane
1071 .Op Fl a
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.
1078 .Fl a
1079 option kills all but the pane given with
1080 .Fl t .
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
1084 .Ar target-window ,
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.
1092 If no
1093 .Ar target-session
1094 is specified, select the last window of the current session.
1095 .It Xo Ic link-window
1096 .Op Fl dk
1097 .Op Fl s Ar src-window
1098 .Op Fl t Ar dst-window
1100 .D1 (alias: Ic linkw )
1101 Link the window at
1102 .Ar src-window
1103 to the specified
1104 .Ar dst-window .
1106 .Ar dst-window
1107 is specified and no such window exists, the
1108 .Ar src-window
1109 is linked there.
1111 .Fl k
1112 is given and
1113 .Ar dst-window
1114 exists, it is killed, otherwise an error is generated.
1116 .Fl d
1117 is given, the newly linked window is not selected.
1118 .It Xo Ic list-panes
1119 .Op Fl as
1120 .Op Fl t Ar target
1122 .D1 (alias: Ic lsp )
1124 .Fl a
1125 is given,
1126 .Ar target
1127 is ignored and all panes on the server are listed.
1129 .Fl s
1130 is given,
1131 .Ar target
1132 is a session (or the current session).
1133 If neither is given,
1134 .Ar target
1135 is a window (or the current window).
1136 .It Xo Ic list-windows
1137 .Op Fl a
1138 .Op Fl t Ar target-session
1140 .D1 (alias: Ic lsw )
1142 .Fl a
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
1147 .Op Fl dk
1148 .Op Fl s Ar src-window
1149 .Op Fl t Ar dst-window
1151 .D1 (alias: Ic movew )
1152 This is similar to
1153 .Ic link-window ,
1154 except the window at
1155 .Ar src-window
1156 is moved to
1157 .Ar dst-window .
1158 .It Xo Ic new-window
1159 .Op Fl adkP
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.
1166 With
1167 .Fl a ,
1168 the new window is inserted at the next index up from the specified
1169 .Ar target-window ,
1170 moving windows up if necessary,
1171 otherwise
1172 .Ar target-window
1173 is the new window location.
1176 .Fl d
1177 is given, the session does not make the new window the current window.
1178 .Ar target-window
1179 represents the window to be created; if the target already exists an error is
1180 shown, unless the
1181 .Fl k
1182 flag is used, in which case it is destroyed.
1183 .Ar shell-command
1184 is the command to execute.
1186 .Ar shell-command
1187 is not specified, the value of the
1188 .Ic default-command
1189 option is used.
1191 When the shell command completes, the window closes.
1192 See the
1193 .Ic remain-on-exit
1194 option to change this behaviour.
1197 .Ev TERM
1198 environment variable must be set to
1199 .Dq screen
1200 for all programs running
1201 .Em inside
1202 .Nm .
1203 New windows will automatically have
1204 .Dq TERM=screen
1205 added to their environment, but care must be taken not to reset this in shell
1206 start-up files.
1209 .Fl P
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
1215 .Op Fl a
1216 .Op Fl t Ar target-session
1218 .D1 (alias: Ic next )
1219 Move to the next window in the session.
1221 .Fl a
1222 is used, move to the next window with a bell, activity or content alert.
1223 .It Xo Ic pipe-pane
1224 .Op Fl o
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
1230 .Ar target-pane
1231 to a shell command.
1232 A pane may only be piped to one command at a time, any existing pipe is
1233 closed before
1234 .Ar shell-command
1235 is executed.
1237 .Ar shell-command
1238 string may contain the special character sequences supported by the
1239 .Ic status-left
1240 command.
1241 If no
1242 .Ar shell-command
1243 is given, the current pipe (if any) is closed.
1246 .Fl o
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
1258 .Op Fl a
1259 .Op Fl t Ar target-session
1261 .D1 (alias: Ic prev )
1262 Move to the previous window in the session.
1263 With
1264 .Fl a ,
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
1268 .Ar new-name
1270 .D1 (alias: Ic renamew )
1271 Rename the current window, or the window at
1272 .Ar target-window
1273 if specified, to
1274 .Ar new-name .
1275 .It Xo Ic resize-pane
1276 .Op Fl DLRU
1277 .Op Fl t Ar target-pane
1278 .Op Ar adjustment
1280 .D1 (alias: Ic resizep )
1281 Resize a pane, upward with
1282 .Fl U
1283 (the default), downward with
1284 .Fl D ,
1285 to the left with
1286 .Fl L
1287 and to the right with
1288 .Fl R .
1290 .Ar adjustment
1291 is given in lines or cells (the default is 1).
1292 .It Xo Ic respawn-window
1293 .Op Fl k
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
1299 .Ic remain-on-exit
1300 window option).
1302 .Ar shell-command
1303 is not given, the command used when the window was created is executed.
1304 The window must be already inactive, unless
1305 .Fl k
1306 is given, in which case any existing command is killed.
1307 .It Xo Ic rotate-window
1308 .Op Fl DU
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
1313 lower) with
1314 .Fl U
1315 or downward (numerically higher).
1316 .It Xo Ic select-layout
1317 .Op Fl np
1318 .Op Fl t Ar target-window
1319 .Op Ar layout-name
1321 .D1 (alias: Ic selectl )
1322 Choose a specific layout for a window.
1324 .Ar layout-name
1325 is not given, the last preset layout used (if any) is reapplied.
1326 .Fl n
1328 .Fl p
1329 are equivalent to the
1330 .Ic next-layout
1332 .Ic previous-layout
1333 commands.
1334 .It Xo Ic select-pane
1335 .Op Fl lDLRU
1336 .Op Fl t Ar target-pane
1338 .D1 (alias: Ic selectp )
1339 Make pane
1340 .Ar target-pane
1341 the active pane in window
1342 .Ar target-window .
1343 If one of
1344 .Fl D ,
1345 .Fl L ,
1346 .Fl R ,
1348 .Fl U
1349 is used, respectively the pane below, to the left, to the right, or above the
1350 target pane is used.
1351 .Fl l
1352 is the same as using the
1353 .Ic last-pane
1354 command.
1355 .It Xo Ic select-window
1356 .Op Fl lnp
1357 .Op Fl t Ar target-window
1359 .D1 (alias: Ic selectw )
1360 Select the window at
1361 .Ar target-window .
1362 .Fl l ,
1363 .Fl n
1365 .Fl p
1366 are equivalent to the
1367 .Ic last-window ,
1368 .Ic next-window
1370 .Ic previous-window
1371 commands.
1372 .It Xo Ic split-window
1373 .Op Fl dhvP
1374 .Oo Fl l
1375 .Ar size |
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
1382 .Ar target-pane :
1383 .Fl h
1384 does a horizontal split and
1385 .Fl v
1386 a vertical split; if neither is specified,
1387 .Fl v
1388 is assumed.
1390 .Fl l
1392 .Fl p
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
1396 .Ic new-window
1397 command.
1398 .It Xo Ic swap-pane
1399 .Op Fl dDU
1400 .Op Fl s Ar src-pane
1401 .Op Fl t Ar dst-pane
1403 .D1 (alias: Ic swapp )
1404 Swap two panes.
1406 .Fl U
1407 is used and no source pane is specified with
1408 .Fl s ,
1409 .Ar dst-pane
1410 is swapped with the previous pane (before it numerically);
1411 .Fl D
1412 swaps with the next pane (after it numerically).
1413 .Fl d
1414 instructs
1416 not to change the active pane.
1417 .It Xo Ic swap-window
1418 .Op Fl d
1419 .Op Fl s Ar src-window
1420 .Op Fl t Ar dst-window
1422 .D1 (alias: Ic swapw )
1423 This is similar to
1424 .Ic link-window ,
1425 except the source and destination windows are swapped.
1426 It is an error if no window exists at
1427 .Ar src-window .
1428 .It Xo Ic unlink-window
1429 .Op Fl k
1430 .Op Fl t Ar target-window
1432 .D1 (alias: Ic unlinkw )
1433 Unlink
1434 .Ar target-window .
1435 Unless
1436 .Fl k
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;
1440 .Fl k
1441 is specified and the window is linked to only one session, it is unlinked and
1442 destroyed.
1444 .Sh KEY BINDINGS
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
1448 .Ql A
1450 .Ql Z ) .
1451 Ctrl keys may be prefixed with
1452 .Ql C-
1454 .Ql ^ ,
1455 and Alt (meta) with
1456 .Ql M- .
1457 In addition, the following special key names are accepted:
1458 .Em Up ,
1459 .Em Down ,
1460 .Em Left ,
1461 .Em Right ,
1462 .Em BSpace ,
1463 .Em BTab ,
1464 .Em DC
1465 (Delete),
1466 .Em End ,
1467 .Em Enter ,
1468 .Em Escape ,
1469 .Em F1
1471 .Em F20 ,
1472 .Em Home ,
1473 .Em IC
1474 (Insert),
1475 .Em NPage
1476 (Page Up),
1477 .Em PPage
1478 (Page Down),
1479 .Em Space ,
1481 .Em Tab .
1482 Note that to bind the
1483 .Ql \&"
1485 .Ql '
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:
1493 .Bl -tag -width Ds
1494 .It Xo Ic bind-key
1495 .Op Fl cnr
1496 .Op Fl t Ar key-table
1497 .Ar key Ar command Op Ar arguments
1499 .D1 (alias: Ic bind )
1500 Bind key
1501 .Ar key
1503 .Ar command .
1504 By default (without
1505 .Fl t )
1506 the primary key bindings are modified (those normally activated with the prefix
1507 key); in this case, if
1508 .Fl n
1509 is specified, it is not necessary to use the prefix key,
1510 .Ar command
1511 is bound to
1512 .Ar key
1513 alone.
1515 .Fl r
1516 flag indicates this key may repeat, see the
1517 .Ic repeat-time
1518 option.
1521 .Fl t
1522 is present,
1523 .Ar key
1524 is bound in
1525 .Ar key-table :
1526 the binding for command mode with
1527 .Fl c
1528 or for normal mode without.
1529 To view the default bindings and possible commands, see the
1530 .Ic list-keys
1531 command.
1532 .It Ic list-keys Op Fl t Ar key-table
1533 .D1 (alias: Ic lsk )
1534 List all key bindings.
1535 Without
1536 .Fl t
1537 the primary key bindings - those executed when preceded by the prefix key -
1538 are printed.
1539 Keys bound without the prefix key (see
1540 .Ic bind-key
1541 .Fl n )
1542 are marked with
1543 .Ql (no prefix) .
1545 With
1546 .Fl t ,
1547 the key bindings in
1548 .Ar key-table
1549 are listed; this may be one of:
1550 .Em vi-edit ,
1551 .Em emacs-edit ,
1552 .Em vi-choice ,
1553 .Em emacs-choice ,
1554 .Em vi-copy
1556 .Em emacs-copy .
1557 .It Xo Ic send-keys
1558 .Op Fl t Ar target-pane
1559 .Ar key Ar ...
1561 .D1 (alias: Ic send )
1562 Send a key or keys to a window.
1563 Each argument
1564 .Ar key
1565 is the name of the key (such as
1566 .Ql C-a
1568 .Ql npage
1569 ) to send; if the string is not recognised as a key, it is sent as a series of
1570 characters.
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
1576 .Op Fl acn
1577 .Op Fl t Ar key-table
1578 .Ar key
1580 .D1 (alias: Ic unbind )
1581 Unbind the command bound to
1582 .Ar key .
1583 Without
1584 .Fl t
1585 the primary key bindings are modified; in this case, if
1586 .Fl n
1587 is specified, the command bound to
1588 .Ar key
1589 without a prefix (if any) is removed.
1591 .Fl a
1592 is present, all key bindings are removed.
1595 .Fl t
1596 is present,
1597 .Ar key
1599 .Ar key-table
1600 is unbound: the binding for command mode with
1601 .Fl c
1602 or for normal mode without.
1604 .Sh OPTIONS
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 ,
1610 .Em session options
1612 .Em window options .
1616 server has a set of global options which do not apply to any particular
1617 window or session.
1618 These are altered with the
1619 .Ic set-option
1620 .Fl s
1621 command, or displayed with the
1622 .Ic show-options
1623 .Fl s
1624 command.
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
1631 .Ic set-option
1632 command and may be listed with the
1633 .Ic show-options
1634 command.
1635 The available server and session options are listed under the
1636 .Ic set-option
1637 command.
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
1645 command.
1646 All window options are documented with the
1647 .Ic set-window-option
1648 command.
1650 Commands which set options are as follows:
1651 .Bl -tag -width Ds
1652 .It Xo Ic set-option
1653 .Op Fl agsuw
1654 .Op Fl t Ar target-session | Ar target-window
1655 .Ar option Ar value
1657 .D1 (alias: Ic set )
1658 Set a window option with
1659 .Fl w
1660 (equivalent to the
1661 .Ic set-window-option
1662 command),
1663 a server option with
1664 .Fl s ,
1665 otherwise a session option.
1668 .Fl g
1669 is specified, the global session or window option is set.
1670 With
1671 .Fl a ,
1672 and if the option expects a string,
1673 .Ar value
1674 is appended to the existing setting.
1676 .Fl u
1677 flag unsets an option, so a session inherits the option from the global
1678 options.
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:
1685 .Bl -tag -width Ds
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
1689 length.
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
1694 key sequences.
1695 The default is 500 milliseconds.
1696 .It Xo Ic exit-unattached
1697 .Op Ic on | off
1699 If enabled, the server will exit when there are no attached clients.
1700 .It Xo Ic quiet
1701 .Op Ic on | off
1703 Enable or disable the display of various informational messages (see also the
1704 .Fl q
1705 command line flag).
1708 Available session options are:
1709 .Bl -tag -width Ds
1710 .It Ic base-index Ar index
1711 Set the base index from which an unused index should be searched when a new
1712 window is created.
1713 The default is zero.
1714 .It Xo Ic bell-action
1715 .Op Ic any | none | current
1717 Set action on window bell.
1718 .Ic any
1719 means a bell in any window linked to a session causes a bell in the current
1720 window of that session,
1721 .Ic none
1722 means all bells are ignored and
1723 .Ic current
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
1727 created) to
1728 .Ar shell-command ,
1729 which may be any
1730 .Xr sh 1
1731 command.
1732 The default is an empty string, which instructs
1734 to create a login shell using the value of the
1735 .Ic default-shell
1736 option.
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
1745 .Ic default-command
1746 option is set to empty, and must be the full path of the executable.
1747 When started
1749 tries to set a default value from the first suitable of the
1750 .Ev SHELL
1751 environment variable, the shell returned by
1752 .Xr getpwuid 3 ,
1754 .Pa /bin/sh .
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
1761 .Ev TERM
1762 environment variable.
1765 to work correctly, this
1766 .Em must
1767 be set to
1768 .Ql screen
1769 or a derivative of it.
1770 .It Xo Ic destroy-unattached
1771 .Op Ic on | off
1773 If enabled and the session is no longer attached to any clients, it is
1774 destroyed.
1775 .It Xo Ic detach-on-destroy
1776 .Op Ic on | off
1778 If on (the default), the client is detached when the session it is attached to
1779 is destroyed.
1780 If off, the client is switched to the most recently active of the remaining
1781 sessions.
1782 .It Ic display-panes-active-colour Ar colour
1783 Set the colour used by the
1784 .Ic display-panes
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
1788 .Ic display-panes
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
1792 .Ic display-panes
1793 command appear.
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.
1797 .Ar time
1798 is in milliseconds.
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
1805 .Ic lock-session
1806 command) after
1807 .Ar number
1808 seconds of inactivity, or the entire server (all sessions) if the
1809 .Ic lock-server
1810 option is set.
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
1815 .Xr lock 1
1816 with
1817 .Fl np .
1818 .It Xo Ic lock-server
1819 .Op Ic on | off
1821 If this option is
1822 .Ic on
1823 (the default),
1824 instead of each session locking individually as each has been
1825 idle for
1826 .Ic lock-after-time ,
1827 the entire server will lock after
1828 .Em all
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
1833 .Ar attributes
1834 is either
1835 .Ic none
1836 or a comma-delimited list of one or more of:
1837 .Ic bright
1839 .Ic bold ) ,
1840 .Ic dim ,
1841 .Ic underscore ,
1842 .Ic blink ,
1843 .Ic reverse ,
1844 .Ic hidden ,
1846 .Ic italics .
1847 .It Ic message-bg Ar colour
1848 Set status line message background colour, where
1849 .Ar colour
1850 is one of:
1851 .Ic black ,
1852 .Ic red ,
1853 .Ic green ,
1854 .Ic yellow ,
1855 .Ic blue ,
1856 .Ic magenta ,
1857 .Ic cyan ,
1858 .Ic white ,
1859 .Ic colour0
1861 .Ic colour255
1862 from the 256-colour set,
1863 .Ic default ,
1864 or a hexadecimal RGB string such as
1865 .Ql #ffffff ,
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
1871 each client.
1872 The default is 20.
1873 .It Xo Ic mouse-select-pane
1874 .Op Ic on | off
1876 If on,
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.
1889 .Ar keys
1890 is a comma-separated list of key names, each of which individually behave as
1891 the prefix key.
1892 .It Ic repeat-time Ar time
1893 Allow multiple commands to be entered without pressing the prefix-key again
1894 in the specified
1895 .Ar time
1896 milliseconds (the default is 500).
1897 Whether a key repeats may be set when it is bound using the
1898 .Fl r
1899 flag to
1900 .Ic bind-key .
1901 Repeat is enabled for the default keys bound to the
1902 .Ic resize-pane
1903 command.
1904 .It Xo Ic mouse-utf8
1905 .Op Ic on | off
1907 If enabled, request mouse input as UTF-8 on UTF-8 terminals.
1908 .It Xo Ic set-remain-on-exit
1909 .Op Ic on | off
1911 Set the
1912 .Ic 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.
1916 Use the
1917 .Ic respawn-window
1918 command to reactivate such a window, or the
1919 .Ic kill-window
1920 command to destroy it.
1921 .It Xo Ic set-titles
1922 .Op Ic on | off
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.
1927 Note that elinks
1928 will only attempt to set the window title if the STY environment
1929 variable is set.
1930 .It Ic set-titles-string Ar string
1931 String used to set the window title if
1932 .Ic set-titles
1933 is on.
1934 Character sequences are replaced as for the
1935 .Ic status-left
1936 option.
1937 .It Xo Ic status
1938 .Op Ic on | off
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
1949 .Ar interval
1950 seconds.
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
1957 or right justified.
1958 .It Xo Ic status-keys
1959 .Op Ic vi | emacs
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
1964 .Ev VISUAL
1966 .Ev EDITOR
1967 environment variables are set and contain the string
1968 .Ql vi .
1969 .It Ic status-left Ar string
1970 Display
1971 .Ar string
1972 to the left of the status bar.
1973 .Ar string
1974 will be passed through
1975 .Xr strftime 3
1976 before being used.
1977 By default, the session name is shown.
1978 .Ar string
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
1995 .Ql shell-command
1996 and inserts the first line of its output.
1997 Note that shell commands are only executed once at the interval specified by
1999 .Ic status-interval
2000 option: if the status line is redrawn in the meantime, the previous result is
2001 used.
2002 Shell commands are executed with the
2004 global environment set (see the
2005 .Sx ENVIRONMENT
2006 section).
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,
2017 these may be
2018 .Ql fg=colour
2019 to set the foreground colour,
2020 .Ql bg=colour
2021 to set the background colour, the name of one of the attributes (listed under
2023 .Ic message-attr
2024 option) to turn an attribute on, or an attribute prefixed with
2025 .Ql no
2026 to turn one off, for example
2027 .Ic nobright .
2028 Examples are:
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
2036 .Ql #24T .
2038 By default, UTF-8 in
2039 .Ar string
2040 is not interpreted, to enable UTF-8, use the
2041 .Ic status-utf8
2042 option.
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
2050 Set the maximum
2051 .Ar length
2052 of the left component of the status bar.
2053 The default is 10.
2054 .It Ic status-right Ar string
2055 Display
2056 .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
2059 are shown.
2060 As with
2061 .Ic status-left ,
2062 .Ar string
2063 will be passed to
2064 .Xr strftime 3 ,
2065 character pairs are replaced, and UTF-8 is dependent on the
2066 .Ic status-utf8
2067 option.
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
2075 Set the maximum
2076 .Ar length
2077 of the right component of the status bar.
2078 The default is 40.
2079 .It Xo Ic status-utf8
2080 .Op Ic on | off
2082 Instruct
2084 to treat top-bit-set characters in the
2085 .Ic status-left
2087 .Ic status-right
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
2092 .Xr terminfo 5 .
2093 .Ar string
2094 is a comma-separated list of items each a colon-separated string made up of a
2095 terminal type pattern (matched using
2096 .Xr fnmatch 3 )
2097 and a set of
2098 .Em name=value
2099 entries.
2101 For example, to set the
2102 .Ql clear
2103 .Xr terminfo 5
2104 entry to
2105 .Ql \ee[H\ee[2J
2106 for all terminal types and the
2107 .Ql dch1
2108 entry to
2109 .Ql \ee[P
2110 for the
2111 .Ql rxvt
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
2118 .Xr strunvis 3
2119 before interpretation.
2120 The default value forcibly corrects the
2121 .Ql colors
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
2132 .Fl r
2133 was given to the
2134 .Ic set-environment
2135 command).
2136 The default is
2137 "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID
2138 XAUTHORITY".
2139 .It Xo Ic visual-activity
2140 .Op Ic on | off
2142 If on, display a status line message when activity occurs in a window
2143 for which the
2144 .Ic monitor-activity
2145 window option is enabled.
2146 .It Xo Ic visual-bell
2147 .Op Ic on | off
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).
2151 Also see the
2152 .Ic bell-action
2153 option.
2154 .It Xo Ic visual-content
2155 .Op Ic on | off
2157 Like
2158 .Ic visual-activity ,
2159 display a message when content is present in a window
2160 for which the
2161 .Ic monitor-content
2162 window option is enabled.
2163 .It Xo Ic visual-silence
2164 .Op Ic on | off
2167 .Ic monitor-silence
2168 is enabled, prints a message after the interval has expired on a given window.
2170 .It Xo Ic set-window-option
2171 .Op Fl agu
2172 .Op Fl t Ar target-window
2173 .Ar option Ar value
2175 .D1 (alias: Ic setw )
2176 Set a window option.
2178 .Fl a ,
2179 .Fl g
2181 .Fl u
2182 flags work similarly to the
2183 .Ic set-option
2184 command.
2186 Supported window options are:
2188 .Bl -tag -width Ds -compact
2189 .It Xo Ic aggressive-resize
2190 .Op Ic on | off
2192 Aggressively resize the chosen window.
2193 This means that
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
2199 .Dv SIGWINCH
2200 and poor for interactive programs such as shells.
2202 .It Xo Ic alternate-screen
2203 .Op Ic on | off
2205 This option configures whether programs running inside
2207 may use the terminal alternate screen feature, which allows the
2208 .Em smcup
2210 .Em rmcup
2211 .Xr terminfo 5
2212 capabilities.
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.
2216 The default is on.
2218 .It Xo Ic automatic-rename
2219 .Op Ic on | off
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
2228 .Ic new-window
2230 .Ic new-session ,
2231 or later with
2232 .Ic rename-window .
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
2239 Set clock colour.
2241 .It Xo Ic clock-mode-style
2242 .Op Ic 12 | 24
2244 Set clock hour format.
2246 .It Ic force-height Ar height
2247 .It Ic force-width Ar width
2248 Prevent
2250 from resizing a window to greater than
2251 .Ar width
2253 .Ar height .
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
2259 .Ic main-horizontal
2261 .Ic main-vertical
2262 layouts.
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.
2273 .It Xo Ic mode-keys
2274 .Op Ic vi | emacs
2276 Use vi or emacs-style key bindings in copy and choice modes.
2277 As with the
2278 .Ic status-keys
2279 option, the default is emacs, unless
2280 .Ev VISUAL
2282 .Ev EDITOR
2283 contains
2284 .Ql vi .
2286 .It Xo Ic mode-mouse
2287 .Op Ic on | off
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
2294 .Op Ic on | off
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.
2301 When
2302 .Xr fnmatch 3
2303 pattern
2304 .Ar match-string
2305 appears in the window, it is highlighted in the status line.
2307 .It Xo Ic monitor-silence
2308 .Op Ic interval
2310 Monitor for silence (no activity) in the window within
2311 .Ic interval
2312 seconds.
2313 Windows that have been silent for the interval are highlighted in the
2314 status line.
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
2319 .Ic main-horizontal
2320 layout.
2321 If this option is set to 0 (the default), it will have no effect.
2322 If both the
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
2330 Like
2331 .Ic other-pane-height ,
2332 but set the width of other panes in the
2333 .Ic main-vertical
2334 layout.
2336 .It Xo Ic remain-on-exit
2337 .Op Ic on | off
2339 A window with this flag set is not destroyed when the program running in it
2340 exits.
2341 The window may be reactivated with the
2342 .Ic respawn-window
2343 command.
2345 .It Xo Ic synchronize-panes
2346 .Op Ic on | off
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).
2351 .It Xo Ic utf8
2352 .Op Ic on | off
2354 Instructs
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.
2369 See the
2370 .Ar status-left
2371 option for details of special character sequences available.
2372 The default is
2373 .Ql #I:#W#F .
2375 .It Ic window-status-alert-attr Ar attributes
2376 Set status line attributes for windows which have an alert (bell, activity
2377 or content).
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
2395 Like
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
2402 copy mode.
2403 The default is
2404 .Ql \ -_@ .
2406 .It Xo Ic xterm-keys
2407 .Op Ic on | off
2409 If this option is set,
2411 will generate
2412 .Xr xterm 1 -style
2413 function key sequences; these have a number included to indicate modifiers such
2414 as Shift, Alt or Ctrl.
2415 The default is off.
2417 .It Xo Ic show-options
2418 .Op Fl gsw
2419 .Op Fl t Ar target-session | Ar target-window
2421 .D1 (alias: Ic show )
2422 Show the window options with
2423 .Fl w
2424 (equivalent to
2425 .Ic show-window-options ) ,
2426 the server options with
2427 .Fl s ,
2428 otherwise the session options for
2429 .Ar target session .
2430 Global session or window options are listed if
2431 .Fl g
2432 is used.
2433 .It Xo Ic show-window-options
2434 .Op Fl g
2435 .Op Fl t Ar target-window
2437 .D1 (alias: Ic showw )
2438 List the window options for
2439 .Ar target-window ,
2440 or the global window options if
2441 .Fl g
2442 is used.
2444 .Sh ENVIRONMENT
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
2461 .Ev TMUX
2462 variable with some internal information to allow commands to be executed
2463 from inside, and the
2464 .Ev TERM
2465 variable with the correct terminal setting of
2466 .Ql screen .
2468 Commands to alter and view the environment are:
2469 .Bl -tag -width Ds
2470 .It Xo Ic set-environment
2471 .Op Fl gru
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.
2478 .Fl g
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 .
2483 .Fl u
2484 flag unsets a variable.
2485 .Fl r
2486 indicates the variable is to be removed from the environment before starting a
2487 new process.
2488 .It Xo Ic show-environment
2489 .Op Fl g
2490 .Op Fl t Ar target-session
2492 .D1 (alias: Ic showenv )
2493 Display the environment for
2494 .Ar target-session
2495 or the global environment with
2496 .Fl g .
2497 Variables removed from the environment are prefixed with
2498 .Ql - .
2500 .Sh STATUS LINE
2502 includes an optional status line which is displayed in the bottom line of each
2503 terminal.
2504 By default, the status line is enabled (it may be disabled with the
2505 .Ic status
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
2512 command, see the
2513 .Ic status-left ,
2514 .Ic status-left-length ,
2515 .Ic status-right ,
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
2525 options.
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
2539 and + to the
2540 .Ic monitor-content
2541 window options.
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
2547 .Ic status-attr ,
2548 .Ic status-fg
2550 .Ic status-bg
2551 session options and individual windows using the
2552 .Ic window-status-attr ,
2553 .Ic window-status-fg
2555 .Ic window-status-bg
2556 window options.
2558 The status line is automatically refreshed at interval if it has changed, the
2559 interval may be controlled with the
2560 .Ic status-interval
2561 session option.
2563 Commands related to the status line are as follows:
2564 .Bl -tag -width Ds
2565 .It Xo Ic command-prompt
2566 .Op Fl p Ar prompts
2567 .Op Fl t Ar target-client
2568 .Op Ar template
2570 Open the command prompt in a client.
2571 This may be used from inside
2573 to execute commands interactively.
2575 .Ar template
2576 is specified, it is used as the command.
2578 .Fl p
2579 is given,
2580 .Ar prompts
2581 is a comma-separated list of prompts which are displayed in order; otherwise
2582 a single prompt is displayed, constructed from
2583 .Ar template
2584 if it is present, or
2585 .Ql \&:
2586 if not.
2587 Before the command is executed, the first occurrence of the string
2588 .Ql %%
2589 and all occurrences of
2590 .Ql %1
2591 are replaced by the response to the first prompt, the second
2592 .Ql %%
2593 and all
2594 .Ql %2
2595 are replaced with the response to the second prompt, and so on for further
2596 prompts.
2597 Up to nine prompt responses may be replaced
2599 .Ql %1
2601 .Ql %9
2602 .Pc .
2603 .It Xo Ic confirm-before
2604 .Op Fl t Ar target-client
2605 .Ar command
2607 .D1 (alias: Ic confirm )
2608 Ask for confirmation before executing
2609 .Ar command .
2610 This command works only from inside
2611 .Nm .
2612 .It Xo Ic display-message
2613 .Op Fl p
2614 .Op Fl t Ar target-client
2615 .Op Ar message
2617 .D1 (alias: Ic display )
2618 Display a message.
2620 .Fl p
2621 is given, the output is printed to stdout, otherwise it is displayed in the
2622 .Ar target-client
2623 status line.
2624 The format of
2625 .Ar message
2626 is as for
2627 .Ic status-left ,
2628 with the exception that #() are not handled.
2630 .Sh BUFFERS
2632 maintains a stack of
2633 .Em paste buffers .
2634 Up to the value of the
2635 .Ic buffer-limit
2636 option are kept; when a new buffer is added, the buffer at the bottom of the
2637 stack is removed.
2638 Buffers may be added using
2639 .Ic copy-mode
2640 or the
2641 .Ic set-buffer
2642 command, and pasted into a window using the
2643 .Ic paste-buffer
2644 command.
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
2648 .Ic history-limit
2649 option (see the
2650 .Ic set-option
2651 command above).
2653 The buffer commands are as follows:
2654 .Bl -tag -width Ds
2655 .It Xo
2656 .Ic choose-buffer
2657 .Op Fl t Ar target-window
2658 .Op Ar template
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,
2663 .Ql %%
2664 is replaced by the buffer index in
2665 .Ar template
2666 and the result executed as a command.
2668 .Ar template
2669 is not given, "paste-buffer -b '%%'" is used.
2670 This command works only from inside
2671 .Nm .
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
2678 .Ar buffer-index ,
2679 or the top buffer if not specified.
2680 .It Ic list-buffers
2681 .D1 (alias: Ic lsb )
2682 List the global buffers.
2683 .It Xo Ic load-buffer
2684 .Op Fl b Ar buffer-index
2685 .Ar path
2687 .D1 (alias: Ic loadb )
2688 Load the contents of the specified paste buffer from
2689 .Ar path .
2690 .It Xo Ic paste-buffer
2691 .Op Fl dr
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.
2699 With
2700 .Fl d ,
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
2705 .Fl s
2706 flag.
2708 .Fl r
2709 flag means to do no replacement (equivalent to a separator of LF).
2710 .It Xo Ic save-buffer
2711 .Op Fl a
2712 .Op Fl b Ar buffer-index
2713 .Ar path
2715 .D1 (alias: Ic saveb )
2716 Save the contents of the specified paste buffer to
2717 .Ar path .
2719 .Fl a
2720 option appends to rather than overwriting the file.
2721 .It Xo Ic set-buffer
2722 .Op Fl b Ar buffer-index
2723 .Ar data
2725 .D1 (alias: Ic setb )
2726 Set the contents of the specified buffer to
2727 .Ar data .
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.
2734 .Sh MISCELLANEOUS
2735 Miscellaneous commands are as follows:
2736 .Bl -tag -width Ds
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
2740 .D1 (alias: Ic if )
2741 Execute
2742 .Ar command
2744 .Ar shell-command
2745 returns success.
2746 .It Ic lock-server
2747 .D1 (alias: Ic lock )
2748 Lock each client individually by running the command specified by the
2749 .Ic lock-command
2750 option.
2751 .It Ic run-shell Ar shell-command
2752 .D1 (alias: Ic run )
2753 Execute
2754 .Ar shell-command
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.
2758 .It Ic server-info
2759 .D1 (alias: Ic info )
2760 Show server information and terminal details.
2762 .Sh FILES
2763 .Bl -tag -width "/etc/tmux.confXXX" -compact
2764 .It Pa ~/.tmux.conf
2765 Default
2767 configuration file.
2768 .It Pa /etc/tmux.conf
2769 System-wide configuration file.
2771 .Sh EXAMPLES
2772 To create a new
2774 session running
2775 .Xr vi 1 :
2777 .Dl $ tmux new-session vi
2779 Most commands have a shorter form, known as an alias.
2780 For new-session, this is
2781 .Ic new :
2783 .Dl $ tmux new vi
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
2788 $ tmux n
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
2793 .Ql C-b c
2794 (Ctrl
2795 followed by the
2796 .Ql b
2798 followed by the
2799 .Ql c
2800 key).
2802 Windows may be navigated with:
2803 .Ql C-b 0
2804 (to select window 0),
2805 .Ql C-b 1
2806 (to select window 1), and so on;
2807 .Ql C-b n
2808 to select the next window; and
2809 .Ql C-b p
2810 to select the previous window.
2812 A session may be detached using
2813 .Ql C-b d
2814 (or by an external event such as
2815 .Xr ssh 1
2816 disconnection) and reattached with:
2818 .Dl $ tmux attach-session
2820 Typing
2821 .Ql C-b \&?
2822 lists the current key bindings in the current window; up and down may be used
2823 to navigate the list or
2824 .Ql q
2825 to exit from it.
2827 Commands to be run when the
2829 server is started may be placed in the
2830 .Pa ~/.tmux.conf
2831 configuration file.
2832 Common examples include:
2834 Changing the default prefix key:
2835 .Bd -literal -offset indent
2836 set-option -g prefix C-a
2837 unbind-key C-b
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'"
2860 .Sh SEE ALSO
2861 .Xr pty 4
2862 .Sh AUTHORS
2863 .An Nicholas Marriott Aq nicm@users.sourceforge.net