Fix another stray addition that was too early. Oops.
[tmux-openbsd.git] / tmux.1
blobd958bbb1a84ea0ea3d30fa2204e77b0dd225c5ca
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 ;
138 the default socket is named
139 .Em default .
140 This option allows a different socket name to be specified, allowing several
141 independent
143 servers to be run.
144 Unlike
145 .Fl S
146 a full path is not necessary: the sockets are all created in the same
147 directory.
149 If the socket is accidentally removed, the
150 .Dv SIGUSR1
151 signal may be sent to the
153 server process to recreate it.
154 .It Fl l
155 Behave as a login shell.
156 This flag currently has no effect and is for compatibility with other shells
157 when using tmux as a login shell.
158 .It Fl q
159 Set the
160 .Ic quiet
161 server option to prevent the server sending various informational messages.
162 .It Fl S Ar socket-path
163 Specify a full alternative path to the server socket.
165 .Fl S
166 is specified, the default socket directory is not used and any
167 .Fl L
168 flag is ignored.
169 .It Fl u
171 attempts to guess if the terminal is likely to support UTF-8 by checking the
172 first of the
173 .Ev LC_ALL ,
174 .Ev LC_CTYPE
176 .Ev LANG
177 environment variables to be set for the string "UTF-8".
178 This is not always correct: the
179 .Fl u
180 flag explicitly informs
182 that UTF-8 is supported.
184 If the server is started from a client passed
185 .Fl u
186 or where UTF-8 is detected, the
187 .Ic utf8
189 .Ic status-utf8
190 options are enabled in the global window and session options respectively.
191 .It Fl v
192 Request verbose logging.
193 This option may be specified multiple times for increasing verbosity.
194 Log messages will be saved into
195 .Pa tmux-client-PID.log
197 .Pa tmux-server-PID.log
198 files in the current directory, where
199 .Em PID
200 is the PID of the server or client process.
201 .It Ar command Op Ar flags
202 This specifies one of a set of commands used to control
203 .Nm ,
204 as described in the following sections.
205 If no commands are specified, the
206 .Ic new-session
207 command is assumed.
209 .Sh KEY BINDINGS
211 may be controlled from an attached client by using a key combination of a
212 prefix key,
213 .Ql C-b
214 (Ctrl-b) by default, followed by a command key.
216 The default command key bindings are:
218 .Bl -tag -width "XXXXXXXXXX" -offset indent -compact
219 .It C-b
220 Send the prefix key (C-b) through to the application.
221 .It C-o
222 Rotate the panes in the current window forwards.
223 .It C-z
224 Suspend the
226 client.
227 .It !
228 Break the current pane out of the window.
229 .It \&"
230 Split the current pane into two, top and bottom.
231 .It #
232 List all paste buffers.
233 .It %
234 Split the current pane into two, left and right.
235 .It &
236 Kill the current window.
237 .It '
238 Prompt for a window index to select.
239 .It ,
240 Rename the current window.
241 .It -
242 Delete the most recently copied buffer of text.
243 .It .
244 Prompt for an index to move the current window.
245 .It 0 to 9
246 Select windows 0 to 9.
247 .It :
248 Enter the
250 command prompt.
251 .It ;
252 Move to the previously active pane.
253 .It =
254 Choose which buffer to paste interactively from a list.
255 .It \&?
256 List all key bindings.
257 .It D
258 Choose a client to detach.
259 .It \&[
260 Enter copy mode to copy text or view the history.
261 .It \&]
262 Paste the most recently copied buffer of text.
263 .It c
264 Create a new window.
265 .It d
266 Detach the current client.
267 .It f
268 Prompt to search for text in open windows.
269 .It i
270 Display some information about the current window.
271 .It l
272 Move to the previously selected window.
273 .It n
274 Change to the next window.
275 .It o
276 Select the next pane in the current window.
277 .It p
278 Change to the previous window.
279 .It q
280 Briefly display pane indexes.
281 .It r
282 Force redraw of the attached client.
283 .It s
284 Select a new session for the attached client interactively.
285 .It L
286 Switch the attached client back to the last session.
287 .It t
288 Show the time.
289 .It w
290 Choose the current window interactively.
291 .It x
292 Kill the current pane.
293 .It {
294 Swap the current pane with the previous pane.
295 .It }
296 Swap the current pane with the next pane.
297 .It ~
298 Show previous messages from
299 .Nm ,
300 if any.
301 .It Page Up
302 Enter copy mode and scroll one page up.
303 .It Up, Down
304 .It Left, Right
305 Change to the pane above, below, to the left, or to the right of the current
306 pane.
307 .It M-1 to M-5
308 Arrange panes in one of the five preset layouts: even-horizontal,
309 even-vertical, main-horizontal, main-vertical, or tiled.
310 .It M-n
311 Move to the next window with a bell or activity marker.
312 .It M-o
313 Rotate the panes in the current window backwards.
314 .It M-p
315 Move to the previous window with a bell or activity marker.
316 .It C-Up, C-Down
317 .It C-Left, C-Right
318 Resize the current pane in steps of one cell.
319 .It M-Up, M-Down
320 .It M-Left, M-Right
321 Resize the current pane in steps of five cells.
324 Key bindings may be changed with the
325 .Ic bind-key
327 .Ic unbind-key
328 commands.
329 .Sh COMMANDS
330 This section contains a list of the commands supported by
331 .Nm .
332 Most commands accept the optional
333 .Fl t
334 argument with one of
335 .Ar target-client ,
336 .Ar target-session
337 .Ar target-window ,
339 .Ar target-pane .
340 These specify the client, session, window or pane which a command should affect.
341 .Ar target-client
342 is the name of the
343 .Xr pty 4
344 file to which the client is connected, for example either of
345 .Pa /dev/ttyp1
347 .Pa ttyp1
348 for the client attached to
349 .Pa /dev/ttyp1 .
350 If no client is specified, the current client is chosen, if possible, or an
351 error is reported.
352 Clients may be listed with the
353 .Ic list-clients
354 command.
356 .Ar target-session
357 is either the name of a session (as listed by the
358 .Ic list-sessions
359 command) or the name of a client with the same syntax as
360 .Ar target-client ,
361 in which case the session attached to the client is used.
362 When looking for the session name,
364 initially searches for an exact match; if none is found, the session names
365 are checked for any for which
366 .Ar target-session
367 is a prefix or for which it matches as an
368 .Xr fnmatch 3
369 pattern.
370 If a single match is found, it is used as the target session; multiple matches
371 produce an error.
372 If a session is omitted, the current session is used if available; if no
373 current session is available, the most recently used is chosen.
375 .Ar target-window
376 specifies a window in the form
377 .Em session Ns \&: Ns Em window .
378 .Em session
379 follows the same rules as for
380 .Ar target-session ,
382 .Em window
383 is looked for in order: as a window index, for example mysession:1; as an exact
384 window name, such as mysession:mywindow; then as an
385 .Xr fnmatch 3
386 pattern or the start of a window name, such as mysession:mywin* or
387 mysession:mywin.
388 An empty window name specifies the next unused index if appropriate (for
389 example the
390 .Ic new-window
392 .Ic link-window
393 commands)
394 otherwise the current window in
395 .Em session
396 is chosen.
397 The special character
398 .Ql \&!
399 uses the last (previously current) window, or
400 .Ql +
402 .Ql -
403 are the next window or the previous window by number.
404 When the argument does not contain a colon,
406 first attempts to parse it as window; if that fails, an attempt is made to
407 match a session.
409 .Ar target-pane
410 takes a similar form to
411 .Ar target-window
412 but with the optional addition of a period followed by a pane index, for
413 example: mysession:mywindow.1.
414 If the pane index is omitted, the currently active pane in the specified
415 window is used.
416 If neither a colon nor period appears,
418 first attempts to use the argument as a pane index; if that fails, it is looked
419 up as for
420 .Ar target-window .
422 .Ql +
424 .Ql -
425 indicate the next or previous pane index, respectively.
426 One of the strings
427 .Em top ,
428 .Em bottom ,
429 .Em left ,
430 .Em right ,
431 .Em top-left ,
432 .Em top-right ,
433 .Em bottom-left or
434 .Em bottom-right
435 may be used instead of a pane index.
437 The special characters
438 .Ql +
440 .Ql -
441 may be followed by an offset, for example:
442 .Bd -literal -offset indent
443 select-window -t:+2
446 When dealing with a session that doesn't contain sequential window indexes,
447 they will be correctly skipped.
449 .Ar shell-command
450 arguments are
451 .Xr sh 1
452 commands.
453 These must be passed as a single item, which typically means quoting them, for
454 example:
455 .Bd -literal -offset indent
456 new-window 'vi /etc/passwd'
459 .Ar command
460 .Op Ar arguments
461 refers to a
463 command, passed with the command and arguments separately, for example:
464 .Bd -literal -offset indent
465 bind-key F1 set-window-option force-width 81
468 Or if using
469 .Xr sh 1 :
470 .Bd -literal -offset indent
471 $ tmux bind-key F1 set-window-option force-width 81
474 Multiple commands may be specified together as part of a
475 .Em command sequence .
476 Each command should be separated by spaces and a semicolon;
477 commands are executed sequentially from left to right.
478 A literal semicolon may be included by escaping it with a backslash (for
479 example, when specifying a command sequence to
480 .Ic bind-key ) .
482 Example
484 commands include:
485 .Bd -literal -offset indent
486 refresh-client -t/dev/ttyp2
488 rename-session -tfirst newname
490 set-window-option -t:0 monitor-activity on
492 new-window ; split-window -d
495 Or from
496 .Xr sh 1 :
497 .Bd -literal -offset indent
498 $ tmux kill-window -t :1
500 $ tmux new-window \e; split-window -d
502 $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
504 .Sh CLIENTS AND SESSIONS
507 server manages clients, sessions, windows and panes.
508 Clients are attached to sessions to interact with them, either
509 when they are created with the
510 .Ic new-session
511 command, or later with the
512 .Ic attach-session
513 command.
514 Each session has one or more windows
515 .Em linked
516 into it.
517 Windows may be linked to multiple sessions and are made up of one or
518 more panes,
519 each of which contains a pseudo terminal.
520 Commands for creating, linking and otherwise manipulating windows
521 are covered
522 in the
523 .Sx WINDOWS AND PANES
524 section.
526 The following commands are available to manage clients and sessions:
527 .Bl -tag -width Ds
528 .It Xo Ic attach-session
529 .Op Fl dr
530 .Op Fl t Ar target-session
532 .D1 (alias: Ic attach )
533 If run from outside
534 .Nm ,
535 create a new client in the current terminal and attach it to
536 .Ar target-session .
537 If used from inside, switch the current client.
539 .Fl d
540 is specified, any other clients attached to the session are detached.
541 .Fl r
542 signifies the client is read-only (only keys bound to the
543 .Ic detach-client
544 command have any effect)
546 If no server is started,
547 .Ic attach-session
548 will attempt to start it; this will fail unless sessions are created in the
549 configuration file.
550 .It Ic detach-client Op Fl t Ar target-client
551 .D1 (alias: Ic detach )
552 Detach the current client if bound to a key, or the specified client with
553 .Fl t .
554 .It Ic has-session Op Fl t Ar target-session
555 .D1 (alias: Ic has )
556 Report an error and exit with 1 if the specified session does not exist.
557 If it does exist, exit with 0.
558 .It Ic kill-server
559 Kill the
561 server and clients and destroy all sessions.
562 .It Ic kill-session Op Fl t Ar target-session
563 Destroy the given session, closing any windows linked to it and no other
564 sessions, and detaching all clients attached to it.
565 .It Ic list-clients
566 .D1 (alias: Ic lsc )
567 List all clients attached to the server.
568 .It Ic list-commands
569 .D1 (alias: Ic lscm )
570 List the syntax of all commands supported by
571 .Nm .
572 .It Ic list-sessions
573 .D1 (alias: Ic ls )
574 List all sessions managed by the server.
575 .It Ic lock-client Op Fl t Ar target-client
576 .D1 (alias: Ic lockc )
577 Lock
578 .Ar target-client ,
579 see the
580 .Ic lock-server
581 command.
582 .It Ic lock-session Op Fl t Ar target-session
583 .D1 (alias: Ic locks )
584 Lock all clients attached to
585 .Ar target-session .
586 .It Xo Ic new-session
587 .Op Fl d
588 .Op Fl n Ar window-name
589 .Op Fl s Ar session-name
590 .Op Fl t Ar target-session
591 .Op Ar shell-command
593 .D1 (alias: Ic new )
594 Create a new session with name
595 .Ar session-name .
597 The new session is attached to the current terminal unless
598 .Fl d
599 is given.
600 .Ar window-name
602 .Ar shell-command
603 are the name of and shell command to execute in the initial window.
605 If run from a terminal, any
606 .Xr termios 4
607 special characters are saved and used for new windows in the new session.
610 .Fl t
611 is given, the new session is
612 .Em grouped
613 with
614 .Ar target-session .
615 This means they share the same set of windows - all windows from
616 .Ar target-session
617 are linked to the new session and any subsequent new windows or windows being
618 closed are applied to both sessions.
619 The current and previous window and any session options remain independent and
620 either session may be killed without affecting the other.
621 Giving
622 .Fl n
624 .Ar shell-command
625 are invalid if
626 .Fl t
627 is used.
628 .It Ic refresh-client Op Fl t Ar target-client
629 .D1 (alias: Ic refresh )
630 Refresh the current client if bound to a key, or a single client if one is given
631 with
632 .Fl t .
633 .It Xo Ic rename-session
634 .Op Fl t Ar target-session
635 .Ar new-name
637 .D1 (alias: Ic rename )
638 Rename the session to
639 .Ar new-name .
640 .It Xo Ic show-messages
641 .Op Fl t Ar target-client
643 .D1 (alias: Ic showmsgs )
644 Any messages displayed on the status line are saved in a per-client message
645 log, up to a maximum of the limit set by the
646 .Ar message-limit
647 session option for the session attached to that client.
648 This command displays the log for
649 .Ar target-client .
650 .It Ic source-file Ar path
651 .D1 (alias: Ic source )
652 Execute commands from
653 .Ar path .
654 .It Ic start-server
655 .D1 (alias: Ic start )
656 Start the
658 server, if not already running, without creating any sessions.
659 .It Xo Ic suspend-client
660 .Op Fl c Ar target-client
662 .D1 (alias: Ic suspendc )
663 Suspend a client by sending
664 .Dv SIGTSTP
665 (tty stop).
666 .It Xo Ic switch-client
667 .Op Fl lnp
668 .Op Fl c Ar target-client
669 .Op Fl t Ar target-session
671 .D1 (alias: Ic switchc )
672 Switch the current session for client
673 .Ar target-client
675 .Ar target-session .
677 .Fl l,
678 .Fl n
680 .Fl p
681 is used, the client is moved to the last, next or previous session
682 respectively.
684 .Sh WINDOWS AND PANES
687 window may be in one of several modes.
688 The default permits direct access to the terminal attached to the window.
689 The other is copy mode, which permits a section of a window or its
690 history to be copied to a
691 .Em paste buffer
692 for later insertion into another window.
693 This mode is entered with the
694 .Ic copy-mode
695 command, bound to
696 .Ql \&[
697 by default.
698 It is also entered when a command that produces output, such as
699 .Ic list-keys ,
700 is executed from a key binding.
702 The keys available depend on whether emacs or vi mode is selected
703 (see the
704 .Ic mode-keys
705 option).
706 The following keys are supported as appropriate for the mode:
707 .Bl -column "FunctionXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
708 .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
709 .It Li "Back to indentation" Ta "^" Ta "M-m"
710 .It Li "Bottom of history" Ta "G" Ta "M-<"
711 .It Li "Clear selection" Ta "Escape" Ta "C-g"
712 .It Li "Copy selection" Ta "Enter" Ta "M-w"
713 .It Li "Cursor down" Ta "j" Ta "Down"
714 .It Li "Cursor left" Ta "h" Ta "Left"
715 .It Li "Cursor right" Ta "l" Ta "Right"
716 .It Li "Cursor to bottom line" Ta "L" Ta ""
717 .It Li "Cursor to middle line" Ta "M" Ta "M-r"
718 .It Li "Cursor to top line" Ta "H" Ta "M-R"
719 .It Li "Cursor up" Ta "k" Ta "Up"
720 .It Li "Delete entire line" Ta "d" Ta "C-u"
721 .It Li "Delete to end of line" Ta "D" Ta "C-k"
722 .It Li "End of line" Ta "$" Ta "C-e"
723 .It Li "Go to line" Ta ":" Ta "g"
724 .It Li "Half page down" Ta "C-d" Ta "M-Down"
725 .It Li "Half page up" Ta "C-u" Ta "M-Up"
726 .It Li "Jump forward" Ta "f" Ta "f"
727 .It Li "Jump backward" Ta "F" Ta "F"
728 .It Li "Jump again" Ta ";" Ta ";"
729 .It Li "Jump again in reverse" Ta "," Ta ","
730 .It Li "Next page" Ta "C-f" Ta "Page down"
731 .It Li "Next space" Ta "W" Ta ""
732 .It Li "Next space, end of word" Ta "E" Ta ""
733 .It Li "Next word" Ta "w" Ta ""
734 .It Li "Next word end" Ta "e" Ta "M-f"
735 .It Li "Paste buffer" Ta "p" Ta "C-y"
736 .It Li "Previous page" Ta "C-b" Ta "Page up"
737 .It Li "Previous word" Ta "b" Ta "M-b"
738 .It Li "Previous space" Ta "B" Ta ""
739 .It Li "Quit mode" Ta "q" Ta "Escape"
740 .It Li "Rectangle toggle" Ta "v" Ta "R"
741 .It Li "Scroll down" Ta "C-Down or C-e" Ta "C-Down"
742 .It Li "Scroll up" Ta "C-Up or C-y" Ta "C-Up"
743 .It Li "Search again" Ta "n" Ta "n"
744 .It Li "Search again in reverse" Ta "N" Ta "N"
745 .It Li "Search backward" Ta "?" Ta "C-r"
746 .It Li "Search forward" Ta "/" Ta "C-s"
747 .It Li "Start of line" Ta "0" Ta "C-a"
748 .It Li "Start selection" Ta "Space" Ta "C-Space"
749 .It Li "Top of history" Ta "g" Ta "M->"
750 .It Li "Transpose chars" Ta "" Ta "C-t"
753 The next and previous word keys use space and the
754 .Ql - ,
755 .Ql _
757 .Ql @
758 characters as word delimiters by default, but this can be adjusted by
759 setting the
760 .Em word-separators
761 window option.
762 Next word moves to the start of the next word, next word end to the end of the
763 next word and previous word to the start of the previous word.
764 The three next and previous space keys work similarly but use a space alone as
765 the word separator.
767 The jump commands enable quick movement within a line.
768 For instance, typing
769 .Ql f
770 followed by
771 .Ql /
772 will move the cursor to the next
773 .Ql /
774 character on the current line.
776 .Ql \&;
777 will then jump to the next occurrence.
779 Commands in copy mode may be prefaced by an optional repeat count.
780 With vi key bindings, a prefix is entered using the number keys; with
781 emacs, the Alt (meta) key and a number begins prefix entry.
782 For example, to move the cursor forward by ten words, use
783 .Ql M-1 0 M-f
784 in emacs mode, and
785 .Ql 10w
786 in vi.
788 Mode key bindings are defined in a set of named tables:
789 .Em vi-edit
791 .Em emacs-edit
792 for keys used when line editing at the command prompt;
793 .Em vi-choice
795 .Em emacs-choice
796 for keys used when choosing from lists (such as produced by the
797 .Ic choose-window
798 command); and
799 .Em vi-copy
801 .Em emacs-copy
802 used in copy mode.
803 The tables may be viewed with the
804 .Ic list-keys
805 command and keys modified or removed with
806 .Ic bind-key
808 .Ic unbind-key .
810 The paste buffer key pastes the first line from the top paste buffer on the
811 stack.
813 The synopsis for the
814 .Ic copy-mode
815 command is:
816 .Bl -tag -width Ds
817 .It Xo Ic copy-mode
818 .Op Fl u
819 .Op Fl t Ar target-pane
821 Enter copy mode.
823 .Fl u
824 option scrolls one page up.
827 Each window displayed by
829 may be split into one or more
830 .Em panes ;
831 each pane takes up a certain area of the display and is a separate terminal.
832 A window may be split into panes using the
833 .Ic split-window
834 command.
835 Windows may be split horizontally (with the
836 .Fl h
837 flag) or vertically.
838 Panes may be resized with the
839 .Ic resize-pane
840 command (bound to
841 .Ql C-up ,
842 .Ql C-down
843 .Ql C-left
845 .Ql C-right
846 by default), the current pane may be changed with the
847 .Ic select-pane
848 command and the
849 .Ic rotate-window
851 .Ic swap-pane
852 commands may be used to swap panes without changing their position.
853 Panes are numbered beginning from zero in the order they are created.
855 A number of preset
856 .Em layouts
857 are available.
858 These may be selected with the
859 .Ic select-layout
860 command or cycled with
861 .Ic next-layout
862 (bound to
863 .Ql Space
864 by default); once a layout is chosen, panes within it may be moved and resized
865 as normal.
867 The following layouts are supported:
868 .Bl -tag -width Ds
869 .It Ic even-horizontal
870 Panes are spread out evenly from left to right across the window.
871 .It Ic even-vertical
872 Panes are spread evenly from top to bottom.
873 .It Ic main-horizontal
874 A large (main) pane is shown at the top of the window and the remaining panes
875 are spread from left to right in the leftover space at the bottom.
876 Use the
877 .Em main-pane-height
878 window option to specify the height of the top pane.
879 .It Ic main-vertical
880 Similar to
881 .Ic main-horizontal
882 but the large pane is placed on the left and the others spread from top to
883 bottom along the right.
884 See the
885 .Em main-pane-width
886 window option.
887 .It Ic tiled
888 Panes are spread out as evenly as possible over the window in both rows and
889 columns.
892 In addition,
893 .Ic select-layout
894 may be used to apply a previously used layout - the
895 .Ic list-windows
896 command displays the layout of each window in a form suitable for use with
897 .Ic select-layout .
898 For example:
899 .Bd -literal -offset indent
900 $ tmux list-windows
901 0: ksh [159x48]
902     layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
903 $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
906 automatically adjusts the size of the layout for the current window size.
907 Note that a layout cannot be applied to a window with more panes than that
908 from which the layout was originally defined.
910 Commands related to windows and panes are as follows:
911 .Bl -tag -width Ds
912 .It Xo Ic break-pane
913 .Op Fl d
914 .Op Fl t Ar target-pane
916 .D1 (alias: Ic breakp )
917 Break
918 .Ar target-pane
919 off from its containing window to make it the only pane in a new window.
921 .Fl d
922 is given, the new window does not become the current window.
923 .It Xo Ic capture-pane
924 .Op Fl b Ar buffer-index
925 .Op Fl t Ar target-pane
927 .D1 (alias: Ic capturep )
928 Capture the contents of a pane to the specified buffer, or a new buffer if none
929 is specified.
930 .It Xo
931 .Ic choose-client
932 .Op Fl t Ar target-window
933 .Op Ar template
935 Put a window into client choice mode, allowing a client to be selected
936 interactively from a list.
937 After a client is chosen,
938 .Ql %%
939 is replaced by the client
940 .Xr pty 4
941 path in
942 .Ar template
943 and the result executed as a command.
945 .Ar template
946 is not given, "detach-client -t '%%'" is used.
947 This command works only from inside
948 .Nm .
949 .It Xo
950 .Ic choose-session
951 .Op Fl t Ar target-window
952 .Op Ar template
954 Put a window into session choice mode, where a session may be selected
955 interactively from a list.
956 When one is chosen,
957 .Ql %%
958 is replaced by the session name in
959 .Ar template
960 and the result executed as a command.
962 .Ar template
963 is not given, "switch-client -t '%%'" is used.
964 This command works only from inside
965 .Nm .
966 .It Xo
967 .Ic choose-window
968 .Op Fl t Ar target-window
969 .Op Ar template
971 Put a window into window choice mode, where a window may be chosen
972 interactively from a list.
973 After a window is selected,
974 .Ql %%
975 is replaced by the session name and window index in
976 .Ar template
977 and the result executed as a command.
979 .Ar template
980 is not given, "select-window -t '%%'" is used.
981 This command works only from inside
982 .Nm .
983 .It Ic display-panes Op Fl t Ar target-client
984 .D1 (alias: Ic displayp)
985 Display a visible indicator of each pane shown by
986 .Ar target-client .
987 See the
988 .Ic display-panes-time ,
989 .Ic display-panes-colour ,
991 .Ic display-panes-active-colour
992 session options.
993 While the indicator is on screen, a pane may be selected with the
994 .Ql 0
996 .Ql 9
997 keys.
998 .It Xo Ic find-window
999 .Op Fl t Ar target-window
1000 .Ar match-string
1002 .D1 (alias: Ic findw )
1003 Search for the
1004 .Xr fnmatch 3
1005 pattern
1006 .Ar match-string
1007 in window names, titles, and visible content (but not history).
1008 If only one window is matched, it'll be automatically selected, otherwise a
1009 choice list is shown.
1010 This command only works from inside
1011 .Nm .
1012 .It Xo Ic join-pane
1013 .Op Fl dhv
1014 .Oo Fl l
1015 .Ar size |
1016 .Fl p Ar percentage Oc
1017 .Op Fl s Ar src-pane
1018 .Op Fl t Ar dst-pane
1020 .D1 (alias: Ic joinp )
1021 Like
1022 .Ic split-window ,
1023 but instead of splitting
1024 .Ar dst-pane
1025 and creating a new pane, split it and move
1026 .Ar src-pane
1027 into the space.
1028 This can be used to reverse
1029 .Ic break-pane .
1030 .It Xo Ic kill-pane
1031 .Op Fl a
1032 .Op Fl t Ar target-pane
1034 .D1 (alias: Ic killp )
1035 Destroy the given pane.
1036 If no panes remain in the containing window, it is also destroyed.
1038 .Fl a
1039 option kills all but the pane given with
1040 .Fl t .
1041 .It Ic kill-window Op Fl t Ar target-window
1042 .D1 (alias: Ic killw )
1043 Kill the current window or the window at
1044 .Ar target-window ,
1045 removing it from any sessions to which it is linked.
1046 .It Ic last-pane Op Fl t Ar target-window
1047 .D1 (alias: Ic lastp )
1048 Select the last (previously selected) pane.
1049 .It Ic last-window Op Fl t Ar target-session
1050 .D1 (alias: Ic last )
1051 Select the last (previously selected) window.
1052 If no
1053 .Ar target-session
1054 is specified, select the last window of the current session.
1055 .It Xo Ic link-window
1056 .Op Fl dk
1057 .Op Fl s Ar src-window
1058 .Op Fl t Ar dst-window
1060 .D1 (alias: Ic linkw )
1061 Link the window at
1062 .Ar src-window
1063 to the specified
1064 .Ar dst-window .
1066 .Ar dst-window
1067 is specified and no such window exists, the
1068 .Ar src-window
1069 is linked there.
1071 .Fl k
1072 is given and
1073 .Ar dst-window
1074 exists, it is killed, otherwise an error is generated.
1076 .Fl d
1077 is given, the newly linked window is not selected.
1078 .It Ic list-panes Op Fl t Ar target-window
1079 .D1 (alias: Ic lsp )
1080 List the panes in the current window or in
1081 .Ar target-window .
1082 .It Ic list-windows Op Fl t Ar target-session
1083 .D1 (alias: Ic lsw )
1084 List windows in the current session or in
1085 .Ar target-session .
1086 .It Xo Ic move-window
1087 .Op Fl dk
1088 .Op Fl s Ar src-window
1089 .Op Fl t Ar dst-window
1091 .D1 (alias: Ic movew )
1092 This is similar to
1093 .Ic link-window ,
1094 except the window at
1095 .Ar src-window
1096 is moved to
1097 .Ar dst-window .
1098 .It Xo Ic new-window
1099 .Op Fl adk
1100 .Op Fl n Ar window-name
1101 .Op Fl t Ar target-window
1102 .Op Ar shell-command
1104 .D1 (alias: Ic neww )
1105 Create a new window.
1106 With
1107 .Fl a ,
1108 the new window is inserted at the next index up from the specified
1109 .Ar target-window ,
1110 moving windows up if necessary,
1111 otherwise
1112 .Ar target-window
1113 is the new window location.
1116 .Fl d
1117 is given, the session does not make the new window the current window.
1118 .Ar target-window
1119 represents the window to be created; if the target already exists an error is
1120 shown, unless the
1121 .Fl k
1122 flag is used, in which case it is destroyed.
1123 .Ar shell-command
1124 is the command to execute.
1126 .Ar shell-command
1127 is not specified, the value of the
1128 .Ic default-command
1129 option is used.
1131 When the shell command completes, the window closes.
1132 See the
1133 .Ic remain-on-exit
1134 option to change this behaviour.
1137 .Ev TERM
1138 environment variable must be set to
1139 .Dq screen
1140 for all programs running
1141 .Em inside
1142 .Nm .
1143 New windows will automatically have
1144 .Dq TERM=screen
1145 added to their environment, but care must be taken not to reset this in shell
1146 start-up files.
1147 .It Ic next-layout Op Fl t Ar target-window
1148 .D1 (alias: Ic nextl )
1149 Move a window to the next layout and rearrange the panes to fit.
1150 .It Xo Ic next-window
1151 .Op Fl a
1152 .Op Fl t Ar target-session
1154 .D1 (alias: Ic next )
1155 Move to the next window in the session.
1157 .Fl a
1158 is used, move to the next window with a bell, activity or content alert.
1159 .It Xo Ic pipe-pane
1160 .Op Fl o
1161 .Op Fl t Ar target-pane
1162 .Op Ar shell-command
1164 .D1 (alias: Ic pipep )
1165 Pipe any output sent by the program in
1166 .Ar target-pane
1167 to a shell command.
1168 A pane may only be piped to one command at a time, any existing pipe is
1169 closed before
1170 .Ar shell-command
1171 is executed.
1173 .Ar shell-command
1174 string may contain the special character sequences supported by the
1175 .Ic status-left
1176 command.
1177 If no
1178 .Ar shell-command
1179 is given, the current pipe (if any) is closed.
1182 .Fl o
1183 option only opens a new pipe if no previous pipe exists, allowing a pipe to
1184 be toggled with a single key, for example:
1185 .Bd -literal -offset indent
1186 bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1188 .It Xo Ic previous-layout
1189 .Op Fl t Ar target-window
1191 .D1 (alias: Ic prevl )
1192 Move to the previous layout in the session.
1193 .It Xo Ic previous-window
1194 .Op Fl a
1195 .Op Fl t Ar target-session
1197 .D1 (alias: Ic prev )
1198 Move to the previous window in the session.
1199 With
1200 .Fl a ,
1201 move to the previous window with a bell, activity or content alert.
1202 .It Xo Ic rename-window
1203 .Op Fl t Ar target-window
1204 .Ar new-name
1206 .D1 (alias: Ic renamew )
1207 Rename the current window, or the window at
1208 .Ar target-window
1209 if specified, to
1210 .Ar new-name .
1211 .It Xo Ic resize-pane
1212 .Op Fl DLRU
1213 .Op Fl t Ar target-pane
1214 .Op Ar adjustment
1216 .D1 (alias: Ic resizep )
1217 Resize a pane, upward with
1218 .Fl U
1219 (the default), downward with
1220 .Fl D ,
1221 to the left with
1222 .Fl L
1223 and to the right with
1224 .Fl R .
1226 .Ar adjustment
1227 is given in lines or cells (the default is 1).
1228 .It Xo Ic respawn-window
1229 .Op Fl k
1230 .Op Fl t Ar target-window
1231 .Op Ar shell-command
1233 .D1 (alias: Ic respawnw )
1234 Reactivate a window in which the command has exited (see the
1235 .Ic remain-on-exit
1236 window option).
1238 .Ar shell-command
1239 is not given, the command used when the window was created is executed.
1240 The window must be already inactive, unless
1241 .Fl k
1242 is given, in which case any existing command is killed.
1243 .It Xo Ic rotate-window
1244 .Op Fl DU
1245 .Op Fl t Ar target-window
1247 .D1 (alias: Ic rotatew )
1248 Rotate the positions of the panes within a window, either upward (numerically
1249 lower) with
1250 .Fl U
1251 or downward (numerically higher).
1252 .It Xo Ic select-layout
1253 .Op Fl t Ar target-window
1254 .Op Ar layout-name
1256 .D1 (alias: Ic selectl )
1257 Choose a specific layout for a window.
1259 .Ar layout-name
1260 is not given, the last preset layout used (if any) is reapplied.
1261 .It Xo Ic select-pane
1262 .Op Fl DLRU
1263 .Op Fl t Ar target-pane
1265 .D1 (alias: Ic selectp )
1266 Make pane
1267 .Ar target-pane
1268 the active pane in window
1269 .Ar target-window .
1270 If one of
1271 .Fl D ,
1272 .Fl L ,
1273 .Fl R ,
1275 .Fl U
1276 is used, respectively the pane below, to the left, to the right, or above the
1277 target pane is used.
1278 .It Ic select-window Op Fl t Ar target-window
1279 .D1 (alias: Ic selectw )
1280 Select the window at
1281 .Ar target-window .
1282 .It Xo Ic split-window
1283 .Op Fl dhv
1284 .Oo Fl l
1285 .Ar size |
1286 .Fl p Ar percentage Oc
1287 .Op Fl t Ar target-pane
1288 .Op Ar shell-command
1290 .D1 (alias: Ic splitw )
1291 Create a new pane by splitting
1292 .Ar target-pane :
1293 .Fl h
1294 does a horizontal split and
1295 .Fl v
1296 a vertical split; if neither is specified,
1297 .Fl v
1298 is assumed.
1300 .Fl l
1302 .Fl p
1303 options specify the size of the new pane in lines (for vertical split) or in
1304 cells (for horizontal split), or as a percentage, respectively.
1305 All other options have the same meaning as for the
1306 .Ic new-window
1307 command.
1308 .It Xo Ic swap-pane
1309 .Op Fl dDU
1310 .Op Fl s Ar src-pane
1311 .Op Fl t Ar dst-pane
1313 .D1 (alias: Ic swapp )
1314 Swap two panes.
1316 .Fl U
1317 is used and no source pane is specified with
1318 .Fl s ,
1319 .Ar dst-pane
1320 is swapped with the previous pane (before it numerically);
1321 .Fl D
1322 swaps with the next pane (after it numerically).
1323 .Fl d
1324 instructs
1326 not to change the active pane.
1327 .It Xo Ic swap-window
1328 .Op Fl d
1329 .Op Fl s Ar src-window
1330 .Op Fl t Ar dst-window
1332 .D1 (alias: Ic swapw )
1333 This is similar to
1334 .Ic link-window ,
1335 except the source and destination windows are swapped.
1336 It is an error if no window exists at
1337 .Ar src-window .
1338 .It Xo Ic unlink-window
1339 .Op Fl k
1340 .Op Fl t Ar target-window
1342 .D1 (alias: Ic unlinkw )
1343 Unlink
1344 .Ar target-window .
1345 Unless
1346 .Fl k
1347 is given, a window may be unlinked only if it is linked to multiple sessions -
1348 windows may not be linked to no sessions;
1350 .Fl k
1351 is specified and the window is linked to only one session, it is unlinked and
1352 destroyed.
1354 .Sh KEY BINDINGS
1356 allows a command to be bound to most keys, with or without a prefix key.
1357 When specifying keys, most represent themselves (for example
1358 .Ql A
1360 .Ql Z ) .
1361 Ctrl keys may be prefixed with
1362 .Ql C-
1364 .Ql ^ ,
1365 and Alt (meta) with
1366 .Ql M- .
1367 In addition, the following special key names are accepted:
1368 .Em Up ,
1369 .Em Down ,
1370 .Em Left ,
1371 .Em Right ,
1372 .Em BSpace ,
1373 .Em BTab ,
1374 .Em DC
1375 (Delete),
1376 .Em End ,
1377 .Em Enter ,
1378 .Em Escape ,
1379 .Em F1
1381 .Em F20 ,
1382 .Em Home ,
1383 .Em IC
1384 (Insert),
1385 .Em NPage
1386 (Page Up),
1387 .Em PPage
1388 (Page Down),
1389 .Em Space ,
1391 .Em Tab .
1392 Note that to bind the
1393 .Ql \&"
1395 .Ql '
1396 keys, quotation marks are necessary, for example:
1397 .Bd -literal -offset indent
1398 bind-key '"' split-window
1399 bind-key "'" new-window
1402 Commands related to key bindings are as follows:
1403 .Bl -tag -width Ds
1404 .It Xo Ic bind-key
1405 .Op Fl cnr
1406 .Op Fl t Ar key-table
1407 .Ar key Ar command Op Ar arguments
1409 .D1 (alias: Ic bind )
1410 Bind key
1411 .Ar key
1413 .Ar command .
1414 By default (without
1415 .Fl t )
1416 the primary key bindings are modified (those normally activated with the prefix
1417 key); in this case, if
1418 .Fl n
1419 is specified, it is not necessary to use the prefix key,
1420 .Ar command
1421 is bound to
1422 .Ar key
1423 alone.
1425 .Fl r
1426 flag indicates this key may repeat, see the
1427 .Ic repeat-time
1428 option.
1431 .Fl t
1432 is present,
1433 .Ar key
1434 is bound in
1435 .Ar key-table :
1436 the binding for command mode with
1437 .Fl c
1438 or for normal mode without.
1439 To view the default bindings and possible commands, see the
1440 .Ic list-keys
1441 command.
1442 .It Ic list-keys Op Fl t Ar key-table
1443 .D1 (alias: Ic lsk )
1444 List all key bindings.
1445 Without
1446 .Fl t
1447 the primary key bindings - those executed when preceded by the prefix key -
1448 are printed.
1449 Keys bound without the prefix key (see
1450 .Ic bind-key
1451 .Fl n )
1452 are marked with
1453 .Ql (no prefix) .
1455 With
1456 .Fl t ,
1457 the key bindings in
1458 .Ar key-table
1459 are listed; this may be one of:
1460 .Em vi-edit ,
1461 .Em emacs-edit ,
1462 .Em vi-choice ,
1463 .Em emacs-choice ,
1464 .Em vi-copy
1466 .Em emacs-copy .
1467 .It Xo Ic send-keys
1468 .Op Fl t Ar target-pane
1469 .Ar key Ar ...
1471 .D1 (alias: Ic send )
1472 Send a key or keys to a window.
1473 Each argument
1474 .Ar key
1475 is the name of the key (such as
1476 .Ql C-a
1478 .Ql npage
1479 ) to send; if the string is not recognised as a key, it is sent as a series of
1480 characters.
1481 All arguments are sent sequentially from first to last.
1482 .It Ic send-prefix Op Fl t Ar target-pane
1483 Send the prefix key to a window as if it was pressed.
1484 If multiple prefix keys are configured, only the first is sent.
1485 .It Xo Ic unbind-key
1486 .Op Fl acn
1487 .Op Fl t Ar key-table
1488 .Ar key
1490 .D1 (alias: Ic unbind )
1491 Unbind the command bound to
1492 .Ar key .
1493 Without
1494 .Fl t
1495 the primary key bindings are modified; in this case, if
1496 .Fl n
1497 is specified, the command bound to
1498 .Ar key
1499 without a prefix (if any) is removed.
1501 .Fl a
1502 is present, all key bindings are removed.
1505 .Fl t
1506 is present,
1507 .Ar key
1509 .Ar key-table
1510 is unbound: the binding for command mode with
1511 .Fl c
1512 or for normal mode without.
1514 .Sh OPTIONS
1515 The appearance and behaviour of
1517 may be modified by changing the value of various options.
1518 There are three types of option:
1519 .Em server options ,
1520 .Em session options
1522 .Em window options .
1526 server has a set of global options which do not apply to any particular
1527 window or session.
1528 These are altered with the
1529 .Ic set-option
1530 .Fl s
1531 command, or displayed with the
1532 .Ic show-options
1533 .Fl s
1534 command.
1536 In addition, each individual session may have a set of session options, and
1537 there is a separate set of global session options.
1538 Sessions which do not have a particular option configured inherit the value
1539 from the global session options.
1540 Session options are set or unset with the
1541 .Ic set-option
1542 command and may be listed with the
1543 .Ic show-options
1544 command.
1545 The available server and session options are listed under the
1546 .Ic set-option
1547 command.
1549 Similarly, a set of window options is attached to each window, and there is
1550 a set of global window options from which any unset options are inherited.
1551 Window options are altered with the
1552 .Ic set-window-option
1553 command and can be listed with the
1554 .Ic show-window-options
1555 command.
1556 All window options are documented with the
1557 .Ic set-window-option
1558 command.
1560 Commands which set options are as follows:
1561 .Bl -tag -width Ds
1562 .It Xo Ic set-option
1563 .Op Fl agsuw
1564 .Op Fl t Ar target-session | Ar target-window
1565 .Ar option Ar value
1567 .D1 (alias: Ic set )
1568 Set a window option with
1569 .Fl w
1570 (equivalent to the
1571 .Ic set-window-option
1572 command),
1573 a server option with
1574 .Fl s ,
1575 otherwise a session option.
1578 .Fl g
1579 is specified, the global session or window option is set.
1580 With
1581 .Fl a ,
1582 and if the option expects a string,
1583 .Ar value
1584 is appended to the existing setting.
1586 .Fl u
1587 flag unsets an option, so a session inherits the option from the global
1588 options.
1589 It is not possible to unset a global option.
1591 Available window options are listed under
1592 .Ic set-window-option .
1594 Available server options are:
1595 .Bl -tag -width Ds
1596 .It Ic escape-time
1597 Set the time in milliseconds for which
1599 waits after an escape is input to determine if it is part of a function or meta
1600 key sequences.
1601 The default is 500 milliseconds.
1602 .It Ic exit-unattached
1603 If enabled, the server will exit when there are no attached clients, rather
1604 than when there are no attached sessions.
1605 .It Ic quiet
1606 Enable or disable the display of various informational messages (see also the
1607 .Fl q
1608 command line flag).
1611 Available session options are:
1612 .Bl -tag -width Ds
1613 .It Ic base-index Ar index
1614 Set the base index from which an unused index should be searched when a new
1615 window is created.
1616 The default is zero.
1617 .It Xo Ic bell-action
1618 .Op Ic any | none | current
1620 Set action on window bell.
1621 .Ic any
1622 means a bell in any window linked to a session causes a bell in the current
1623 window of that session,
1624 .Ic none
1625 means all bells are ignored and
1626 .Ic current
1627 means only bell in windows other than the current window are ignored.
1628 .It Ic buffer-limit Ar number
1629 Set the number of buffers kept for each session; as new buffers are added to
1630 the top of the stack, old ones are removed from the bottom if necessary to
1631 maintain this maximum length.
1632 .It Ic default-command Ar shell-command
1633 Set the command used for new windows (if not specified when the window is
1634 created) to
1635 .Ar shell-command ,
1636 which may be any
1637 .Xr sh 1
1638 command.
1639 The default is an empty string, which instructs
1641 to create a login shell using the value of the
1642 .Ic default-shell
1643 option.
1644 .It Ic default-shell Ar path
1645 Specify the default shell.
1646 This is used as the login shell for new windows when the
1647 .Ic default-command
1648 option is set to empty, and must be the full path of the executable.
1649 When started
1651 tries to set a default value from the first suitable of the
1652 .Ev SHELL
1653 environment variable, the shell returned by
1654 .Xr getpwuid 3 ,
1656 .Pa /bin/sh .
1657 This option should be configured when
1659 is used as a login shell.
1660 .It Ic default-path Ar path
1661 Set the default working directory for processes created from keys, or
1662 interactively from the prompt.
1663 The default is empty, which means to use the working directory of the shell
1664 from which the server was started if it is available or the user's home if not.
1665 .It Ic default-terminal Ar terminal
1666 Set the default terminal for new windows created in this session - the
1667 default value of the
1668 .Ev TERM
1669 environment variable.
1672 to work correctly, this
1673 .Em must
1674 be set to
1675 .Ql screen
1676 or a derivative of it.
1677 .It Ic destroy-unattached
1678 If enabled and the session is no longer attached to any clients, it is
1679 destroyed.
1680 .It Ic detach-on-destroy
1681 If on (the default), the client is detached when the session it is attached to
1682 is destroyed.
1683 If off, the client is switched to the most recently active of the remaining
1684 sessions.
1685 .It Ic display-panes-active-colour Ar colour
1686 Set the colour used by the
1687 .Ic display-panes
1688 command to show the indicator for the active pane.
1689 .It Ic display-panes-colour Ar colour
1690 Set the colour used by the
1691 .Ic display-panes
1692 command to show the indicators for inactive panes.
1693 .It Ic display-panes-time Ar time
1694 Set the time in milliseconds for which the indicators shown by the
1695 .Ic display-panes
1696 command appear.
1697 .It Ic display-time Ar time
1698 Set the amount of time for which status line messages and other on-screen
1699 indicators are displayed.
1700 .Ar time
1701 is in milliseconds.
1702 .It Ic history-limit Ar lines
1703 Set the maximum number of lines held in window history.
1704 This setting applies only to new windows - existing window histories are not
1705 resized and retain the limit at the point they were created.
1706 .It Ic lock-after-time Ar number
1707 Lock the session (like the
1708 .Ic lock-session
1709 command) after
1710 .Ar number
1711 seconds of inactivity, or the entire server (all sessions) if the
1712 .Ic lock-server
1713 option is set.
1714 The default is not to lock (set to 0).
1715 .It Ic lock-command Ar shell-command
1716 Command to run when locking each client.
1717 The default is to run
1718 .Xr lock 1
1719 with
1720 .Fl np .
1721 .It Xo Ic lock-server
1722 .Op Ic on | off
1724 If this option is
1725 .Ic on
1726 (the default),
1727 instead of each session locking individually as each has been
1728 idle for
1729 .Ic lock-after-time ,
1730 the entire server will lock after
1731 .Em all
1732 sessions would have locked.
1733 This has no effect as a session option; it must be set as a global option.
1734 .It Ic message-attr Ar attributes
1735 Set status line message attributes, where
1736 .Ar attributes
1737 is either
1738 .Ic none
1739 or a comma-delimited list of one or more of:
1740 .Ic bright
1742 .Ic bold ) ,
1743 .Ic dim ,
1744 .Ic underscore ,
1745 .Ic blink ,
1746 .Ic reverse ,
1747 .Ic hidden ,
1749 .Ic italics .
1750 .It Ic message-bg Ar colour
1751 Set status line message background colour, where
1752 .Ar colour
1753 is one of:
1754 .Ic black ,
1755 .Ic red ,
1756 .Ic green ,
1757 .Ic yellow ,
1758 .Ic blue ,
1759 .Ic magenta ,
1760 .Ic cyan ,
1761 .Ic white ,
1762 .Ic colour0
1764 .Ic colour255
1765 from the 256-colour palette, or
1766 .Ic default .
1767 .It Ic message-fg Ar colour
1768 Set status line message foreground colour.
1769 .It Ic message-limit Ar number
1770 Set the number of error or information messages to save in the message log for
1771 each client.
1772 The default is 20.
1773 .It Xo Ic mouse-select-pane
1774 .Op Ic on | off
1776 If on,
1778 captures the mouse and when a window is split into multiple panes the mouse may
1779 be used to select the current pane.
1780 The mouse click is also passed through to the application as normal.
1781 .It Ic pane-border-fg Ar colour
1782 .It Ic pane-border-bg Ar colour
1783 Set the pane border colour for panes aside from the active pane.
1784 .It Ic pane-active-border-fg Ar colour
1785 .It Ic pane-active-border-bg Ar colour
1786 Set the pane border colour for the currently active pane.
1787 .It Ic prefix Ar keys
1788 Set the keys accepted as a prefix key.
1789 .Ar keys
1790 is a comma-separated list of key names, each of which individually behave as
1791 the prefix key.
1792 .It Ic repeat-time Ar time
1793 Allow multiple commands to be entered without pressing the prefix-key again
1794 in the specified
1795 .Ar time
1796 milliseconds (the default is 500).
1797 Whether a key repeats may be set when it is bound using the
1798 .Fl r
1799 flag to
1800 .Ic bind-key .
1801 Repeat is enabled for the default keys bound to the
1802 .Ic resize-pane
1803 command.
1804 .It Xo Ic set-remain-on-exit
1805 .Op Ic on | off
1807 Set the
1808 .Ic remain-on-exit
1809 window option for any windows first created in this session.
1810 When this option is true, windows in which the running program has
1811 exited do not close, instead remaining open but inactivate.
1812 Use the
1813 .Ic respawn-window
1814 command to reactivate such a window, or the
1815 .Ic kill-window
1816 command to destroy it.
1817 .It Xo Ic set-titles
1818 .Op Ic on | off
1820 Attempt to set the window title using the \ee]2;...\e007 xterm code if
1821 the terminal appears to be an xterm.
1822 This option is off by default.
1823 Note that elinks
1824 will only attempt to set the window title if the STY environment
1825 variable is set.
1826 .It Ic set-titles-string Ar string
1827 String used to set the window title if
1828 .Ic set-titles
1829 is on.
1830 Character sequences are replaced as for the
1831 .Ic status-left
1832 option.
1833 .It Xo Ic status
1834 .Op Ic on | off
1836 Show or hide the status line.
1837 .It Ic status-attr Ar attributes
1838 Set status line attributes.
1839 .It Ic status-bg Ar colour
1840 Set status line background colour.
1841 .It Ic status-fg Ar colour
1842 Set status line foreground colour.
1843 .It Ic status-interval Ar interval
1844 Update the status bar every
1845 .Ar interval
1846 seconds.
1847 By default, updates will occur every 15 seconds.
1848 A setting of zero disables redrawing at interval.
1849 .It Xo Ic status-justify
1850 .Op Ic left | centre | right
1852 Set the position of the window list component of the status line: left, centre
1853 or right justified.
1854 .It Xo Ic status-keys
1855 .Op Ic vi | emacs
1857 Use vi or emacs-style
1858 key bindings in the status line, for example at the command prompt.
1859 The default is emacs, unless the
1860 .Ev VISUAL
1862 .Ev EDITOR
1863 environment variables are set and contain the string
1864 .Ql vi .
1865 .It Ic status-left Ar string
1866 Display
1867 .Ar string
1868 to the left of the status bar.
1869 .Ar string
1870 will be passed through
1871 .Xr strftime 3
1872 before being used.
1873 By default, the session name is shown.
1874 .Ar string
1875 may contain any of the following special character sequences:
1876 .Bl -column "Character pair" "Replaced with" -offset indent
1877 .It Sy "Character pair" Ta Sy "Replaced with"
1878 .It Li "#(shell-command)" Ta "First line of the command's output"
1879 .It Li "#[attributes]" Ta "Colour or attribute change"
1880 .It Li "#H" Ta "Hostname of local host"
1881 .It Li "#F" Ta "Current window flag"
1882 .It Li "#I" Ta "Current window index"
1883 .It Li "#P" Ta "Current pane index"
1884 .It Li "#S" Ta "Session name"
1885 .It Li "#T" Ta "Current window title"
1886 .It Li "#W" Ta "Current window name"
1887 .It Li "##" Ta "A literal" Ql #
1890 The #(shell-command) form executes
1891 .Ql shell-command
1892 and inserts the first line of its output.
1893 Note that shell commands are only executed once at the interval specified by
1895 .Ic status-interval
1896 option: if the status line is redrawn in the meantime, the previous result is
1897 used.
1898 Shell commands are executed with the
1900 global environment set (see the
1901 .Sx ENVIRONMENT
1902 section).
1904 The window title (#T) is the title set by the program running within the window
1905 using the OSC title setting sequence, for example:
1906 .Bd -literal -offset indent
1907 $ printf '\e033]2;My Title\e033\e\e'
1910 When a window is first created, its title is the hostname.
1912 #[attributes] allows a comma-separated list of attributes to be specified,
1913 these may be
1914 .Ql fg=colour
1915 to set the foreground colour,
1916 .Ql bg=colour
1917 to set the background colour, the name of one of the attributes (listed under
1919 .Ic message-attr
1920 option) to turn an attribute on, or an attribute prefixed with
1921 .Ql no
1922 to turn one off, for example
1923 .Ic nobright .
1924 Examples are:
1925 .Bd -literal -offset indent
1926 #(sysctl vm.loadavg)
1927 #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
1930 Where appropriate, special character sequences may be prefixed with a number to
1931 specify the maximum length, for example
1932 .Ql #24T .
1934 By default, UTF-8 in
1935 .Ar string
1936 is not interpreted, to enable UTF-8, use the
1937 .Ic status-utf8
1938 option.
1939 .It Ic status-left-attr Ar attributes
1940 Set the attribute of the left part of the status line.
1941 .It Ic status-left-fg Ar colour
1942 Set the foreground colour of the left part of the status line.
1943 .It Ic status-left-bg Ar colour
1944 Set the background colour of the left part of the status line.
1945 .It Ic status-left-length Ar length
1946 Set the maximum
1947 .Ar length
1948 of the left component of the status bar.
1949 The default is 10.
1950 .It Ic status-right Ar string
1951 Display
1952 .Ar string
1953 to the right of the status bar.
1954 By default, the current window title in double quotes, the date and the time
1955 are shown.
1956 As with
1957 .Ic status-left ,
1958 .Ar string
1959 will be passed to
1960 .Xr strftime 3 ,
1961 character pairs are replaced, and UTF-8 is dependent on the
1962 .Ic status-utf8
1963 option.
1964 .It Ic status-right-attr Ar attributes
1965 Set the attribute of the right part of the status line.
1966 .It Ic status-right-fg Ar colour
1967 Set the foreground colour of the right part of the status line.
1968 .It Ic status-right-bg Ar colour
1969 Set the background colour of the right part of the status line.
1970 .It Ic status-right-length Ar length
1971 Set the maximum
1972 .Ar length
1973 of the right component of the status bar.
1974 The default is 40.
1976 .It Xo Ic status-utf8
1977 .Op Ic on | off
1979 Instruct
1981 to treat top-bit-set characters in the
1982 .Ic status-left
1984 .Ic status-right
1985 strings as UTF-8; notably, this is important for wide characters.
1986 This option defaults to off.
1987 .It Ic terminal-overrides Ar string
1988 Contains a list of entries which override terminal descriptions read using
1989 .Xr terminfo 5 .
1990 .Ar string
1991 is a comma-separated list of items each a colon-separated string made up of a
1992 terminal type pattern (matched using
1993 .Xr fnmatch 3 )
1994 and a set of
1995 .Em name=value
1996 entries.
1998 For example, to set the
1999 .Ql clear
2000 .Xr terminfo 5
2001 entry to
2002 .Ql \ee[H\ee[2J
2003 for all terminal types and the
2004 .Ql dch1
2005 entry to
2006 .Ql \ee[P
2007 for the
2008 .Ql rxvt
2009 terminal type, the option could be set to the string:
2010 .Bd -literal -offset indent
2011 "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
2014 The terminal entry value is passed through
2015 .Xr strunvis 3
2016 before interpretation.
2017 The default value forcibly corrects the
2018 .Ql colors
2019 entry for terminals which support 88 or 256 colours:
2020 .Bd -literal -offset indent
2021 "*88col*:colors=88,*256col*:colors=256"
2023 .It Ic update-environment Ar variables
2024 Set a space-separated string containing a list of environment variables to be
2025 copied into the session environment when a new session is created or an
2026 existing session is attached.
2027 Any variables that do not exist in the source environment are set to be
2028 removed from the session environment (as if
2029 .Fl r
2030 was given to the
2031 .Ic set-environment
2032 command).
2033 The default is
2034 "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID
2035 XAUTHORITY".
2036 .It Xo Ic visual-activity
2037 .Op Ic on | off
2039 If on, display a status line message when activity occurs in a window
2040 for which the
2041 .Ic monitor-activity
2042 window option is enabled.
2043 .It Xo Ic visual-bell
2044 .Op Ic on | off
2046 If this option is on, a message is shown on a bell instead of it being passed
2047 through to the terminal (which normally makes a sound).
2048 Also see the
2049 .Ic bell-action
2050 option.
2051 .It Xo Ic visual-content
2052 .Op Ic on | off
2054 Like
2055 .Ic visual-activity ,
2056 display a message when content is present in a window
2057 for which the
2058 .Ic monitor-content
2059 window option is enabled.
2060 .It Xo Ic visual-silence
2061 .Op Ic on | off
2064 .Ic monitor-silence
2065 is enabled, prints a message after the interval has expired on a given window.
2067 .It Xo Ic set-window-option
2068 .Op Fl agu
2069 .Op Fl t Ar target-window
2070 .Ar option Ar value
2072 .D1 (alias: Ic setw )
2073 Set a window option.
2075 .Fl a ,
2076 .Fl g
2078 .Fl u
2079 flags work similarly to the
2080 .Ic set-option
2081 command.
2083 Supported window options are:
2085 .Bl -tag -width Ds -compact
2086 .It Xo Ic aggressive-resize
2087 .Op Ic on | off
2089 Aggressively resize the chosen window.
2090 This means that
2092 will resize the window to the size of the smallest session for which it is the
2093 current window, rather than the smallest session to which it is attached.
2094 The window may resize when the current window is changed on another sessions;
2095 this option is good for full-screen programs which support
2096 .Dv SIGWINCH
2097 and poor for interactive programs such as shells.
2099 .It Xo Ic automatic-rename
2100 .Op Ic on | off
2102 Control automatic window renaming.
2103 When this setting is enabled,
2105 will attempt - on supported platforms - to rename the window to reflect the
2106 command currently running in it.
2107 This flag is automatically disabled for an individual window when a name
2108 is specified at creation with
2109 .Ic new-window
2111 .Ic new-session ,
2112 or later with
2113 .Ic rename-window .
2114 It may be switched off globally with:
2115 .Bd -literal -offset indent
2116 set-window-option -g automatic-rename off
2119 .It Ic clock-mode-colour Ar colour
2120 Set clock colour.
2122 .It Xo Ic clock-mode-style
2123 .Op Ic 12 | 24
2125 Set clock hour format.
2127 .It Ic force-height Ar height
2128 .It Ic force-width Ar width
2129 Prevent
2131 from resizing a window to greater than
2132 .Ar width
2134 .Ar height .
2135 A value of zero restores the default unlimited setting.
2137 .It Ic main-pane-width Ar width
2138 .It Ic main-pane-height Ar height
2139 Set the width or height of the main (left or top) pane in the
2140 .Ic main-horizontal
2142 .Ic main-vertical
2143 layouts.
2145 .It Ic mode-attr Ar attributes
2146 Set window modes attributes.
2148 .It Ic mode-bg Ar colour
2149 Set window modes background colour.
2151 .It Ic mode-fg Ar colour
2152 Set window modes foreground colour.
2154 .It Xo Ic mode-keys
2155 .Op Ic vi | emacs
2157 Use vi or emacs-style key bindings in copy and choice modes.
2158 As with the
2159 .Ic status-keys
2160 option, the default is emacs, unless
2161 .Ev VISUAL
2163 .Ev EDITOR
2164 contains
2165 .Ql vi .
2167 .It Xo Ic mode-mouse
2168 .Op Ic on | off
2170 Mouse state in modes.
2171 If on, the mouse may be used to copy a selection by dragging in copy mode, or
2172 to select an option in choice mode.
2174 .It Xo Ic monitor-activity
2175 .Op Ic on | off
2177 Monitor for activity in the window.
2178 Windows with activity are highlighted in the status line.
2180 .It Ic monitor-content Ar match-string
2181 Monitor content in the window.
2182 When
2183 .Xr fnmatch 3
2184 pattern
2185 .Ar match-string
2186 appears in the window, it is highlighted in the status line.
2188 .It Xo Ic monitor-silence
2189 .Op Ic interval
2191 Monitor for silence (no activity) in the window within
2192 .Ic interval
2193 seconds.
2194 Windows that have been silent for the interval are highlighted in the
2195 status line.
2196 An interval of zero disables the monitoring.
2198 .It Ic other-pane-height Ar height
2199 Set the height of the other panes (not the main pane) in the
2200 .Ic main-horizontal
2201 layout.
2202 If this option is set to 0 (the default), it will have no effect.
2203 If both the
2204 .Ic main-pane-height
2206 .Ic other-pane-height
2207 options are set, the main pane will grow taller to make the other panes the
2208 specified height, but will never shrink to do so.
2210 .It Ic other-pane-width Ar width
2211 Like
2212 .Ic other-pane-height ,
2213 but set the width of other panes in the
2214 .Ic main-vertical
2215 layout.
2217 .It Xo Ic remain-on-exit
2218 .Op Ic on | off
2220 A window with this flag set is not destroyed when the program running in it
2221 exits.
2222 The window may be reactivated with the
2223 .Ic respawn-window
2224 command.
2226 .It Xo Ic synchronize-panes
2227 .Op Ic on | off
2229 Duplicate input to any pane to all other panes in the same window (only
2230 for panes that are not in any special mode).
2232 .It Xo Ic alternate-screen
2233 .Op Ic on | off
2235 This option configures whether programs running inside
2237 may use the terminal alternate screen feature, which allows the
2238 .Em smcup
2240 .Em rmcup
2241 .Xr terminfo 5
2242 capabilities to be issued to preserve the existing window content on start and
2243 restore it on exit.
2245 .It Xo Ic utf8
2246 .Op Ic on | off
2248 Instructs
2250 to expect UTF-8 sequences to appear in this window.
2252 .It Ic window-status-attr Ar attributes
2253 Set status line attributes for a single window.
2255 .It Ic window-status-bg Ar colour
2256 Set status line background colour for a single window.
2258 .It Ic window-status-fg Ar colour
2259 Set status line foreground colour for a single window.
2261 .It Ic window-status-format Ar string
2262 Set the format in which the window is displayed in the status line window list.
2263 See the
2264 .Ar status-left
2265 option for details of special character sequences available.
2266 The default is
2267 .Ql #I:#W#F .
2269 .It Ic window-status-alert-attr Ar attributes
2270 Set status line attributes for windows which have an alert (bell, activity
2271 or content).
2273 .It Ic window-status-alert-bg Ar colour
2274 Set status line background colour for windows with an alert.
2276 .It Ic window-status-alert-fg Ar colour
2277 Set status line foreground colour for windows with an alert.
2279 .It Ic window-status-current-attr Ar attributes
2280 Set status line attributes for the currently active window.
2282 .It Ic window-status-current-bg Ar colour
2283 Set status line background colour for the currently active window.
2285 .It Ic window-status-current-fg Ar colour
2286 Set status line foreground colour for the currently active window.
2288 .It Ic window-status-current-format Ar string
2289 Like
2290 .Ar window-status-format ,
2291 but is the format used when the window is the current window.
2293 .It Ic word-separators Ar string
2294 Sets the window's conception of what characters are considered word
2295 separators, for the purposes of the next and previous word commands in
2296 copy mode.
2297 The default is
2298 .Ql \ -_@ .
2300 .It Xo Ic xterm-keys
2301 .Op Ic on | off
2303 If this option is set,
2305 will generate
2306 .Xr xterm 1 -style
2307 function key sequences; these have a number included to indicate modifiers such
2308 as Shift, Alt or Ctrl.
2309 The default is off.
2311 .It Xo Ic show-options
2312 .Op Fl gsw
2313 .Op Fl t Ar target-session | Ar target-window
2315 .D1 (alias: Ic show )
2316 Show the window options with
2317 .Fl w
2318 (equivalent to
2319 .Ic show-window-options ) ,
2320 the server options with
2321 .Fl s ,
2322 otherwise the session options for
2323 .Ar target session .
2324 Global session or window options are listed if
2325 .Fl g
2326 is used.
2327 .It Xo Ic show-window-options
2328 .Op Fl g
2329 .Op Fl t Ar target-window
2331 .D1 (alias: Ic showw )
2332 List the window options for
2333 .Ar target-window ,
2334 or the global window options if
2335 .Fl g
2336 is used.
2338 .Sh ENVIRONMENT
2339 When the server is started,
2341 copies the environment into the
2342 .Em global environment ;
2343 in addition, each session has a
2344 .Em session environment .
2345 When a window is created, the session and global environments are merged.
2346 If a variable exists in both, the value from the session environment is used.
2347 The result is the initial environment passed to the new process.
2350 .Ic update-environment
2351 session option may be used to update the session environment from the client
2352 when a new session is created or an old reattached.
2354 also initialises the
2355 .Ev TMUX
2356 variable with some internal information to allow commands to be executed
2357 from inside, and the
2358 .Ev TERM
2359 variable with the correct terminal setting of
2360 .Ql screen .
2362 Commands to alter and view the environment are:
2363 .Bl -tag -width Ds
2364 .It Xo Ic set-environment
2365 .Op Fl gru
2366 .Op Fl t Ar target-session
2367 .Ar name Op Ar value
2369 .D1 (alias: Ic setenv )
2370 Set or unset an environment variable.
2372 .Fl g
2373 is used, the change is made in the global environment; otherwise, it is applied
2374 to the session environment for
2375 .Ar target-session .
2377 .Fl u
2378 flag unsets a variable.
2379 .Fl r
2380 indicates the variable is to be removed from the environment before starting a
2381 new process.
2382 .It Xo Ic show-environment
2383 .Op Fl g
2384 .Op Fl t Ar target-session
2386 .D1 (alias: Ic showenv )
2387 Display the environment for
2388 .Ar target-session
2389 or the global environment with
2390 .Fl g .
2391 Variables removed from the environment are prefixed with
2392 .Ql - .
2394 .Sh STATUS LINE
2396 includes an optional status line which is displayed in the bottom line of each
2397 terminal.
2398 By default, the status line is enabled (it may be disabled with the
2399 .Ic status
2400 session option) and contains, from left-to-right: the name of the current
2401 session in square brackets; the window list; the current window title in double
2402 quotes; and the time and date.
2404 The status line is made of three parts: configurable left and right sections
2405 (which may contain dynamic content such as the time or output from a shell
2406 command, see the
2407 .Ic status-left ,
2408 .Ic status-left-length ,
2409 .Ic status-right ,
2411 .Ic status-right-length
2412 options below), and a central window list.
2413 By default, the window list shows the index, name and (if any) flag of the
2414 windows present in the current session in ascending numerical order.
2415 It may be customised with the
2416 .Ar window-status-format
2418 .Ar window-status-current-format
2419 options.
2420 The flag is one of the following symbols appended to the window name:
2421 .Bl -column "Symbol" "Meaning" -offset indent
2422 .It Sy "Symbol" Ta Sy "Meaning"
2423 .It Li "*" Ta "Denotes the current window."
2424 .It Li "-" Ta "Marks the last window (previously selected)."
2425 .It Li "#" Ta "Window is monitored and activity has been detected."
2426 .It Li "!" Ta "A bell has occurred in the window."
2427 .It Li "+" Ta "Window is monitored for content and it has appeared."
2428 .It Li "~" Ta "The window has been silent for the monitor-silence interval."
2431 The # symbol relates to the
2432 .Ic monitor-activity
2433 and + to the
2434 .Ic monitor-content
2435 window options.
2436 The window name is printed in inverted colours if an alert (bell, activity or
2437 content) is present.
2439 The colour and attributes of the status line may be configured, the entire
2440 status line using the
2441 .Ic status-attr ,
2442 .Ic status-fg
2444 .Ic status-bg
2445 session options and individual windows using the
2446 .Ic window-status-attr ,
2447 .Ic window-status-fg
2449 .Ic window-status-bg
2450 window options.
2452 The status line is automatically refreshed at interval if it has changed, the
2453 interval may be controlled with the
2454 .Ic status-interval
2455 session option.
2457 Commands related to the status line are as follows:
2458 .Bl -tag -width Ds
2459 .It Xo Ic command-prompt
2460 .Op Fl p Ar prompts
2461 .Op Fl t Ar target-client
2462 .Op Ar template
2464 Open the command prompt in a client.
2465 This may be used from inside
2467 to execute commands interactively.
2469 .Ar template
2470 is specified, it is used as the command.
2472 .Fl p
2473 is given,
2474 .Ar prompts
2475 is a comma-separated list of prompts which are displayed in order; otherwise
2476 a single prompt is displayed, constructed from
2477 .Ar template
2478 if it is present, or
2479 .Ql \&:
2480 if not.
2481 Before the command is executed, the first occurrence of the string
2482 .Ql %%
2483 and all occurrences of
2484 .Ql %1
2485 are replaced by the response to the first prompt, the second
2486 .Ql %%
2487 and all
2488 .Ql %2
2489 are replaced with the response to the second prompt, and so on for further
2490 prompts.
2491 Up to nine prompt responses may be replaced
2493 .Ql %1
2495 .Ql %9
2496 .Pc .
2497 .It Xo Ic confirm-before
2498 .Op Fl t Ar target-client
2499 .Ar command
2501 .D1 (alias: Ic confirm )
2502 Ask for confirmation before executing
2503 .Ar command .
2504 This command works only from inside
2505 .Nm .
2506 .It Xo Ic display-message
2507 .Op Fl p
2508 .Op Fl t Ar target-client
2509 .Op Ar message
2511 .D1 (alias: Ic display )
2512 Display a message.
2514 .Fl p
2515 is given, the output is printed to stdout, otherwise it is displayed in the
2516 .Ar target-client
2517 status line.
2518 The format of
2519 .Ar message
2520 is as for
2521 .Ic status-left ,
2522 with the exception that #() are not handled.
2524 .Sh BUFFERS
2526 maintains a stack of
2527 .Em paste buffers
2528 for each session.
2529 Up to the value of the
2530 .Ic buffer-limit
2531 option are kept; when a new buffer is added, the buffer at the bottom of the
2532 stack is removed.
2533 Buffers may be added using
2534 .Ic copy-mode
2535 or the
2536 .Ic set-buffer
2537 command, and pasted into a window using the
2538 .Ic paste-buffer
2539 command.
2541 A configurable history buffer is also maintained for each window.
2542 By default, up to 2000 lines are kept; this can be altered with the
2543 .Ic history-limit
2544 option (see the
2545 .Ic set-option
2546 command above).
2548 The buffer commands are as follows:
2549 .Bl -tag -width Ds
2550 .It Xo
2551 .Ic choose-buffer
2552 .Op Fl t Ar target-window
2553 .Op Ar template
2555 Put a window into buffer choice mode, where a buffer may be chosen
2556 interactively from a list.
2557 After a buffer is selected,
2558 .Ql %%
2559 is replaced by the buffer index in
2560 .Ar template
2561 and the result executed as a command.
2563 .Ar template
2564 is not given, "paste-buffer -b '%%'" is used.
2565 This command works only from inside
2566 .Nm .
2567 .It Ic clear-history Op Fl t Ar target-pane
2568 .D1 (alias: Ic clearhist )
2569 Remove and free the history for the specified pane.
2570 .It Xo Ic copy-buffer
2571 .Op Fl a Ar src-index
2572 .Op Fl b Ar dst-index
2573 .Op Fl s Ar src-session
2574 .Op Fl t Ar dst-session
2576 .D1 (alias: Ic copyb )
2577 Copy a session paste buffer to another session.
2578 If no sessions are specified, the current one is used instead.
2579 .It Xo Ic delete-buffer
2580 .Op Fl b Ar buffer-index
2581 .Op Fl t Ar target-session
2583 .D1 (alias: Ic deleteb )
2584 Delete the buffer at
2585 .Ar buffer-index ,
2586 or the top buffer if not specified.
2587 .It Ic list-buffers Op Fl t Ar target-session
2588 .D1 (alias: Ic lsb )
2589 List the buffers in the given session.
2590 .It Xo Ic load-buffer
2591 .Op Fl b Ar buffer-index
2592 .Op Fl t Ar target-session
2593 .Ar path
2595 .D1 (alias: Ic loadb )
2596 Load the contents of the specified paste buffer from
2597 .Ar path .
2598 .It Xo Ic paste-buffer
2599 .Op Fl dr
2600 .Op Fl b Ar buffer-index
2601 .Op Fl s Ar separator
2602 .Op Fl t Ar target-pane
2604 .D1 (alias: Ic pasteb )
2605 Insert the contents of a paste buffer into the specified pane.
2606 If not specified, paste into the current one.
2607 With
2608 .Fl d ,
2609 also delete the paste buffer from the stack.
2610 When output, any linefeed (LF) characters in the paste buffer are replaced with
2611 a separator, by default carriage return (CR).
2612 A custom separator may be specified using the
2613 .Fl s
2614 flag.
2616 .Fl r
2617 flag means to do no replacement (equivalent to a separator of LF).
2618 .It Xo Ic save-buffer
2619 .Op Fl a
2620 .Op Fl b Ar buffer-index
2621 .Op Fl t Ar target-session
2622 .Ar path
2624 .D1 (alias: Ic saveb )
2625 Save the contents of the specified paste buffer to
2626 .Ar path .
2628 .Fl a
2629 option appends to rather than overwriting the file.
2630 .It Xo Ic set-buffer
2631 .Op Fl b Ar buffer-index
2632 .Op Fl t Ar target-session
2633 .Ar data
2635 .D1 (alias: Ic setb )
2636 Set the contents of the specified buffer to
2637 .Ar data .
2638 .It Xo Ic show-buffer
2639 .Op Fl b Ar buffer-index
2640 .Op Fl t Ar target-session
2642 .D1 (alias: Ic showb )
2643 Display the contents of the specified buffer.
2645 .Sh MISCELLANEOUS
2647 Miscellaneous commands are as follows:
2648 .Bl -tag -width Ds
2649 .It Ic clock-mode Op Fl t Ar target-pane
2650 Display a large clock.
2651 .It Ic if-shell Ar shell-command command
2652 .D1 (alias: Ic if )
2653 Execute
2654 .Ar command
2656 .Ar shell-command
2657 returns success.
2658 .It Ic lock-server
2659 .D1 (alias: Ic lock )
2660 Lock each client individually by running the command specified by the
2661 .Ic lock-command
2662 option.
2663 .It Ic run-shell Ar shell-command
2664 .D1 (alias: Ic run )
2665 Execute
2666 .Ar shell-command
2667 in the background without creating a window.
2668 After it finishes, any output to stdout is displayed in copy mode.
2669 If the command doesn't return success, the exit status is also displayed.
2670 .It Ic server-info
2671 .D1 (alias: Ic info )
2672 Show server information and terminal details.
2674 .Sh FILES
2675 .Bl -tag -width "/etc/tmux.confXXX" -compact
2676 .It Pa ~/.tmux.conf
2677 Default
2679 configuration file.
2680 .It Pa /etc/tmux.conf
2681 System-wide configuration file.
2683 .Sh EXAMPLES
2684 To create a new
2686 session running
2687 .Xr vi 1 :
2689 .Dl $ tmux new-session vi
2691 Most commands have a shorter form, known as an alias.
2692 For new-session, this is
2693 .Ic new :
2695 .Dl $ tmux new vi
2697 Alternatively, the shortest unambiguous form of a command is accepted.
2698 If there are several options, they are listed:
2699 .Bd -literal -offset indent
2700 $ tmux n
2701 ambiguous command: n, could be: new-session, new-window, next-window
2704 Within an active session, a new window may be created by typing
2705 .Ql C-b c
2706 (Ctrl
2707 followed by the
2708 .Ql b
2710 followed by the
2711 .Ql c
2712 key).
2714 Windows may be navigated with:
2715 .Ql C-b 0
2716 (to select window 0),
2717 .Ql C-b 1
2718 (to select window 1), and so on;
2719 .Ql C-b n
2720 to select the next window; and
2721 .Ql C-b p
2722 to select the previous window.
2724 A session may be detached using
2725 .Ql C-b d
2726 (or by an external event such as
2727 .Xr ssh 1
2728 disconnection) and reattached with:
2730 .Dl $ tmux attach-session
2732 Typing
2733 .Ql C-b \&?
2734 lists the current key bindings in the current window; up and down may be used
2735 to navigate the list or
2736 .Ql q
2737 to exit from it.
2739 Commands to be run when the
2741 server is started may be placed in the
2742 .Pa ~/.tmux.conf
2743 configuration file.
2744 Common examples include:
2746 Changing the default prefix key:
2747 .Bd -literal -offset indent
2748 set-option -g prefix C-a
2749 unbind-key C-b
2750 bind-key C-a send-prefix
2753 Turning the status line off, or changing its colour:
2754 .Bd -literal -offset indent
2755 set-option -g status off
2756 set-option -g status-bg blue
2759 Setting other options, such as the default command,
2760 or locking after 30 minutes of inactivity:
2761 .Bd -literal -offset indent
2762 set-option -g default-command "exec /bin/ksh"
2763 set-option -g lock-after-time 1800
2766 Creating new key bindings:
2767 .Bd -literal -offset indent
2768 bind-key b set-option status
2769 bind-key / command-prompt "split-window 'exec man %%'"
2770 bind-key S command-prompt "new-window -n %1 'ssh %1'"
2772 .Sh SEE ALSO
2773 .Xr pty 4
2774 .Sh AUTHORS
2775 .An Nicholas Marriott Aq nicm@users.sourceforge.net