Remove previous.
[tmux-openbsd.git] / tmux.1
blobb0d6b4e76c17f31ec36371b457a5fa75e74a9858
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 .
128 The configuration file is a set of
130 commands which are executed in sequence when the server is first started.
132 loads configuration files once when the server process has started.
134 .Ic source-file
135 command may be used to load a file later.
138 shows any error messages from commands in configuration files in the first
139 session created, and continues to process the rest of the configuration file.
140 .It Fl L Ar socket-name
142 stores the server socket in a directory under
143 .Pa /tmp
145 .Ev TMPDIR
146 if set);
147 the default socket is named
148 .Em default .
149 This option allows a different socket name to be specified, allowing several
150 independent
152 servers to be run.
153 Unlike
154 .Fl S
155 a full path is not necessary: the sockets are all created in the same
156 directory.
158 If the socket is accidentally removed, the
159 .Dv SIGUSR1
160 signal may be sent to the
162 server process to recreate it.
163 .It Fl l
164 Behave as a login shell.
165 This flag currently has no effect and is for compatibility with other shells
166 when using tmux as a login shell.
167 .It Fl q
168 Set the
169 .Ic quiet
170 server option to prevent the server sending various informational messages.
171 .It Fl S Ar socket-path
172 Specify a full alternative path to the server socket.
174 .Fl S
175 is specified, the default socket directory is not used and any
176 .Fl L
177 flag is ignored.
178 .It Fl u
180 attempts to guess if the terminal is likely to support UTF-8 by checking the
181 first of the
182 .Ev LC_ALL ,
183 .Ev LC_CTYPE
185 .Ev LANG
186 environment variables to be set for the string "UTF-8".
187 This is not always correct: the
188 .Fl u
189 flag explicitly informs
191 that UTF-8 is supported.
193 If the server is started from a client passed
194 .Fl u
195 or where UTF-8 is detected, the
196 .Ic utf8
198 .Ic status-utf8
199 options are enabled in the global window and session options respectively.
200 .It Fl v
201 Request verbose logging.
202 This option may be specified multiple times for increasing verbosity.
203 Log messages will be saved into
204 .Pa tmux-client-PID.log
206 .Pa tmux-server-PID.log
207 files in the current directory, where
208 .Em PID
209 is the PID of the server or client process.
210 .It Ar command Op Ar flags
211 This specifies one of a set of commands used to control
212 .Nm ,
213 as described in the following sections.
214 If no commands are specified, the
215 .Ic new-session
216 command is assumed.
218 .Sh KEY BINDINGS
220 may be controlled from an attached client by using a key combination of a
221 prefix key,
222 .Ql C-b
223 (Ctrl-b) by default, followed by a command key.
225 The default command key bindings are:
227 .Bl -tag -width "XXXXXXXXXX" -offset indent -compact
228 .It C-b
229 Send the prefix key (C-b) through to the application.
230 .It C-o
231 Rotate the panes in the current window forwards.
232 .It C-z
233 Suspend the
235 client.
236 .It !
237 Break the current pane out of the window.
238 .It \&"
239 Split the current pane into two, top and bottom.
240 .It #
241 List all paste buffers.
242 .It $
243 Rename the current session.
244 .It %
245 Split the current pane into two, left and right.
246 .It &
247 Kill the current window.
248 .It '
249 Prompt for a window index to select.
250 .It ,
251 Rename the current window.
252 .It -
253 Delete the most recently copied buffer of text.
254 .It .
255 Prompt for an index to move the current window.
256 .It 0 to 9
257 Select windows 0 to 9.
258 .It :
259 Enter the
261 command prompt.
262 .It ;
263 Move to the previously active pane.
264 .It =
265 Choose which buffer to paste interactively from a list.
266 .It \&?
267 List all key bindings.
268 .It D
269 Choose a client to detach.
270 .It \&[
271 Enter copy mode to copy text or view the history.
272 .It \&]
273 Paste the most recently copied buffer of text.
274 .It c
275 Create a new window.
276 .It d
277 Detach the current client.
278 .It f
279 Prompt to search for text in open windows.
280 .It i
281 Display some information about the current window.
282 .It l
283 Move to the previously selected window.
284 .It n
285 Change to the next window.
286 .It o
287 Select the next pane in the current window.
288 .It p
289 Change to the previous window.
290 .It q
291 Briefly display pane indexes.
292 .It r
293 Force redraw of the attached client.
294 .It s
295 Select a new session for the attached client interactively.
296 .It L
297 Switch the attached client back to the last session.
298 .It t
299 Show the time.
300 .It w
301 Choose the current window interactively.
302 .It x
303 Kill the current pane.
304 .It {
305 Swap the current pane with the previous pane.
306 .It }
307 Swap the current pane with the next pane.
308 .It ~
309 Show previous messages from
310 .Nm ,
311 if any.
312 .It Page Up
313 Enter copy mode and scroll one page up.
314 .It Up, Down
315 .It Left, Right
316 Change to the pane above, below, to the left, or to the right of the current
317 pane.
318 .It M-1 to M-5
319 Arrange panes in one of the five preset layouts: even-horizontal,
320 even-vertical, main-horizontal, main-vertical, or tiled.
321 .It M-n
322 Move to the next window with a bell or activity marker.
323 .It M-o
324 Rotate the panes in the current window backwards.
325 .It M-p
326 Move to the previous window with a bell or activity marker.
327 .It C-Up, C-Down
328 .It C-Left, C-Right
329 Resize the current pane in steps of one cell.
330 .It M-Up, M-Down
331 .It M-Left, M-Right
332 Resize the current pane in steps of five cells.
335 Key bindings may be changed with the
336 .Ic bind-key
338 .Ic unbind-key
339 commands.
340 .Sh COMMANDS
341 This section contains a list of the commands supported by
342 .Nm .
343 Most commands accept the optional
344 .Fl t
345 argument with one of
346 .Ar target-client ,
347 .Ar target-session
348 .Ar target-window ,
350 .Ar target-pane .
351 These specify the client, session, window or pane which a command should affect.
352 .Ar target-client
353 is the name of the
354 .Xr pty 4
355 file to which the client is connected, for example either of
356 .Pa /dev/ttyp1
358 .Pa ttyp1
359 for the client attached to
360 .Pa /dev/ttyp1 .
361 If no client is specified, the current client is chosen, if possible, or an
362 error is reported.
363 Clients may be listed with the
364 .Ic list-clients
365 command.
367 .Ar target-session
368 is either the name of a session (as listed by the
369 .Ic list-sessions
370 command) or the name of a client with the same syntax as
371 .Ar target-client ,
372 in which case the session attached to the client is used.
373 When looking for the session name,
375 initially searches for an exact match; if none is found, the session names
376 are checked for any for which
377 .Ar target-session
378 is a prefix or for which it matches as an
379 .Xr fnmatch 3
380 pattern.
381 If a single match is found, it is used as the target session; multiple matches
382 produce an error.
383 If a session is omitted, the current session is used if available; if no
384 current session is available, the most recently used is chosen.
386 .Ar target-window
387 specifies a window in the form
388 .Em session Ns \&: Ns Em window .
389 .Em session
390 follows the same rules as for
391 .Ar target-session ,
393 .Em window
394 is looked for in order: as a window index, for example mysession:1;
395 as a window ID, such as @1;
396 as an exact window name, such as mysession:mywindow; then as an
397 .Xr fnmatch 3
398 pattern or the start of a window name, such as mysession:mywin* or
399 mysession:mywin.
400 An empty window name specifies the next unused index if appropriate (for
401 example the
402 .Ic new-window
404 .Ic link-window
405 commands)
406 otherwise the current window in
407 .Em session
408 is chosen.
409 The special character
410 .Ql \&!
411 uses the last (previously current) window,
412 .Ql ^
413 selects the highest numbered window,
414 .Ql $
415 selects the lowest numbered window, and
416 .Ql +
418 .Ql -
419 select the next window or the previous window by number.
420 When the argument does not contain a colon,
422 first attempts to parse it as window; if that fails, an attempt is made to
423 match a session.
425 .Ar target-pane
426 takes a similar form to
427 .Ar target-window
428 but with the optional addition of a period followed by a pane index, for
429 example: mysession:mywindow.1.
430 If the pane index is omitted, the currently active pane in the specified
431 window is used.
432 If neither a colon nor period appears,
434 first attempts to use the argument as a pane index; if that fails, it is looked
435 up as for
436 .Ar target-window .
438 .Ql +
440 .Ql -
441 indicate the next or previous pane index, respectively.
442 One of the strings
443 .Em top ,
444 .Em bottom ,
445 .Em left ,
446 .Em right ,
447 .Em top-left ,
448 .Em top-right ,
449 .Em bottom-left
451 .Em bottom-right
452 may be used instead of a pane index.
454 The special characters
455 .Ql +
457 .Ql -
458 may be followed by an offset, for example:
459 .Bd -literal -offset indent
460 select-window -t:+2
463 When dealing with a session that doesn't contain sequential window indexes,
464 they will be correctly skipped.
467 also gives each pane created in a server an identifier consisting of a
468 .Ql %
469 and a number, starting from zero.
470 A pane's identifier is unique for the life of the
472 server and is passed to the child process of the pane in the
473 .Ev TMUX_PANE
474 environment variable.
475 It may be used alone to target a pane or the window containing it.
477 .Ar shell-command
478 arguments are
479 .Xr sh 1
480 commands.
481 These must be passed as a single item, which typically means quoting them, for
482 example:
483 .Bd -literal -offset indent
484 new-window 'vi /etc/passwd'
487 .Ar command
488 .Op Ar arguments
489 refers to a
491 command, passed with the command and arguments separately, for example:
492 .Bd -literal -offset indent
493 bind-key F1 set-window-option force-width 81
496 Or if using
497 .Xr sh 1 :
498 .Bd -literal -offset indent
499 $ tmux bind-key F1 set-window-option force-width 81
502 Multiple commands may be specified together as part of a
503 .Em command sequence .
504 Each command should be separated by spaces and a semicolon;
505 commands are executed sequentially from left to right and
506 lines ending with a backslash continue on to the next line,
507 except when escaped by another backslash.
508 A literal semicolon may be included by escaping it with a backslash (for
509 example, when specifying a command sequence to
510 .Ic bind-key ) .
512 Example
514 commands include:
515 .Bd -literal -offset indent
516 refresh-client -t/dev/ttyp2
518 rename-session -tfirst newname
520 set-window-option -t:0 monitor-activity on
522 new-window ; split-window -d
524 bind-key R source-file ~/.tmux.conf \e; \e
525         display-message "source-file done"
528 Or from
529 .Xr sh 1 :
530 .Bd -literal -offset indent
531 $ tmux kill-window -t :1
533 $ tmux new-window \e; split-window -d
535 $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
537 .Sh CLIENTS AND SESSIONS
540 server manages clients, sessions, windows and panes.
541 Clients are attached to sessions to interact with them, either
542 when they are created with the
543 .Ic new-session
544 command, or later with the
545 .Ic attach-session
546 command.
547 Each session has one or more windows
548 .Em linked
549 into it.
550 Windows may be linked to multiple sessions and are made up of one or
551 more panes,
552 each of which contains a pseudo terminal.
553 Commands for creating, linking and otherwise manipulating windows
554 are covered
555 in the
556 .Sx WINDOWS AND PANES
557 section.
559 The following commands are available to manage clients and sessions:
560 .Bl -tag -width Ds
561 .It Xo Ic attach-session
562 .Op Fl dr
563 .Op Fl t Ar target-session
565 .D1 (alias: Ic attach )
566 If run from outside
567 .Nm ,
568 create a new client in the current terminal and attach it to
569 .Ar target-session .
570 If used from inside, switch the current client.
572 .Fl d
573 is specified, any other clients attached to the session are detached.
574 .Fl r
575 signifies the client is read-only (only keys bound to the
576 .Ic detach-client
578 .Ic switch-client
579 commands have any effect)
581 If no server is started,
582 .Ic attach-session
583 will attempt to start it; this will fail unless sessions are created in the
584 configuration file.
587 .Ar target-session
588 rules for
589 .Ic attach-session
590 are slightly adjusted: if
592 needs to select the most recently used session, it will prefer the most
593 recently used
594 .Em unattached
595 session.
596 .It Xo Ic detach-client
597 .Op Fl P
598 .Op Fl a
599 .Op Fl s Ar target-session
600 .Op Fl t Ar target-client
602 .D1 (alias: Ic detach )
603 Detach the current client if bound to a key, the client specified with
604 .Fl t ,
605 or all clients currently attached to the session specified by
606 .Fl s .
608 .Fl a
609 option kills all but the client given with
610 .Fl t .
612 .Fl P
613 is given, send SIGHUP to the parent process of the client, typically causing it
614 to exit.
615 .It Ic has-session Op Fl t Ar target-session
616 .D1 (alias: Ic has )
617 Report an error and exit with 1 if the specified session does not exist.
618 If it does exist, exit with 0.
619 .It Ic kill-server
620 Kill the
622 server and clients and destroy all sessions.
623 .It Ic kill-session
624 .Op Fl a
625 .Op Fl t Ar target-session
626 Destroy the given session, closing any windows linked to it and no other
627 sessions, and detaching all clients attached to it.
629 .Fl a
630 is given, all sessions but the specified one is killed.
631 .It Xo Ic list-clients
632 .Op Fl F Ar format
633 .Op Fl t Ar target-session
635 .D1 (alias: Ic lsc )
636 List all clients attached to the server.
637 For the meaning of the
638 .Fl F
639 flag, see the
640 .Sx FORMATS
641 section.
643 .Ar target-session
644 is specified, list only clients connected to that session.
645 .It Ic list-commands
646 .D1 (alias: Ic lscm )
647 List the syntax of all commands supported by
648 .Nm .
649 .It Ic list-sessions Op Fl F Ar format
650 .D1 (alias: Ic ls )
651 List all sessions managed by the server.
652 For the meaning of the
653 .Fl F
654 flag, see the
655 .Sx FORMATS
656 section.
657 .It Ic lock-client Op Fl t Ar target-client
658 .D1 (alias: Ic lockc )
659 Lock
660 .Ar target-client ,
661 see the
662 .Ic lock-server
663 command.
664 .It Ic lock-session Op Fl t Ar target-session
665 .D1 (alias: Ic locks )
666 Lock all clients attached to
667 .Ar target-session .
668 .It Xo Ic new-session
669 .Op Fl AdD
670 .Op Fl n Ar window-name
671 .Op Fl s Ar session-name
672 .Op Fl t Ar target-session
673 .Op Fl x Ar width
674 .Op Fl y Ar height
675 .Op Ar shell-command
677 .D1 (alias: Ic new )
678 Create a new session with name
679 .Ar session-name .
681 The new session is attached to the current terminal unless
682 .Fl d
683 is given.
684 .Ar window-name
686 .Ar shell-command
687 are the name of and shell command to execute in the initial window.
689 .Fl d
690 is used,
691 .Fl x
693 .Fl y
694 specify the size of the initial window (80 by 24 if not given).
696 If run from a terminal, any
697 .Xr termios 4
698 special characters are saved and used for new windows in the new session.
701 .Fl A
702 flag makes
703 .Ic new-session
704 behave like
705 .Ic attach-session
707 .Ar session-name
708 already exists; in the case,
709 .Fl D
710 behaves like
711 .Fl d
713 .Ic attach-session .
716 .Fl t
717 is given, the new session is
718 .Em grouped
719 with
720 .Ar target-session .
721 This means they share the same set of windows - all windows from
722 .Ar target-session
723 are linked to the new session and any subsequent new windows or windows being
724 closed are applied to both sessions.
725 The current and previous window and any session options remain independent and
726 either session may be killed without affecting the other.
727 Giving
728 .Fl n
730 .Ar shell-command
731 are invalid if
732 .Fl t
733 is used.
734 .It Xo Ic refresh-client
735 .Op Fl S
736 .Op Fl t Ar target-client
738 .D1 (alias: Ic refresh )
739 Refresh the current client if bound to a key, or a single client if one is given
740 with
741 .Fl t .
743 .Fl S
744 is specified, only update the client's status bar.
745 .It Xo Ic rename-session
746 .Op Fl t Ar target-session
747 .Ar new-name
749 .D1 (alias: Ic rename )
750 Rename the session to
751 .Ar new-name .
752 .It Xo Ic show-messages
753 .Op Fl t Ar target-client
755 .D1 (alias: Ic showmsgs )
756 Any messages displayed on the status line are saved in a per-client message
757 log, up to a maximum of the limit set by the
758 .Ar message-limit
759 session option for the session attached to that client.
760 This command displays the log for
761 .Ar target-client .
762 .It Ic source-file Ar path
763 .D1 (alias: Ic source )
764 Execute commands from
765 .Ar path .
766 .It Ic start-server
767 .D1 (alias: Ic start )
768 Start the
770 server, if not already running, without creating any sessions.
771 .It Xo Ic suspend-client
772 .Op Fl t Ar target-client
774 .D1 (alias: Ic suspendc )
775 Suspend a client by sending
776 .Dv SIGTSTP
777 (tty stop).
778 .It Xo Ic switch-client
779 .Op Fl lnpr
780 .Op Fl c Ar target-client
781 .Op Fl t Ar target-session
783 .D1 (alias: Ic switchc )
784 Switch the current session for client
785 .Ar target-client
787 .Ar target-session .
789 .Fl l ,
790 .Fl n
792 .Fl p
793 is used, the client is moved to the last, next or previous session
794 respectively.
795 .Fl r
796 toggles whether a client is read-only (see the
797 .Ic attach-session
798 command).
800 .Sh WINDOWS AND PANES
803 window may be in one of several modes.
804 The default permits direct access to the terminal attached to the window.
805 The other is copy mode, which permits a section of a window or its
806 history to be copied to a
807 .Em paste buffer
808 for later insertion into another window.
809 This mode is entered with the
810 .Ic copy-mode
811 command, bound to
812 .Ql \&[
813 by default.
814 It is also entered when a command that produces output, such as
815 .Ic list-keys ,
816 is executed from a key binding.
818 The keys available depend on whether emacs or vi mode is selected
819 (see the
820 .Ic mode-keys
821 option).
822 The following keys are supported as appropriate for the mode:
823 .Bl -column "FunctionXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
824 .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
825 .It Li "Back to indentation" Ta "^" Ta "M-m"
826 .It Li "Bottom of history" Ta "G" Ta "M-<"
827 .It Li "Clear selection" Ta "Escape" Ta "C-g"
828 .It Li "Copy selection" Ta "Enter" Ta "M-w"
829 .It Li "Cursor down" Ta "j" Ta "Down"
830 .It Li "Cursor left" Ta "h" Ta "Left"
831 .It Li "Cursor right" Ta "l" Ta "Right"
832 .It Li "Cursor to bottom line" Ta "L" Ta ""
833 .It Li "Cursor to middle line" Ta "M" Ta "M-r"
834 .It Li "Cursor to top line" Ta "H" Ta "M-R"
835 .It Li "Cursor up" Ta "k" Ta "Up"
836 .It Li "Delete entire line" Ta "d" Ta "C-u"
837 .It Li "Delete/Copy to end of line" Ta "D" Ta "C-k"
838 .It Li "End of line" Ta "$" Ta "C-e"
839 .It Li "Go to line" Ta ":" Ta "g"
840 .It Li "Half page down" Ta "C-d" Ta "M-Down"
841 .It Li "Half page up" Ta "C-u" Ta "M-Up"
842 .It Li "Jump forward" Ta "f" Ta "f"
843 .It Li "Jump to forward" Ta "t" Ta ""
844 .It Li "Jump backward" Ta "F" Ta "F"
845 .It Li "Jump to backward" Ta "T" Ta ""
846 .It Li "Jump again" Ta ";" Ta ";"
847 .It Li "Jump again in reverse" Ta "," Ta ","
848 .It Li "Next page" Ta "C-f" Ta "Page down"
849 .It Li "Next space" Ta "W" Ta ""
850 .It Li "Next space, end of word" Ta "E" Ta ""
851 .It Li "Next word" Ta "w" Ta ""
852 .It Li "Next word end" Ta "e" Ta "M-f"
853 .It Li "Paste buffer" Ta "p" Ta "C-y"
854 .It Li "Previous page" Ta "C-b" Ta "Page up"
855 .It Li "Previous word" Ta "b" Ta "M-b"
856 .It Li "Previous space" Ta "B" Ta ""
857 .It Li "Quit mode" Ta "q" Ta "Escape"
858 .It Li "Rectangle toggle" Ta "v" Ta "R"
859 .It Li "Scroll down" Ta "C-Down or C-e" Ta "C-Down"
860 .It Li "Scroll up" Ta "C-Up or C-y" Ta "C-Up"
861 .It Li "Search again" Ta "n" Ta "n"
862 .It Li "Search again in reverse" Ta "N" Ta "N"
863 .It Li "Search backward" Ta "?" Ta "C-r"
864 .It Li "Search forward" Ta "/" Ta "C-s"
865 .It Li "Start of line" Ta "0" Ta "C-a"
866 .It Li "Start selection" Ta "Space" Ta "C-Space"
867 .It Li "Top of history" Ta "g" Ta "M->"
868 .It Li "Transpose characters" Ta "" Ta "C-t"
871 The next and previous word keys use space and the
872 .Ql - ,
873 .Ql _
875 .Ql @
876 characters as word delimiters by default, but this can be adjusted by
877 setting the
878 .Em word-separators
879 session option.
880 Next word moves to the start of the next word, next word end to the end of the
881 next word and previous word to the start of the previous word.
882 The three next and previous space keys work similarly but use a space alone as
883 the word separator.
885 The jump commands enable quick movement within a line.
886 For instance, typing
887 .Ql f
888 followed by
889 .Ql /
890 will move the cursor to the next
891 .Ql /
892 character on the current line.
894 .Ql \&;
895 will then jump to the next occurrence.
897 Commands in copy mode may be prefaced by an optional repeat count.
898 With vi key bindings, a prefix is entered using the number keys; with
899 emacs, the Alt (meta) key and a number begins prefix entry.
900 For example, to move the cursor forward by ten words, use
901 .Ql M-1 0 M-f
902 in emacs mode, and
903 .Ql 10w
904 in vi.
906 When copying the selection, the repeat count indicates the buffer index to
907 replace, if used.
909 Mode key bindings are defined in a set of named tables:
910 .Em vi-edit
912 .Em emacs-edit
913 for keys used when line editing at the command prompt;
914 .Em vi-choice
916 .Em emacs-choice
917 for keys used when choosing from lists (such as produced by the
918 .Ic choose-window
919 command); and
920 .Em vi-copy
922 .Em emacs-copy
923 used in copy mode.
924 The tables may be viewed with the
925 .Ic list-keys
926 command and keys modified or removed with
927 .Ic bind-key
929 .Ic unbind-key .
930 One command accepts an argument,
931 .Ic copy-pipe ,
932 which copies the selection and pipes it to a command.
933 For example the following will bind
934 .Ql C-q
935 to copy the selection into
936 .Pa /tmp
937 as well as the paste buffer:
938 .Bd -literal -offset indent
939 bind-key -temacs-copy C-q copy-pipe "cat >/tmp/out"
942 The paste buffer key pastes the first line from the top paste buffer on the
943 stack.
945 The synopsis for the
946 .Ic copy-mode
947 command is:
948 .Bl -tag -width Ds
949 .It Xo Ic copy-mode
950 .Op Fl u
951 .Op Fl t Ar target-pane
953 Enter copy mode.
955 .Fl u
956 option scrolls one page up.
959 Each window displayed by
961 may be split into one or more
962 .Em panes ;
963 each pane takes up a certain area of the display and is a separate terminal.
964 A window may be split into panes using the
965 .Ic split-window
966 command.
967 Windows may be split horizontally (with the
968 .Fl h
969 flag) or vertically.
970 Panes may be resized with the
971 .Ic resize-pane
972 command (bound to
973 .Ql C-up ,
974 .Ql C-down
975 .Ql C-left
977 .Ql C-right
978 by default), the current pane may be changed with the
979 .Ic select-pane
980 command and the
981 .Ic rotate-window
983 .Ic swap-pane
984 commands may be used to swap panes without changing their position.
985 Panes are numbered beginning from zero in the order they are created.
987 A number of preset
988 .Em layouts
989 are available.
990 These may be selected with the
991 .Ic select-layout
992 command or cycled with
993 .Ic next-layout
994 (bound to
995 .Ql Space
996 by default); once a layout is chosen, panes within it may be moved and resized
997 as normal.
999 The following layouts are supported:
1000 .Bl -tag -width Ds
1001 .It Ic even-horizontal
1002 Panes are spread out evenly from left to right across the window.
1003 .It Ic even-vertical
1004 Panes are spread evenly from top to bottom.
1005 .It Ic main-horizontal
1006 A large (main) pane is shown at the top of the window and the remaining panes
1007 are spread from left to right in the leftover space at the bottom.
1008 Use the
1009 .Em main-pane-height
1010 window option to specify the height of the top pane.
1011 .It Ic main-vertical
1012 Similar to
1013 .Ic main-horizontal
1014 but the large pane is placed on the left and the others spread from top to
1015 bottom along the right.
1016 See the
1017 .Em main-pane-width
1018 window option.
1019 .It Ic tiled
1020 Panes are spread out as evenly as possible over the window in both rows and
1021 columns.
1024 In addition,
1025 .Ic select-layout
1026 may be used to apply a previously used layout - the
1027 .Ic list-windows
1028 command displays the layout of each window in a form suitable for use with
1029 .Ic select-layout .
1030 For example:
1031 .Bd -literal -offset indent
1032 $ tmux list-windows
1033 0: ksh [159x48]
1034     layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
1035 $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
1039 automatically adjusts the size of the layout for the current window size.
1040 Note that a layout cannot be applied to a window with more panes than that
1041 from which the layout was originally defined.
1043 Commands related to windows and panes are as follows:
1044 .Bl -tag -width Ds
1045 .It Xo Ic break-pane
1046 .Op Fl dP
1047 .Op Fl F Ar format
1048 .Op Fl t Ar target-pane
1050 .D1 (alias: Ic breakp )
1051 Break
1052 .Ar target-pane
1053 off from its containing window to make it the only pane in a new window.
1055 .Fl d
1056 is given, the new window does not become the current window.
1058 .Fl P
1059 option prints information about the new window after it has been created.
1060 By default, it uses the format
1061 .Ql #{session_name}:#{window_index}
1062 but a different format may be specified with
1063 .Fl F .
1064 .It Xo Ic capture-pane
1065 .Op Fl e
1066 .Op Fl p
1067 .Op Fl b Ar buffer-index
1068 .Op Fl E Ar end-line
1069 .Op Fl S Ar start-line
1070 .Op Fl t Ar target-pane
1072 .D1 (alias: Ic capturep )
1073 Capture the contents of a pane.
1075 .Fl p
1076 is given, the output goes to stdout, otherwise to the buffer specified with
1077 .Fl b
1078 or a new buffer if omitted.
1080 .Fl e
1081 is given, the output includes escape sequences for text and background
1082 attributes.
1083 .Fl C
1084 also escapes non-printable characters as octal \exxx.
1085 .Fl J
1086 joins wrapped lines.
1088 .Fl S
1090 .Fl E
1091 specify the starting and ending line numbers, zero is the first line of the
1092 visible pane and negative numbers are lines in the history.
1093 The default is to capture only the visible contents of the pane.
1094 .It Xo
1095 .Ic choose-client
1096 .Op Fl F Ar format
1097 .Op Fl t Ar target-window
1098 .Op Ar template
1100 Put a window into client choice mode, allowing a client to be selected
1101 interactively from a list.
1102 After a client is chosen,
1103 .Ql %%
1104 is replaced by the client
1105 .Xr pty 4
1106 path in
1107 .Ar template
1108 and the result executed as a command.
1110 .Ar template
1111 is not given, "detach-client -t '%%'" is used.
1112 For the meaning of the
1113 .Fl F
1114 flag, see the
1115 .Sx FORMATS
1116 section.
1117 This command works only if at least one client is attached.
1118 .It Xo
1119 .Ic choose-list
1120 .Op Fl l Ar items
1121 .Op Fl t Ar target-window
1122 .Op Ar template
1124 Put a window into list choice mode, allowing
1125 .Ar items
1126 to be selected.
1127 .Ar items
1128 can be a comma-separated list to display more than one item.
1129 If an item has spaces, that entry must be quoted.
1130 After an item is chosen,
1131 .Ql %%
1132 is replaced by the chosen item in the
1133 .Ar template
1134 and the result is executed as a command.
1136 .Ar template
1137 is not given, "run-shell '%%'" is used.
1138 .Ar items
1139 also accepts format specifiers.
1140 For the meaning of this see the
1141 .Sx FORMATS
1142 section.
1143 This command works only if at least one client is attached.
1144 .It Xo
1145 .Ic choose-session
1146 .Op Fl F Ar format
1147 .Op Fl t Ar target-window
1148 .Op Ar template
1150 Put a window into session choice mode, where a session may be selected
1151 interactively from a list.
1152 When one is chosen,
1153 .Ql %%
1154 is replaced by the session name in
1155 .Ar template
1156 and the result executed as a command.
1158 .Ar template
1159 is not given, "switch-client -t '%%'" is used.
1160 For the meaning of the
1161 .Fl F
1162 flag, see the
1163 .Sx FORMATS
1164 section.
1165 This command works only if at least one client is attached.
1166 .It Xo
1167 .Ic choose-tree
1168 .Op Fl suw
1169 .Op Fl b Ar session-template
1170 .Op Fl c Ar window-template
1171 .Op Fl S Ar format
1172 .Op Fl W Ar format
1173 .Op Fl t Ar target-window
1175 Put a window into tree choice mode, where either sessions or windows may be
1176 selected interactively from a list.
1177 By default, windows belonging to a session are indented to show their
1178 relationship to a session.
1180 Note that the
1181 .Ic choose-window
1183 .Ic choose-session
1184 commands are wrappers around
1185 .Ic choose-tree .
1188 .Fl s
1189 is given, will show sessions.
1191 .Fl w
1192 is given, will show windows.
1194 By default, the tree is collapsed and sessions must be expanded to windows
1195 with the right arrow key.
1197 .Fl u
1198 option will start with all sessions expanded instead.
1201 .Fl b
1202 is given, will override the default session command.
1203 Note that
1204 .Ql %%
1205 can be used and will be replaced with the session name.
1206 The default option if not specified is "switch-client -t '%%'".
1208 .Fl c
1209 is given, will override the default window command.
1210 Like
1211 .Fl b ,
1212 .Ql %%
1213 can be used and will be replaced with the session name and window index.
1214 When a window is chosen from the list, the session command is run before the
1215 window command.
1218 .Fl S
1219 is given will display the specified format instead of the default session
1220 format.
1222 .Fl W
1223 is given will display the specified format instead of the default window
1224 format.
1225 For the meaning of the
1226 .Fl s
1228 .Fl w
1229 options, see the
1230 .Sx FORMATS
1231 section.
1233 This command works only if at least one client is attached.
1234 .It Xo
1235 .Ic choose-window
1236 .Op Fl F Ar format
1237 .Op Fl t Ar target-window
1238 .Op Ar template
1240 Put a window into window choice mode, where a window may be chosen
1241 interactively from a list.
1242 After a window is selected,
1243 .Ql %%
1244 is replaced by the session name and window index in
1245 .Ar template
1246 and the result executed as a command.
1248 .Ar template
1249 is not given, "select-window -t '%%'" is used.
1250 For the meaning of the
1251 .Fl F
1252 flag, see the
1253 .Sx FORMATS
1254 section.
1255 This command works only if at least one client is attached.
1256 .It Ic display-panes Op Fl t Ar target-client
1257 .D1 (alias: Ic displayp)
1258 Display a visible indicator of each pane shown by
1259 .Ar target-client .
1260 See the
1261 .Ic display-panes-time ,
1262 .Ic display-panes-colour ,
1264 .Ic display-panes-active-colour
1265 session options.
1266 While the indicator is on screen, a pane may be selected with the
1267 .Ql 0
1269 .Ql 9
1270 keys.
1271 .It Xo Ic find-window
1272 .Op Fl CNT
1273 .Op Fl F Ar format
1274 .Op Fl t Ar target-window
1275 .Ar match-string
1277 .D1 (alias: Ic findw )
1278 Search for the
1279 .Xr fnmatch 3
1280 pattern
1281 .Ar match-string
1282 in window names, titles, and visible content (but not history).
1283 The flags control matching behavior:
1284 .Fl C
1285 matches only visible window contents,
1286 .Fl N
1287 matches only the window name and
1288 .Fl T
1289 matches only the window title.
1290 The default is
1291 .Fl CNT .
1292 If only one window is matched, it'll be automatically selected,
1293 otherwise a choice list is shown.
1294 For the meaning of the
1295 .Fl F
1296 flag, see the
1297 .Sx FORMATS
1298 section.
1299 This command works only if at least one client is attached.
1300 .It Xo Ic join-pane
1301 .Op Fl bdhv
1302 .Oo Fl l
1303 .Ar size |
1304 .Fl p Ar percentage Oc
1305 .Op Fl s Ar src-pane
1306 .Op Fl t Ar dst-pane
1308 .D1 (alias: Ic joinp )
1309 Like
1310 .Ic split-window ,
1311 but instead of splitting
1312 .Ar dst-pane
1313 and creating a new pane, split it and move
1314 .Ar src-pane
1315 into the space.
1316 This can be used to reverse
1317 .Ic break-pane .
1319 .Fl b
1320 option causes
1321 .Ar src-pane
1322 to be joined to left of or above
1323 .Ar dst-pane .
1324 .It Xo Ic kill-pane
1325 .Op Fl a
1326 .Op Fl t Ar target-pane
1328 .D1 (alias: Ic killp )
1329 Destroy the given pane.
1330 If no panes remain in the containing window, it is also destroyed.
1332 .Fl a
1333 option kills all but the pane given with
1334 .Fl t .
1335 .It Xo Ic kill-window
1336 .Op Fl a
1337 .Op Fl t Ar target-window
1339 .D1 (alias: Ic killw )
1340 Kill the current window or the window at
1341 .Ar target-window ,
1342 removing it from any sessions to which it is linked.
1344 .Fl a
1345 option kills all but the window given with
1346 .Fl t .
1347 .It Ic last-pane Op Fl t Ar target-window
1348 .D1 (alias: Ic lastp )
1349 Select the last (previously selected) pane.
1350 .It Ic last-window Op Fl t Ar target-session
1351 .D1 (alias: Ic last )
1352 Select the last (previously selected) window.
1353 If no
1354 .Ar target-session
1355 is specified, select the last window of the current session.
1356 .It Xo Ic link-window
1357 .Op Fl dk
1358 .Op Fl s Ar src-window
1359 .Op Fl t Ar dst-window
1361 .D1 (alias: Ic linkw )
1362 Link the window at
1363 .Ar src-window
1364 to the specified
1365 .Ar dst-window .
1367 .Ar dst-window
1368 is specified and no such window exists, the
1369 .Ar src-window
1370 is linked there.
1372 .Fl k
1373 is given and
1374 .Ar dst-window
1375 exists, it is killed, otherwise an error is generated.
1377 .Fl d
1378 is given, the newly linked window is not selected.
1379 .It Xo Ic list-panes
1380 .Op Fl as
1381 .Op Fl F Ar format
1382 .Op Fl t Ar target
1384 .D1 (alias: Ic lsp )
1386 .Fl a
1387 is given,
1388 .Ar target
1389 is ignored and all panes on the server are listed.
1391 .Fl s
1392 is given,
1393 .Ar target
1394 is a session (or the current session).
1395 If neither is given,
1396 .Ar target
1397 is a window (or the current window).
1398 For the meaning of the
1399 .Fl F
1400 flag, see the
1401 .Sx FORMATS
1402 section.
1403 .It Xo Ic list-windows
1404 .Op Fl a
1405 .Op Fl F Ar format
1406 .Op Fl t Ar target-session
1408 .D1 (alias: Ic lsw )
1410 .Fl a
1411 is given, list all windows on the server.
1412 Otherwise, list windows in the current session or in
1413 .Ar target-session .
1414 For the meaning of the
1415 .Fl F
1416 flag, see the
1417 .Sx FORMATS
1418 section.
1419 .It Xo Ic move-pane
1420 .Op Fl bdhv
1421 .Oo Fl l
1422 .Ar size |
1423 .Fl p Ar percentage Oc
1424 .Op Fl s Ar src-pane
1425 .Op Fl t Ar dst-pane
1427 .D1 (alias: Ic movep )
1428 Like
1429 .Ic join-pane ,
1431 .Ar src-pane
1433 .Ar dst-pane
1434 may belong to the same window.
1435 .It Xo Ic move-window
1436 .Op Fl rdk
1437 .Op Fl s Ar src-window
1438 .Op Fl t Ar dst-window
1440 .D1 (alias: Ic movew )
1441 This is similar to
1442 .Ic link-window ,
1443 except the window at
1444 .Ar src-window
1445 is moved to
1446 .Ar dst-window .
1447 With
1448 .Fl r ,
1449 all windows in the session are renumbered in sequential order, respecting
1451 .Ic base-index
1452 option.
1453 .It Xo Ic new-window
1454 .Op Fl adkP
1455 .Op Fl c Ar start-directory
1456 .Op Fl n Ar window-name
1457 .Op Fl t Ar target-window
1458 .Op Fl F Ar format
1459 .Op Ar shell-command
1461 .D1 (alias: Ic neww )
1462 Create a new window.
1463 With
1464 .Fl a ,
1465 the new window is inserted at the next index up from the specified
1466 .Ar target-window ,
1467 moving windows up if necessary,
1468 otherwise
1469 .Ar target-window
1470 is the new window location.
1473 .Fl d
1474 is given, the session does not make the new window the current window.
1475 .Ar target-window
1476 represents the window to be created; if the target already exists an error is
1477 shown, unless the
1478 .Fl k
1479 flag is used, in which case it is destroyed.
1480 .Ar shell-command
1481 is the command to execute.
1483 .Ar shell-command
1484 is not specified, the value of the
1485 .Ic default-command
1486 option is used.
1487 .Fl c
1488 specifies the working directory in which the new window is created.
1489 It may have an absolute path or one of the following values (or a subdirectory):
1490 .Bl -column "XXXXXXXXXXXX" "XXXXXXXXXXXXXXXXXXXXXXXX" -offset indent
1491 .It Li "Empty string" Ta "Current pane's directory"
1492 .It Li "~" Ta "User's home directory"
1493 .It Li "-" Ta "Where session was started"
1494 .It Li "." Ta "Where server was started"
1497 When the shell command completes, the window closes.
1498 See the
1499 .Ic remain-on-exit
1500 option to change this behaviour.
1503 .Ev TERM
1504 environment variable must be set to
1505 .Dq screen
1506 for all programs running
1507 .Em inside
1508 .Nm .
1509 New windows will automatically have
1510 .Dq TERM=screen
1511 added to their environment, but care must be taken not to reset this in shell
1512 start-up files.
1515 .Fl P
1516 option prints information about the new window after it has been created.
1517 By default, it uses the format
1518 .Ql #{session_name}:#{window_index}
1519 but a different format may be specified with
1520 .Fl F .
1521 .It Ic next-layout Op Fl t Ar target-window
1522 .D1 (alias: Ic nextl )
1523 Move a window to the next layout and rearrange the panes to fit.
1524 .It Xo Ic next-window
1525 .Op Fl a
1526 .Op Fl t Ar target-session
1528 .D1 (alias: Ic next )
1529 Move to the next window in the session.
1531 .Fl a
1532 is used, move to the next window with an alert.
1533 .It Xo Ic pipe-pane
1534 .Op Fl o
1535 .Op Fl t Ar target-pane
1536 .Op Ar shell-command
1538 .D1 (alias: Ic pipep )
1539 Pipe any output sent by the program in
1540 .Ar target-pane
1541 to a shell command.
1542 A pane may only be piped to one command at a time, any existing pipe is
1543 closed before
1544 .Ar shell-command
1545 is executed.
1547 .Ar shell-command
1548 string may contain the special character sequences supported by the
1549 .Ic status-left
1550 option.
1551 If no
1552 .Ar shell-command
1553 is given, the current pipe (if any) is closed.
1556 .Fl o
1557 option only opens a new pipe if no previous pipe exists, allowing a pipe to
1558 be toggled with a single key, for example:
1559 .Bd -literal -offset indent
1560 bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1562 .It Xo Ic previous-layout
1563 .Op Fl t Ar target-window
1565 .D1 (alias: Ic prevl )
1566 Move to the previous layout in the session.
1567 .It Xo Ic previous-window
1568 .Op Fl a
1569 .Op Fl t Ar target-session
1571 .D1 (alias: Ic prev )
1572 Move to the previous window in the session.
1573 With
1574 .Fl a ,
1575 move to the previous window with an alert.
1576 .It Xo Ic rename-window
1577 .Op Fl t Ar target-window
1578 .Ar new-name
1580 .D1 (alias: Ic renamew )
1581 Rename the current window, or the window at
1582 .Ar target-window
1583 if specified, to
1584 .Ar new-name .
1585 .It Xo Ic resize-pane
1586 .Op Fl DLRUZ
1587 .Op Fl t Ar target-pane
1588 .Op Fl x Ar width
1589 .Op Fl y Ar height
1590 .Op Ar adjustment
1592 .D1 (alias: Ic resizep )
1593 Resize a pane, up, down, left or right by
1594 .Ar adjustment
1595 with
1596 .Fl U ,
1597 .Fl D ,
1598 .Fl L
1600 .Fl R ,
1602 to an absolute size
1603 with
1604 .Fl x
1606 .Fl y .
1608 .Ar adjustment
1609 is given in lines or cells (the default is 1).
1611 With
1612 .Fl Z ,
1613 the active pane is toggled between occupying the whole of the window and its
1614 normal position in the layout.
1615 .It Xo Ic respawn-pane
1616 .Op Fl k
1617 .Op Fl t Ar target-pane
1618 .Op Ar shell-command
1620 .D1 (alias: Ic respawnp )
1621 Reactivate a pane in which the command has exited (see the
1622 .Ic remain-on-exit
1623 window option).
1625 .Ar shell-command
1626 is not given, the command used when the pane was created is executed.
1627 The pane must be already inactive, unless
1628 .Fl k
1629 is given, in which case any existing command is killed.
1630 .It Xo Ic respawn-window
1631 .Op Fl k
1632 .Op Fl t Ar target-window
1633 .Op Ar shell-command
1635 .D1 (alias: Ic respawnw )
1636 Reactivate a window in which the command has exited (see the
1637 .Ic remain-on-exit
1638 window option).
1640 .Ar shell-command
1641 is not given, the command used when the window was created is executed.
1642 The window must be already inactive, unless
1643 .Fl k
1644 is given, in which case any existing command is killed.
1645 .It Xo Ic rotate-window
1646 .Op Fl DU
1647 .Op Fl t Ar target-window
1649 .D1 (alias: Ic rotatew )
1650 Rotate the positions of the panes within a window, either upward (numerically
1651 lower) with
1652 .Fl U
1653 or downward (numerically higher).
1654 .It Xo Ic select-layout
1655 .Op Fl np
1656 .Op Fl t Ar target-window
1657 .Op Ar layout-name
1659 .D1 (alias: Ic selectl )
1660 Choose a specific layout for a window.
1662 .Ar layout-name
1663 is not given, the last preset layout used (if any) is reapplied.
1664 .Fl n
1666 .Fl p
1667 are equivalent to the
1668 .Ic next-layout
1670 .Ic previous-layout
1671 commands.
1672 .It Xo Ic select-pane
1673 .Op Fl lDLRU
1674 .Op Fl t Ar target-pane
1676 .D1 (alias: Ic selectp )
1677 Make pane
1678 .Ar target-pane
1679 the active pane in window
1680 .Ar target-window .
1681 If one of
1682 .Fl D ,
1683 .Fl L ,
1684 .Fl R ,
1686 .Fl U
1687 is used, respectively the pane below, to the left, to the right, or above the
1688 target pane is used.
1689 .Fl l
1690 is the same as using the
1691 .Ic last-pane
1692 command.
1693 .It Xo Ic select-window
1694 .Op Fl lnpT
1695 .Op Fl t Ar target-window
1697 .D1 (alias: Ic selectw )
1698 Select the window at
1699 .Ar target-window .
1700 .Fl l ,
1701 .Fl n
1703 .Fl p
1704 are equivalent to the
1705 .Ic last-window ,
1706 .Ic next-window
1708 .Ic previous-window
1709 commands.
1711 .Fl T
1712 is given and the selected window is already the current window,
1713 the command behaves like
1714 .Ic last-window .
1715 .It Xo Ic split-window
1716 .Op Fl dhvP
1717 .Op Fl c Ar start-directory
1718 .Oo Fl l
1719 .Ar size |
1720 .Fl p Ar percentage Oc
1721 .Op Fl t Ar target-pane
1722 .Op Ar shell-command
1723 .Op Fl F Ar format
1725 .D1 (alias: Ic splitw )
1726 Create a new pane by splitting
1727 .Ar target-pane :
1728 .Fl h
1729 does a horizontal split and
1730 .Fl v
1731 a vertical split; if neither is specified,
1732 .Fl v
1733 is assumed.
1735 .Fl l
1737 .Fl p
1738 options specify the size of the new pane in lines (for vertical split) or in
1739 cells (for horizontal split), or as a percentage, respectively.
1740 All other options have the same meaning as for the
1741 .Ic new-window
1742 command.
1743 .It Xo Ic swap-pane
1744 .Op Fl dDU
1745 .Op Fl s Ar src-pane
1746 .Op Fl t Ar dst-pane
1748 .D1 (alias: Ic swapp )
1749 Swap two panes.
1751 .Fl U
1752 is used and no source pane is specified with
1753 .Fl s ,
1754 .Ar dst-pane
1755 is swapped with the previous pane (before it numerically);
1756 .Fl D
1757 swaps with the next pane (after it numerically).
1758 .Fl d
1759 instructs
1761 not to change the active pane.
1762 .It Xo Ic swap-window
1763 .Op Fl d
1764 .Op Fl s Ar src-window
1765 .Op Fl t Ar dst-window
1767 .D1 (alias: Ic swapw )
1768 This is similar to
1769 .Ic link-window ,
1770 except the source and destination windows are swapped.
1771 It is an error if no window exists at
1772 .Ar src-window .
1773 .It Xo Ic unlink-window
1774 .Op Fl k
1775 .Op Fl t Ar target-window
1777 .D1 (alias: Ic unlinkw )
1778 Unlink
1779 .Ar target-window .
1780 Unless
1781 .Fl k
1782 is given, a window may be unlinked only if it is linked to multiple sessions -
1783 windows may not be linked to no sessions;
1785 .Fl k
1786 is specified and the window is linked to only one session, it is unlinked and
1787 destroyed.
1789 .Sh KEY BINDINGS
1791 allows a command to be bound to most keys, with or without a prefix key.
1792 When specifying keys, most represent themselves (for example
1793 .Ql A
1795 .Ql Z ) .
1796 Ctrl keys may be prefixed with
1797 .Ql C-
1799 .Ql ^ ,
1800 and Alt (meta) with
1801 .Ql M- .
1802 In addition, the following special key names are accepted:
1803 .Em Up ,
1804 .Em Down ,
1805 .Em Left ,
1806 .Em Right ,
1807 .Em BSpace ,
1808 .Em BTab ,
1809 .Em DC
1810 (Delete),
1811 .Em End ,
1812 .Em Enter ,
1813 .Em Escape ,
1814 .Em F1
1816 .Em F20 ,
1817 .Em Home ,
1818 .Em IC
1819 (Insert),
1820 .Em NPage/PageDown/PgDn ,
1821 .Em PPage/PageUp/PgUp ,
1822 .Em Space ,
1824 .Em Tab .
1825 Note that to bind the
1826 .Ql \&"
1828 .Ql '
1829 keys, quotation marks are necessary, for example:
1830 .Bd -literal -offset indent
1831 bind-key '"' split-window
1832 bind-key "'" new-window
1835 Commands related to key bindings are as follows:
1836 .Bl -tag -width Ds
1837 .It Xo Ic bind-key
1838 .Op Fl cnr
1839 .Op Fl t Ar key-table
1840 .Ar key Ar command Op Ar arguments
1842 .D1 (alias: Ic bind )
1843 Bind key
1844 .Ar key
1846 .Ar command .
1847 By default (without
1848 .Fl t )
1849 the primary key bindings are modified (those normally activated with the prefix
1850 key); in this case, if
1851 .Fl n
1852 is specified, it is not necessary to use the prefix key,
1853 .Ar command
1854 is bound to
1855 .Ar key
1856 alone.
1858 .Fl r
1859 flag indicates this key may repeat, see the
1860 .Ic repeat-time
1861 option.
1864 .Fl t
1865 is present,
1866 .Ar key
1867 is bound in
1868 .Ar key-table :
1869 the binding for command mode with
1870 .Fl c
1871 or for normal mode without.
1872 To view the default bindings and possible commands, see the
1873 .Ic list-keys
1874 command.
1875 .It Ic list-keys Op Fl t Ar key-table
1876 .D1 (alias: Ic lsk )
1877 List all key bindings.
1878 Without
1879 .Fl t
1880 the primary key bindings - those executed when preceded by the prefix key -
1881 are printed.
1883 With
1884 .Fl t ,
1885 the key bindings in
1886 .Ar key-table
1887 are listed; this may be one of:
1888 .Em vi-edit ,
1889 .Em emacs-edit ,
1890 .Em vi-choice ,
1891 .Em emacs-choice ,
1892 .Em vi-copy
1894 .Em emacs-copy .
1895 .It Xo Ic send-keys
1896 .Op Fl lR
1897 .Op Fl t Ar target-pane
1898 .Ar key Ar ...
1900 .D1 (alias: Ic send )
1901 Send a key or keys to a window.
1902 Each argument
1903 .Ar key
1904 is the name of the key (such as
1905 .Ql C-a
1907 .Ql npage
1908 ) to send; if the string is not recognised as a key, it is sent as a series of
1909 characters.
1911 .Fl l
1912 flag disables key name lookup and sends the keys literally.
1913 All arguments are sent sequentially from first to last.
1915 .Fl R
1916 flag causes the terminal state to be reset.
1917 .It Xo Ic send-prefix
1918 .Op Fl 2
1919 .Op Fl t Ar target-pane
1921 Send the prefix key, or with
1922 .Fl 2
1923 the secondary prefix key, to a window as if it was pressed.
1924 .It Xo Ic unbind-key
1925 .Op Fl acn
1926 .Op Fl t Ar key-table
1927 .Ar key
1929 .D1 (alias: Ic unbind )
1930 Unbind the command bound to
1931 .Ar key .
1932 Without
1933 .Fl t
1934 the primary key bindings are modified; in this case, if
1935 .Fl n
1936 is specified, the command bound to
1937 .Ar key
1938 without a prefix (if any) is removed.
1940 .Fl a
1941 is present, all key bindings are removed.
1944 .Fl t
1945 is present,
1946 .Ar key
1948 .Ar key-table
1949 is unbound: the binding for command mode with
1950 .Fl c
1951 or for normal mode without.
1953 .Sh OPTIONS
1954 The appearance and behaviour of
1956 may be modified by changing the value of various options.
1957 There are three types of option:
1958 .Em server options ,
1959 .Em session options
1961 .Em window options .
1965 server has a set of global options which do not apply to any particular
1966 window or session.
1967 These are altered with the
1968 .Ic set-option
1969 .Fl s
1970 command, or displayed with the
1971 .Ic show-options
1972 .Fl s
1973 command.
1975 In addition, each individual session may have a set of session options, and
1976 there is a separate set of global session options.
1977 Sessions which do not have a particular option configured inherit the value
1978 from the global session options.
1979 Session options are set or unset with the
1980 .Ic set-option
1981 command and may be listed with the
1982 .Ic show-options
1983 command.
1984 The available server and session options are listed under the
1985 .Ic set-option
1986 command.
1988 Similarly, a set of window options is attached to each window, and there is
1989 a set of global window options from which any unset options are inherited.
1990 Window options are altered with the
1991 .Ic set-window-option
1992 command and can be listed with the
1993 .Ic show-window-options
1994 command.
1995 All window options are documented with the
1996 .Ic set-window-option
1997 command.
2000 also supports user options which are prefixed with a
2001 .Ql \&@ .
2002 User options may have any name, so long as they are prefixed with
2003 .Ql \&@ ,
2004 and be set to any string.
2005 For example
2006 .Bd -literal -offset indent
2007 $ tmux setw -q @foo "abc123"
2008 $ tmux showw -v @foo
2009 abc123
2012 Commands which set options are as follows:
2013 .Bl -tag -width Ds
2014 .It Xo Ic set-option
2015 .Op Fl agoqsuw
2016 .Op Fl t Ar target-session | Ar target-window
2017 .Ar option Ar value
2019 .D1 (alias: Ic set )
2020 Set a window option with
2021 .Fl w
2022 (equivalent to the
2023 .Ic set-window-option
2024 command),
2025 a server option with
2026 .Fl s ,
2027 otherwise a session option.
2030 .Fl g
2031 is specified, the global session or window option is set.
2032 With
2033 .Fl a ,
2034 and if the option expects a string,
2035 .Ar value
2036 is appended to the existing setting.
2038 .Fl u
2039 flag unsets an option, so a session inherits the option from the global
2040 options.
2041 It is not possible to unset a global option.
2044 .Fl o
2045 flag prevents setting an option that is already set.
2048 .Fl q
2049 flag suppresses the informational message (as if the
2050 .Ic quiet
2051 server option was set).
2053 Available window options are listed under
2054 .Ic set-window-option .
2056 .Ar value
2057 depends on the option and may be a number, a string, or a flag (on, off, or
2058 omitted to toggle).
2060 Available server options are:
2061 .Bl -tag -width Ds
2062 .It Ic buffer-limit Ar number
2063 Set the number of buffers; as new buffers are added to the top of the stack,
2064 old ones are removed from the bottom if necessary to maintain this maximum
2065 length.
2066 .It Ic escape-time Ar time
2067 Set the time in milliseconds for which
2069 waits after an escape is input to determine if it is part of a function or meta
2070 key sequences.
2071 The default is 500 milliseconds.
2072 .It Xo Ic exit-unattached
2073 .Op Ic on | off
2075 If enabled, the server will exit when there are no attached clients.
2076 .It Xo Ic quiet
2077 .Op Ic on | off
2079 Enable or disable the display of various informational messages (see also the
2080 .Fl q
2081 command line flag).
2082 .It Xo Ic set-clipboard
2083 .Op Ic on | off
2085 Attempt to set the terminal clipboard content using the
2086 \ee]52;...\e007
2087 .Xr xterm 1
2088 escape sequences.
2089 This option is on by default if there is an
2090 .Em \&Ms
2091 entry in the
2092 .Xr terminfo 5
2093 description for the client terminal.
2094 Note that this feature needs to be enabled in
2095 .Xr xterm 1
2096 by setting the resource:
2097 .Bd -literal -offset indent
2098 disallowedWindowOps: 20,21,SetXprop
2101 Or changing this property from the
2102 .Xr xterm 1
2103 interactive menu when required.
2106 Available session options are:
2107 .Bl -tag -width Ds
2108 .It Ic assume-paste-time Ar milliseconds
2109 If keys are entered faster than one in
2110 .Ar milliseconds ,
2111 they are assumed to have been pasted rather than typed and
2113 key bindings are not processed.
2114 The default is one millisecond and zero disables.
2115 .It Ic base-index Ar index
2116 Set the base index from which an unused index should be searched when a new
2117 window is created.
2118 The default is zero.
2119 .It Xo Ic bell-action
2120 .Op Ic any | none | current
2122 Set action on window bell.
2123 .Ic any
2124 means a bell in any window linked to a session causes a bell in the current
2125 window of that session,
2126 .Ic none
2127 means all bells are ignored and
2128 .Ic current
2129 means only bells in windows other than the current window are ignored.
2130 .It Xo Ic bell-on-alert
2131 .Op Ic on | off
2133 If on, ring the terminal bell when an alert
2134 occurs.
2135 .It Ic default-command Ar shell-command
2136 Set the command used for new windows (if not specified when the window is
2137 created) to
2138 .Ar shell-command ,
2139 which may be any
2140 .Xr sh 1
2141 command.
2142 The default is an empty string, which instructs
2144 to create a login shell using the value of the
2145 .Ic default-shell
2146 option.
2147 .It Ic default-path Ar path
2148 Set the default working directory for new panes.
2149 If empty (the default), the working directory is determined from the process
2150 running in the active pane, from the command line environment or from the
2151 working directory where the session was created.
2152 Otherwise the same options are available as for the
2153 .Fl c
2154 flag to
2155 .Ic new-window .
2156 .It Ic default-shell Ar path
2157 Specify the default shell.
2158 This is used as the login shell for new windows when the
2159 .Ic default-command
2160 option is set to empty, and must be the full path of the executable.
2161 When started
2163 tries to set a default value from the first suitable of the
2164 .Ev SHELL
2165 environment variable, the shell returned by
2166 .Xr getpwuid 3 ,
2168 .Pa /bin/sh .
2169 This option should be configured when
2171 is used as a login shell.
2172 .It Ic default-terminal Ar terminal
2173 Set the default terminal for new windows created in this session - the
2174 default value of the
2175 .Ev TERM
2176 environment variable.
2179 to work correctly, this
2180 .Em must
2181 be set to
2182 .Ql screen
2183 or a derivative of it.
2184 .It Xo Ic destroy-unattached
2185 .Op Ic on | off
2187 If enabled and the session is no longer attached to any clients, it is
2188 destroyed.
2189 .It Xo Ic detach-on-destroy
2190 .Op Ic on | off
2192 If on (the default), the client is detached when the session it is attached to
2193 is destroyed.
2194 If off, the client is switched to the most recently active of the remaining
2195 sessions.
2196 .It Ic display-panes-active-colour Ar colour
2197 Set the colour used by the
2198 .Ic display-panes
2199 command to show the indicator for the active pane.
2200 .It Ic display-panes-colour Ar colour
2201 Set the colour used by the
2202 .Ic display-panes
2203 command to show the indicators for inactive panes.
2204 .It Ic display-panes-time Ar time
2205 Set the time in milliseconds for which the indicators shown by the
2206 .Ic display-panes
2207 command appear.
2208 .It Ic display-time Ar time
2209 Set the amount of time for which status line messages and other on-screen
2210 indicators are displayed.
2211 .Ar time
2212 is in milliseconds.
2213 .It Ic history-limit Ar lines
2214 Set the maximum number of lines held in window history.
2215 This setting applies only to new windows - existing window histories are not
2216 resized and retain the limit at the point they were created.
2217 .It Ic lock-after-time Ar number
2218 Lock the session (like the
2219 .Ic lock-session
2220 command) after
2221 .Ar number
2222 seconds of inactivity, or the entire server (all sessions) if the
2223 .Ic lock-server
2224 option is set.
2225 The default is not to lock (set to 0).
2226 .It Ic lock-command Ar shell-command
2227 Command to run when locking each client.
2228 The default is to run
2229 .Xr lock 1
2230 with
2231 .Fl np .
2232 .It Xo Ic lock-server
2233 .Op Ic on | off
2235 If this option is
2236 .Ic on
2237 (the default),
2238 instead of each session locking individually as each has been
2239 idle for
2240 .Ic lock-after-time ,
2241 the entire server will lock after
2242 .Em all
2243 sessions would have locked.
2244 This has no effect as a session option; it must be set as a global option.
2245 .It Ic message-attr Ar attributes
2246 Set status line message attributes, where
2247 .Ar attributes
2248 is either
2249 .Ic none
2250 or a comma-delimited list of one or more of:
2251 .Ic bright
2253 .Ic bold ) ,
2254 .Ic dim ,
2255 .Ic underscore ,
2256 .Ic blink ,
2257 .Ic reverse ,
2258 .Ic hidden ,
2260 .Ic italics .
2261 .It Ic message-bg Ar colour
2262 Set status line message background colour, where
2263 .Ar colour
2264 is one of:
2265 .Ic black ,
2266 .Ic red ,
2267 .Ic green ,
2268 .Ic yellow ,
2269 .Ic blue ,
2270 .Ic magenta ,
2271 .Ic cyan ,
2272 .Ic white ,
2273 aixterm bright variants (if supported:
2274 .Ic brightred ,
2275 .Ic brightgreen ,
2276 and so on),
2277 .Ic colour0
2279 .Ic colour255
2280 from the 256-colour set,
2281 .Ic default ,
2282 or a hexadecimal RGB string such as
2283 .Ql #ffffff ,
2284 which chooses the closest match from the default 256-colour set.
2285 .It Ic message-command-attr Ar attributes
2286 Set status line message attributes when in command mode.
2287 .It Ic message-command-bg Ar colour
2288 Set status line message background colour when in command mode.
2289 .It Ic message-command-fg Ar colour
2290 Set status line message foreground colour when in command mode.
2291 .It Ic message-fg Ar colour
2292 Set status line message foreground colour.
2293 .It Ic message-limit Ar number
2294 Set the number of error or information messages to save in the message log for
2295 each client.
2296 The default is 20.
2297 .It Xo Ic mouse-resize-pane
2298 .Op Ic on | off
2300 If on,
2302 captures the mouse and allows panes to be resized by dragging on their borders.
2303 .It Xo Ic mouse-select-pane
2304 .Op Ic on | off
2306 If on,
2308 captures the mouse and when a window is split into multiple panes the mouse may
2309 be used to select the current pane.
2310 The mouse click is also passed through to the application as normal.
2311 .It Xo Ic mouse-select-window
2312 .Op Ic on | off
2314 If on, clicking the mouse on a window name in the status line will select that
2315 window.
2316 .It Xo Ic mouse-utf8
2317 .Op Ic on | off
2319 If enabled, request mouse input as UTF-8 on UTF-8 terminals.
2320 .It Ic pane-active-border-bg Ar colour
2321 .It Ic pane-active-border-fg Ar colour
2322 Set the pane border colour for the currently active pane.
2323 .It Ic pane-border-bg Ar colour
2324 .It Ic pane-border-fg Ar colour
2325 Set the pane border colour for panes aside from the active pane.
2326 .It Ic prefix Ar key
2327 Set the key accepted as a prefix key.
2328 .It Ic prefix2 Ar key
2329 Set a secondary key accepted as a prefix key.
2330 .It Xo Ic renumber-windows
2331 .Op Ic on | off
2333 If on, when a window is closed in a session, automatically renumber the other
2334 windows in numerical order.
2335 This respects the
2336 .Ic base-index
2337 option if it has been set.
2338 If off, do not renumber the windows.
2339 .It Ic repeat-time Ar time
2340 Allow multiple commands to be entered without pressing the prefix-key again
2341 in the specified
2342 .Ar time
2343 milliseconds (the default is 500).
2344 Whether a key repeats may be set when it is bound using the
2345 .Fl r
2346 flag to
2347 .Ic bind-key .
2348 Repeat is enabled for the default keys bound to the
2349 .Ic resize-pane
2350 command.
2351 .It Xo Ic set-remain-on-exit
2352 .Op Ic on | off
2354 Set the
2355 .Ic remain-on-exit
2356 window option for any windows first created in this session.
2357 When this option is true, windows in which the running program has
2358 exited do not close, instead remaining open but inactivate.
2359 Use the
2360 .Ic respawn-window
2361 command to reactivate such a window, or the
2362 .Ic kill-window
2363 command to destroy it.
2364 .It Xo Ic set-titles
2365 .Op Ic on | off
2367 Attempt to set the client terminal title using the
2368 .Em tsl
2370 .Em fsl
2371 .Xr terminfo 5
2372 entries if they exist.
2374 automatically sets these to the \ee]2;...\e007 sequence if
2375 the terminal appears to be an xterm.
2376 This option is off by default.
2377 Note that elinks
2378 will only attempt to set the window title if the STY environment
2379 variable is set.
2380 .It Ic set-titles-string Ar string
2381 String used to set the window title if
2382 .Ic set-titles
2383 is on.
2384 Character sequences are replaced as for the
2385 .Ic status-left
2386 option.
2387 .It Xo Ic status
2388 .Op Ic on | off
2390 Show or hide the status line.
2391 .It Ic status-attr Ar attributes
2392 Set status line attributes.
2393 .It Ic status-bg Ar colour
2394 Set status line background colour.
2395 .It Ic status-fg Ar colour
2396 Set status line foreground colour.
2397 .It Ic status-interval Ar interval
2398 Update the status bar every
2399 .Ar interval
2400 seconds.
2401 By default, updates will occur every 15 seconds.
2402 A setting of zero disables redrawing at interval.
2403 .It Xo Ic status-justify
2404 .Op Ic left | centre | right
2406 Set the position of the window list component of the status line: left, centre
2407 or right justified.
2408 .It Xo Ic status-keys
2409 .Op Ic vi | emacs
2411 Use vi or emacs-style
2412 key bindings in the status line, for example at the command prompt.
2413 The default is emacs, unless the
2414 .Ev VISUAL
2416 .Ev EDITOR
2417 environment variables are set and contain the string
2418 .Ql vi .
2419 .It Ic status-left Ar string
2420 Display
2421 .Ar string
2422 to the left of the status bar.
2423 .Ar string
2424 will be passed through
2425 .Xr strftime 3
2426 before being used.
2427 By default, the session name is shown.
2428 .Ar string
2429 may contain any of the following special character sequences:
2430 .Bl -column "Character pair" "Replaced with" -offset indent
2431 .It Sy "Character pair" Ta Sy "Replaced with"
2432 .It Li "#(shell-command)" Ta "First line of the command's output"
2433 .It Li "#[attributes]" Ta "Colour or attribute change"
2434 .It Li "#H" Ta "Hostname of local host"
2435 .It Li "#h" Ta "Hostname of local host without the domain name"
2436 .It Li "#F" Ta "Current window flag"
2437 .It Li "#I" Ta "Current window index"
2438 .It Li "#D" Ta "Current pane unique identifier"
2439 .It Li "#P" Ta "Current pane index"
2440 .It Li "#S" Ta "Session name"
2441 .It Li "#T" Ta "Current pane title"
2442 .It Li "#W" Ta "Current window name"
2443 .It Li "##" Ta "A literal" Ql #
2446 The #(shell-command) form executes
2447 .Ql shell-command
2448 and inserts the first line of its output.
2449 Note that shell commands are only executed once at the interval specified by
2451 .Ic status-interval
2452 option: if the status line is redrawn in the meantime, the previous result is
2453 used.
2454 Shell commands are executed with the
2456 global environment set (see the
2457 .Sx ENVIRONMENT
2458 section).
2460 For details on how the names and titles can be set see the
2461 .Sx "NAMES AND TITLES"
2462 section.
2464 #[attributes] allows a comma-separated list of attributes to be specified,
2465 these may be
2466 .Ql fg=colour
2467 to set the foreground colour,
2468 .Ql bg=colour
2469 to set the background colour, the name of one of the attributes (listed under
2471 .Ic message-attr
2472 option) to turn an attribute on, or an attribute prefixed with
2473 .Ql no
2474 to turn one off, for example
2475 .Ic nobright .
2476 Examples are:
2477 .Bd -literal -offset indent
2478 #(sysctl vm.loadavg)
2479 #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
2482 Where appropriate, special character sequences may be prefixed with a number to
2483 specify the maximum length, for example
2484 .Ql #24T .
2486 By default, UTF-8 in
2487 .Ar string
2488 is not interpreted, to enable UTF-8, use the
2489 .Ic status-utf8
2490 option.
2491 .It Ic status-left-attr Ar attributes
2492 Set the attribute of the left part of the status line.
2493 .It Ic status-left-bg Ar colour
2494 Set the background colour of the left part of the status line.
2495 .It Ic status-left-fg Ar colour
2496 Set the foreground colour of the left part of the status line.
2497 .It Ic status-left-length Ar length
2498 Set the maximum
2499 .Ar length
2500 of the left component of the status bar.
2501 The default is 10.
2502 .It Xo Ic status-position
2503 .Op Ic top | bottom
2505 Set the position of the status line.
2506 .It Ic status-right Ar string
2507 Display
2508 .Ar string
2509 to the right of the status bar.
2510 By default, the current window title in double quotes, the date and the time
2511 are shown.
2512 As with
2513 .Ic status-left ,
2514 .Ar string
2515 will be passed to
2516 .Xr strftime 3 ,
2517 character pairs are replaced, and UTF-8 is dependent on the
2518 .Ic status-utf8
2519 option.
2520 .It Ic status-right-attr Ar attributes
2521 Set the attribute of the right part of the status line.
2522 .It Ic status-right-bg Ar colour
2523 Set the background colour of the right part of the status line.
2524 .It Ic status-right-fg Ar colour
2525 Set the foreground colour of the right part of the status line.
2526 .It Ic status-right-length Ar length
2527 Set the maximum
2528 .Ar length
2529 of the right component of the status bar.
2530 The default is 40.
2531 .It Xo Ic status-utf8
2532 .Op Ic on | off
2534 Instruct
2536 to treat top-bit-set characters in the
2537 .Ic status-left
2539 .Ic status-right
2540 strings as UTF-8; notably, this is important for wide characters.
2541 This option defaults to off.
2542 .It Ic terminal-overrides Ar string
2543 Contains a list of entries which override terminal descriptions read using
2544 .Xr terminfo 5 .
2545 .Ar string
2546 is a comma-separated list of items each a colon-separated string made up of a
2547 terminal type pattern (matched using
2548 .Xr fnmatch 3 )
2549 and a set of
2550 .Em name=value
2551 entries.
2553 For example, to set the
2554 .Ql clear
2555 .Xr terminfo 5
2556 entry to
2557 .Ql \ee[H\ee[2J
2558 for all terminal types and the
2559 .Ql dch1
2560 entry to
2561 .Ql \ee[P
2562 for the
2563 .Ql rxvt
2564 terminal type, the option could be set to the string:
2565 .Bd -literal -offset indent
2566 "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
2569 The terminal entry value is passed through
2570 .Xr strunvis 3
2571 before interpretation.
2572 The default value forcibly corrects the
2573 .Ql colors
2574 entry for terminals which support 88 or 256 colours:
2575 .Bd -literal -offset indent
2576 "*88col*:colors=88,*256col*:colors=256,xterm*:XT"
2578 .It Ic update-environment Ar variables
2579 Set a space-separated string containing a list of environment variables to be
2580 copied into the session environment when a new session is created or an
2581 existing session is attached.
2582 Any variables that do not exist in the source environment are set to be
2583 removed from the session environment (as if
2584 .Fl r
2585 was given to the
2586 .Ic set-environment
2587 command).
2588 The default is
2589 "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID
2590 XAUTHORITY".
2591 .It Xo Ic visual-activity
2592 .Op Ic on | off
2594 If on, display a status line message when activity occurs in a window
2595 for which the
2596 .Ic monitor-activity
2597 window option is enabled.
2598 .It Xo Ic visual-bell
2599 .Op Ic on | off
2601 If this option is on, a message is shown on a bell instead of it being passed
2602 through to the terminal (which normally makes a sound).
2603 Also see the
2604 .Ic bell-action
2605 option.
2606 .It Xo Ic visual-content
2607 .Op Ic on | off
2609 Like
2610 .Ic visual-activity ,
2611 display a message when content is present in a window
2612 for which the
2613 .Ic monitor-content
2614 window option is enabled.
2615 .It Xo Ic visual-silence
2616 .Op Ic on | off
2619 .Ic monitor-silence
2620 is enabled, prints a message after the interval has expired on a given window.
2621 .It Ic word-separators Ar string
2622 Sets the session's conception of what characters are considered word
2623 separators, for the purposes of the next and previous word commands in
2624 copy mode.
2625 The default is
2626 .Ql \ -_@ .
2628 .It Xo Ic set-window-option
2629 .Op Fl agqu
2630 .Op Fl t Ar target-window
2631 .Ar option Ar value
2633 .D1 (alias: Ic setw )
2634 Set a window option.
2636 .Fl a ,
2637 .Fl g ,
2638 .Fl q
2640 .Fl u
2641 flags work similarly to the
2642 .Ic set-option
2643 command.
2645 Supported window options are:
2647 .Bl -tag -width Ds -compact
2648 .It Xo Ic aggressive-resize
2649 .Op Ic on | off
2651 Aggressively resize the chosen window.
2652 This means that
2654 will resize the window to the size of the smallest session for which it is the
2655 current window, rather than the smallest session to which it is attached.
2656 The window may resize when the current window is changed on another sessions;
2657 this option is good for full-screen programs which support
2658 .Dv SIGWINCH
2659 and poor for interactive programs such as shells.
2661 .It Xo Ic allow-rename
2662 .Op Ic on | off
2664 Allow programs to change the window name using a terminal escape
2665 sequence (\\033k...\\033\\\\).
2666 The default is on.
2668 .It Xo Ic alternate-screen
2669 .Op Ic on | off
2671 This option configures whether programs running inside
2673 may use the terminal alternate screen feature, which allows the
2674 .Em smcup
2676 .Em rmcup
2677 .Xr terminfo 5
2678 capabilities.
2679 The alternate screen feature preserves the contents of the window when an
2680 interactive application starts and restores it on exit, so that any output
2681 visible before the application starts reappears unchanged after it exits.
2682 The default is on.
2684 .It Xo Ic automatic-rename
2685 .Op Ic on | off
2687 Control automatic window renaming.
2688 When this setting is enabled,
2690 will attempt - on supported platforms - to rename the window to reflect the
2691 command currently running in it.
2692 This flag is automatically disabled for an individual window when a name
2693 is specified at creation with
2694 .Ic new-window
2696 .Ic new-session ,
2697 or later with
2698 .Ic rename-window ,
2699 or with a terminal escape sequence.
2700 It may be switched off globally with:
2701 .Bd -literal -offset indent
2702 set-window-option -g automatic-rename off
2705 .It Ic c0-change-interval Ar interval
2706 .It Ic c0-change-trigger Ar trigger
2707 These two options configure a simple form of rate limiting for a pane.
2710 sees more than
2711 .Ar trigger
2712 C0 sequences that modify the screen (for example, carriage returns, linefeeds
2713 or backspaces) in one millisecond, it will stop updating the pane immediately and
2714 instead redraw it entirely every
2715 .Ar interval
2716 milliseconds.
2717 This helps to prevent fast output (such as
2718 .Xr yes 1
2719 overwhelming the terminal).
2720 The default is a trigger of 250 and an interval of 100.
2721 A trigger of zero disables the rate limiting.
2723 .It Ic clock-mode-colour Ar colour
2724 Set clock colour.
2726 .It Xo Ic clock-mode-style
2727 .Op Ic 12 | 24
2729 Set clock hour format.
2731 .It Ic command-prefix Ar string
2732 String prefixed to commands (apart from a plain shell as set by the
2733 .Ic default-shell
2734 option).
2735 The default is
2736 .Ql "exec\ " .
2738 .It Ic force-height Ar height
2739 .It Ic force-width Ar width
2740 Prevent
2742 from resizing a window to greater than
2743 .Ar width
2745 .Ar height .
2746 A value of zero restores the default unlimited setting.
2748 .It Ic main-pane-height Ar height
2749 .It Ic main-pane-width Ar width
2750 Set the width or height of the main (left or top) pane in the
2751 .Ic main-horizontal
2753 .Ic main-vertical
2754 layouts.
2756 .It Ic mode-attr Ar attributes
2757 Set window modes attributes.
2759 .It Ic mode-bg Ar colour
2760 Set window modes background colour.
2762 .It Ic mode-fg Ar colour
2763 Set window modes foreground colour.
2765 .It Xo Ic mode-keys
2766 .Op Ic vi | emacs
2768 Use vi or emacs-style key bindings in copy and choice modes.
2769 As with the
2770 .Ic status-keys
2771 option, the default is emacs, unless
2772 .Ev VISUAL
2774 .Ev EDITOR
2775 contains
2776 .Ql vi .
2778 .It Xo Ic mode-mouse
2779 .Op Ic on | off | copy-mode
2781 Mouse state in modes.
2782 If on, the mouse may be used to enter copy mode and copy a selection by
2783 dragging, to enter copy mode and scroll with the mouse wheel, or to select an
2784 option in choice mode.
2785 If set to
2786 .Em copy-mode ,
2787 the mouse behaves as set to on, but cannot be used to enter copy
2788 mode.
2790 .It Xo Ic monitor-activity
2791 .Op Ic on | off
2793 Monitor for activity in the window.
2794 Windows with activity are highlighted in the status line.
2796 .It Ic monitor-content Ar match-string
2797 Monitor content in the window.
2798 When
2799 .Xr fnmatch 3
2800 pattern
2801 .Ar match-string
2802 appears in the window, it is highlighted in the status line.
2804 .It Xo Ic monitor-silence
2805 .Op Ic interval
2807 Monitor for silence (no activity) in the window within
2808 .Ic interval
2809 seconds.
2810 Windows that have been silent for the interval are highlighted in the
2811 status line.
2812 An interval of zero disables the monitoring.
2814 .It Ic other-pane-height Ar height
2815 Set the height of the other panes (not the main pane) in the
2816 .Ic main-horizontal
2817 layout.
2818 If this option is set to 0 (the default), it will have no effect.
2819 If both the
2820 .Ic main-pane-height
2822 .Ic other-pane-height
2823 options are set, the main pane will grow taller to make the other panes the
2824 specified height, but will never shrink to do so.
2826 .It Ic other-pane-width Ar width
2827 Like
2828 .Ic other-pane-height ,
2829 but set the width of other panes in the
2830 .Ic main-vertical
2831 layout.
2833 .It Ic pane-base-index Ar index
2834 Like
2835 .Ic base-index ,
2836 but set the starting index for pane numbers.
2838 .It Xo Ic remain-on-exit
2839 .Op Ic on | off
2841 A window with this flag set is not destroyed when the program running in it
2842 exits.
2843 The window may be reactivated with the
2844 .Ic respawn-window
2845 command.
2847 .It Xo Ic synchronize-panes
2848 .Op Ic on | off
2850 Duplicate input to any pane to all other panes in the same window (only
2851 for panes that are not in any special mode).
2853 .It Xo Ic utf8
2854 .Op Ic on | off
2856 Instructs
2858 to expect UTF-8 sequences to appear in this window.
2860 .It Ic window-status-bell-attr Ar attributes
2861 Set status line attributes for windows which have a bell alert.
2863 .It Ic window-status-bell-bg Ar colour
2864 Set status line background colour for windows with a bell alert.
2866 .It Ic window-status-bell-fg Ar colour
2867 Set status line foreground colour for windows with a bell alert.
2869 .It Ic window-status-content-attr Ar attributes
2870 Set status line attributes for windows which have a content alert.
2872 .It Ic window-status-content-bg Ar colour
2873 Set status line background colour for windows with a content alert.
2875 .It Ic window-status-content-fg Ar colour
2876 Set status line foreground colour for windows with a content alert.
2878 .It Ic window-status-activity-attr Ar attributes
2879 Set status line attributes for windows which have an activity (or silence) alert.
2881 .It Ic window-status-activity-bg Ar colour
2882 Set status line background colour for windows with an activity alert.
2884 .It Ic window-status-activity-fg Ar colour
2885 Set status line foreground colour for windows with an activity alert.
2887 .It Ic window-status-attr Ar attributes
2888 Set status line attributes for a single window.
2890 .It Ic window-status-bg Ar colour
2891 Set status line background colour for a single window.
2893 .It Ic window-status-current-attr Ar attributes
2894 Set status line attributes for the currently active window.
2896 .It Ic window-status-current-bg Ar colour
2897 Set status line background colour for the currently active window.
2899 .It Ic window-status-current-fg Ar colour
2900 Set status line foreground colour for the currently active window.
2902 .It Ic window-status-current-format Ar string
2903 Like
2904 .Ar window-status-format ,
2905 but is the format used when the window is the current window.
2907 .It Ic window-status-last-attr Ar attributes
2908 Set status line attributes for the last active window.
2910 .It Ic window-status-last-bg Ar colour
2911 Set status line background colour for the last active window.
2913 .It Ic window-status-last-fg Ar colour
2914 Set status line foreground colour for the last active window.
2916 .It Ic window-status-fg Ar colour
2917 Set status line foreground colour for a single window.
2919 .It Ic window-status-format Ar string
2920 Set the format in which the window is displayed in the status line window list.
2921 See the
2922 .Ar status-left
2923 option for details of special character sequences available.
2924 The default is
2925 .Ql #I:#W#F .
2927 .It Ic window-status-separator Ar string
2928 Sets the separator drawn between windows in the status line.
2929 The default is a single space character.
2931 .It Xo Ic xterm-keys
2932 .Op Ic on | off
2934 If this option is set,
2936 will generate
2937 .Xr xterm 1 -style
2938 function key sequences; these have a number included to indicate modifiers such
2939 as Shift, Alt or Ctrl.
2940 The default is off.
2942 .It Xo Ic wrap-search
2943 .Op Ic on | off
2945 If this option is set, searches will wrap around the end of the pane contents.
2946 The default is on.
2948 .It Xo Ic show-options
2949 .Op Fl gsvw
2950 .Op Fl t Ar target-session | Ar target-window
2951 .Op Ar option
2953 .D1 (alias: Ic show )
2954 Show the window options (or a single window option if given) with
2955 .Fl w
2956 (equivalent to
2957 .Ic show-window-options ) ,
2958 the server options with
2959 .Fl s ,
2960 otherwise the session options for
2961 .Ar target session .
2962 Global session or window options are listed if
2963 .Fl g
2964 is used.
2965 .Fl v
2966 shows only the option value, not the name.
2967 .It Xo Ic show-window-options
2968 .Op Fl gv
2969 .Op Fl t Ar target-window
2970 .Op Ar option
2972 .D1 (alias: Ic showw )
2973 List the window options or a single option for
2974 .Ar target-window ,
2975 or the global window options if
2976 .Fl g
2977 is used.
2978 .Fl v
2979 shows only the option value, not the name.
2981 .Sh FORMATS
2982 Certain commands accept the
2983 .Fl F
2984 flag with a
2985 .Ar format
2986 argument.
2987 This is a string which controls the output format of the command.
2988 Special character sequences are replaced as documented under the
2989 .Ic status-left
2990 option and an additional long form is accepted.
2991 Replacement variables are enclosed in
2992 .Ql #{
2994 .Ql } ,
2995 for example
2996 .Ql #{session_name}
2997 is equivalent to
2998 .Ql #S .
2999 Conditionals are also accepted by prefixing with
3000 .Ql \&?
3001 and separating two alternatives with a comma;
3002 if the specified variable exists and is not zero, the first alternative
3003 is chosen, otherwise the second is used.
3004 For example
3005 .Ql #{?session_attached,attached,not attached}
3006 will include the string
3007 .Ql attached
3008 if the session is attached and the string
3009 .Ql not attached
3010 if it is unattached.
3012 The following variables are available, where appropriate:
3013 .Bl -column "session_created_string" "Replaced with" -offset indent
3014 .It Sy "Variable name" Ta Sy "Replaced with"
3015 .It Li "alternate_on" Ta "If pane is in alternate screen"
3016 .It Li "alternate_saved_x" Ta "Saved cursor X in alternate screen"
3017 .It Li "alternate_saved_y" Ta "Saved cursor Y in alternate screen"
3018 .It Li "buffer_sample" Ta "First 50 characters from the specified buffer"
3019 .It Li "buffer_size" Ta "Size of the specified buffer in bytes"
3020 .It Li "client_activity" Ta "Integer time client last had activity"
3021 .It Li "client_activity_string" Ta "String time client last had activity"
3022 .It Li "client_created" Ta "Integer time client created"
3023 .It Li "client_created_string" Ta "String time client created"
3024 .It Li "client_cwd" Ta "Working directory of client"
3025 .It Li "client_height" Ta "Height of client"
3026 .It Li "client_last_session" Ta "Name of the client's last session"
3027 .It Li "client_prefix" Ta "1 if prefix key has been pressed"
3028 .It Li "client_readonly" Ta "1 if client is readonly"
3029 .It Li "client_session" Ta "Name of the client's session"
3030 .It Li "client_termname" Ta "Terminal name of client"
3031 .It Li "client_tty" Ta "Pseudo terminal of client"
3032 .It Li "client_utf8" Ta "1 if client supports utf8"
3033 .It Li "client_width" Ta "Width of client"
3034 .It Li "cursor_flag" Ta "Pane cursor flag"
3035 .It Li "cursor_x" Ta "Cursor X position in pane"
3036 .It Li "cursor_y" Ta "Cursor Y position in pane"
3037 .It Li "history_bytes" Ta "Number of bytes in window history"
3038 .It Li "history_limit" Ta "Maximum window history lines"
3039 .It Li "history_size" Ta "Size of history in bytes"
3040 .It Li "host" Ta "Hostname of local host"
3041 .It Li "insert_flag" Ta "Pane insert flag"
3042 .It Li "keypad_cursor_flag" Ta "Pane keypad cursor flag"
3043 .It Li "keypad_flag" Ta "Pane keypad flag"
3044 .It Li "line" Ta "Line number in the list"
3045 .It Li "mouse_any_flag" Ta "Pane mouse any flag"
3046 .It Li "mouse_button_flag" Ta "Pane mouse button flag"
3047 .It Li "mouse_standard_flag" Ta "Pane mouse standard flag"
3048 .It Li "mouse_utf8_flag" Ta "Pane mouse UTF-8 flag"
3049 .It Li "pane_active" Ta "1 if active pane"
3050 .It Li "pane_current_command" Ta "Current command if available"
3051 .It Li "pane_current_path" Ta "Current path if available"
3052 .It Li "pane_dead" Ta "1 if pane is dead"
3053 .It Li "pane_height" Ta "Height of pane"
3054 .It Li "pane_id" Ta "Unique pane ID"
3055 .It Li "pane_in_mode" Ta "If pane is in a mode"
3056 .It Li "pane_index" Ta "Index of pane"
3057 .It Li "pane_pid" Ta "PID of first process in pane"
3058 .It Li "pane_start_command" Ta "Command pane started with"
3059 .It Li "pane_start_path" Ta "Path pane started with"
3060 .It Li "pane_tabs" Ta "Pane tab positions"
3061 .It Li "pane_title" Ta "Title of pane"
3062 .It Li "pane_tty" Ta "Pseudo terminal of pane"
3063 .It Li "pane_width" Ta "Width of pane"
3064 .It Li "saved_cursor_x" Ta "Saved cursor X in pane"
3065 .It Li "saved_cursor_y" Ta "Saved cursor Y in pane"
3066 .It Li "scroll_region_lower" Ta "Bottom of scroll region in pane"
3067 .It Li "scroll_region_upper" Ta "Top of scroll region in pane"
3068 .It Li "session_attached" Ta "1 if session attached"
3069 .It Li "session_created" Ta "Integer time session created"
3070 .It Li "session_created_string" Ta "String time session created"
3071 .It Li "session_group" Ta "Number of session group"
3072 .It Li "session_grouped" Ta "1 if session in a group"
3073 .It Li "session_height" Ta "Height of session"
3074 .It Li "session_name" Ta "Name of session"
3075 .It Li "session_width" Ta "Width of session"
3076 .It Li "session_windows" Ta "Number of windows in session"
3077 .It Li "window_active" Ta "1 if window active"
3078 .It Li "window_find_matches" Ta "Matched data from the find-window command if available"
3079 .It Li "window_flags" Ta "Window flags"
3080 .It Li "window_height" Ta "Height of window"
3081 .It Li "window_id" Ta "Unique window ID"
3082 .It Li "window_index" Ta "Index of window"
3083 .It Li "window_layout" Ta "Window layout description"
3084 .It Li "window_name" Ta "Name of window"
3085 .It Li "window_panes" Ta "Number of panes in window"
3086 .It Li "window_width" Ta "Width of window"
3087 .It Li "wrap_flag" Ta "Pane wrap flag"
3089 .Sh NAMES AND TITLES
3091 distinguishes between names and titles.
3092 Windows and sessions have names, which may be used to specify them in targets
3093 and are displayed in the status line and various lists: the name is the
3095 identifier for a window or session.
3096 Only panes have titles.
3097 A pane's title is typically set by the program running inside the pane and
3098 is not modified by
3099 .Nm .
3100 It is the same mechanism used to set for example the
3101 .Xr xterm 1
3102 window title in an
3103 .Xr X 7
3104 window manager.
3105 Windows themselves do not have titles - a window's title is the title of its
3106 active pane.
3108 itself may set the title of the terminal in which the client is running, see
3110 .Ic set-titles
3111 option.
3113 A session's name is set with the
3114 .Ic new-session
3116 .Ic rename-session
3117 commands.
3118 A window's name is set with one of:
3119 .Bl -enum -width Ds
3121 A command argument (such as
3122 .Fl n
3124 .Ic new-window
3126 .Ic new-session ) .
3128 An escape sequence:
3129 .Bd -literal -offset indent
3130 $ printf '\e033kWINDOW_NAME\e033\e\e'
3133 Automatic renaming, which sets the name to the active command in the window's
3134 active pane.
3135 See the
3136 .Ic automatic-rename
3137 option.
3140 When a pane is first created, its title is the hostname.
3141 A pane's title can be set via the OSC title setting sequence, for example:
3142 .Bd -literal -offset indent
3143 $ printf '\e033]2;My Title\e033\e\e'
3145 .Sh ENVIRONMENT
3146 When the server is started,
3148 copies the environment into the
3149 .Em global environment ;
3150 in addition, each session has a
3151 .Em session environment .
3152 When a window is created, the session and global environments are merged.
3153 If a variable exists in both, the value from the session environment is used.
3154 The result is the initial environment passed to the new process.
3157 .Ic update-environment
3158 session option may be used to update the session environment from the client
3159 when a new session is created or an old reattached.
3161 also initialises the
3162 .Ev TMUX
3163 variable with some internal information to allow commands to be executed
3164 from inside, and the
3165 .Ev TERM
3166 variable with the correct terminal setting of
3167 .Ql screen .
3169 Commands to alter and view the environment are:
3170 .Bl -tag -width Ds
3171 .It Xo Ic set-environment
3172 .Op Fl gru
3173 .Op Fl t Ar target-session
3174 .Ar name Op Ar value
3176 .D1 (alias: Ic setenv )
3177 Set or unset an environment variable.
3179 .Fl g
3180 is used, the change is made in the global environment; otherwise, it is applied
3181 to the session environment for
3182 .Ar target-session .
3184 .Fl u
3185 flag unsets a variable.
3186 .Fl r
3187 indicates the variable is to be removed from the environment before starting a
3188 new process.
3189 .It Xo Ic show-environment
3190 .Op Fl g
3191 .Op Fl t Ar target-session
3192 .Op Ar variable
3194 .D1 (alias: Ic showenv )
3195 Display the environment for
3196 .Ar target-session
3197 or the global environment with
3198 .Fl g .
3200 .Ar variable
3201 is omitted, all variables are shown.
3202 Variables removed from the environment are prefixed with
3203 .Ql - .
3205 .Sh STATUS LINE
3207 includes an optional status line which is displayed in the bottom line of each
3208 terminal.
3209 By default, the status line is enabled (it may be disabled with the
3210 .Ic status
3211 session option) and contains, from left-to-right: the name of the current
3212 session in square brackets; the window list; the title of the active pane
3213 in double quotes; and the time and date.
3215 The status line is made of three parts: configurable left and right sections
3216 (which may contain dynamic content such as the time or output from a shell
3217 command, see the
3218 .Ic status-left ,
3219 .Ic status-left-length ,
3220 .Ic status-right ,
3222 .Ic status-right-length
3223 options below), and a central window list.
3224 By default, the window list shows the index, name and (if any) flag of the
3225 windows present in the current session in ascending numerical order.
3226 It may be customised with the
3227 .Ar window-status-format
3229 .Ar window-status-current-format
3230 options.
3231 The flag is one of the following symbols appended to the window name:
3232 .Bl -column "Symbol" "Meaning" -offset indent
3233 .It Sy "Symbol" Ta Sy "Meaning"
3234 .It Li "*" Ta "Denotes the current window."
3235 .It Li "-" Ta "Marks the last window (previously selected)."
3236 .It Li "#" Ta "Window is monitored and activity has been detected."
3237 .It Li "!" Ta "A bell has occurred in the window."
3238 .It Li "+" Ta "Window is monitored for content and it has appeared."
3239 .It Li "~" Ta "The window has been silent for the monitor-silence interval."
3242 The # symbol relates to the
3243 .Ic monitor-activity
3244 and + to the
3245 .Ic monitor-content
3246 window options.
3247 The window name is printed in inverted colours if an alert (bell, activity or
3248 content) is present.
3250 The colour and attributes of the status line may be configured, the entire
3251 status line using the
3252 .Ic status-attr ,
3253 .Ic status-fg
3255 .Ic status-bg
3256 session options and individual windows using the
3257 .Ic window-status-attr ,
3258 .Ic window-status-fg
3260 .Ic window-status-bg
3261 window options.
3263 The status line is automatically refreshed at interval if it has changed, the
3264 interval may be controlled with the
3265 .Ic status-interval
3266 session option.
3268 Commands related to the status line are as follows:
3269 .Bl -tag -width Ds
3270 .It Xo Ic command-prompt
3271 .Op Fl I Ar inputs
3272 .Op Fl p Ar prompts
3273 .Op Fl t Ar target-client
3274 .Op Ar template
3276 Open the command prompt in a client.
3277 This may be used from inside
3279 to execute commands interactively.
3282 .Ar template
3283 is specified, it is used as the command.
3284 If present,
3285 .Fl I
3286 is a comma-separated list of the initial text for each prompt.
3288 .Fl p
3289 is given,
3290 .Ar prompts
3291 is a comma-separated list of prompts which are displayed in order; otherwise
3292 a single prompt is displayed, constructed from
3293 .Ar template
3294 if it is present, or
3295 .Ql \&:
3296 if not.
3298 Both
3299 .Ar inputs
3301 .Ar prompts
3302 may contain the special character sequences supported by the
3303 .Ic status-left
3304 option.
3306 Before the command is executed, the first occurrence of the string
3307 .Ql %%
3308 and all occurrences of
3309 .Ql %1
3310 are replaced by the response to the first prompt, the second
3311 .Ql %%
3312 and all
3313 .Ql %2
3314 are replaced with the response to the second prompt, and so on for further
3315 prompts.
3316 Up to nine prompt responses may be replaced
3318 .Ql %1
3320 .Ql %9
3321 .Pc .
3322 .It Xo Ic confirm-before
3323 .Op Fl p Ar prompt
3324 .Op Fl t Ar target-client
3325 .Ar command
3327 .D1 (alias: Ic confirm )
3328 Ask for confirmation before executing
3329 .Ar command .
3331 .Fl p
3332 is given,
3333 .Ar prompt
3334 is the prompt to display; otherwise a prompt is constructed from
3335 .Ar command .
3336 It may contain the special character sequences supported by the
3337 .Ic status-left
3338 option.
3340 This command works only from inside
3341 .Nm .
3342 .It Xo Ic display-message
3343 .Op Fl p
3344 .Op Fl c Ar target-client
3345 .Op Fl t Ar target-pane
3346 .Op Ar message
3348 .D1 (alias: Ic display )
3349 Display a message.
3351 .Fl p
3352 is given, the output is printed to stdout, otherwise it is displayed in the
3353 .Ar target-client
3354 status line.
3355 The format of
3356 .Ar message
3357 is described in the
3358 .Sx FORMATS
3359 section; information is taken from
3360 .Ar target-pane
3362 .Fl t
3363 is given, otherwise the active pane for the session attached to
3364 .Ar target-client .
3366 .Sh BUFFERS
3368 maintains a stack of
3369 .Em paste buffers .
3370 Up to the value of the
3371 .Ic buffer-limit
3372 option are kept; when a new buffer is added, the buffer at the bottom of the
3373 stack is removed.
3374 Buffers may be added using
3375 .Ic copy-mode
3376 or the
3377 .Ic set-buffer
3378 command, and pasted into a window using the
3379 .Ic paste-buffer
3380 command.
3382 A configurable history buffer is also maintained for each window.
3383 By default, up to 2000 lines are kept; this can be altered with the
3384 .Ic history-limit
3385 option (see the
3386 .Ic set-option
3387 command above).
3389 The buffer commands are as follows:
3390 .Bl -tag -width Ds
3391 .It Xo
3392 .Ic choose-buffer
3393 .Op Fl F Ar format
3394 .Op Fl t Ar target-window
3395 .Op Ar template
3397 Put a window into buffer choice mode, where a buffer may be chosen
3398 interactively from a list.
3399 After a buffer is selected,
3400 .Ql %%
3401 is replaced by the buffer index in
3402 .Ar template
3403 and the result executed as a command.
3405 .Ar template
3406 is not given, "paste-buffer -b '%%'" is used.
3407 For the meaning of the
3408 .Fl F
3409 flag, see the
3410 .Sx FORMATS
3411 section.
3412 This command works only if at least one client is attached.
3413 .It Ic clear-history Op Fl t Ar target-pane
3414 .D1 (alias: Ic clearhist )
3415 Remove and free the history for the specified pane.
3416 .It Ic delete-buffer Op Fl b Ar buffer-index
3417 .D1 (alias: Ic deleteb )
3418 Delete the buffer at
3419 .Ar buffer-index ,
3420 or the top buffer if not specified.
3421 .It Xo Ic list-buffers
3422 .Op Fl F Ar format
3424 .D1 (alias: Ic lsb )
3425 List the global buffers.
3426 For the meaning of the
3427 .Fl F
3428 flag, see the
3429 .Sx FORMATS
3430 section.
3431 .It Xo Ic load-buffer
3432 .Op Fl b Ar buffer-index
3433 .Ar path
3435 .D1 (alias: Ic loadb )
3436 Load the contents of the specified paste buffer from
3437 .Ar path .
3438 .It Xo Ic paste-buffer
3439 .Op Fl dpr
3440 .Op Fl b Ar buffer-index
3441 .Op Fl s Ar separator
3442 .Op Fl t Ar target-pane
3444 .D1 (alias: Ic pasteb )
3445 Insert the contents of a paste buffer into the specified pane.
3446 If not specified, paste into the current one.
3447 With
3448 .Fl d ,
3449 also delete the paste buffer from the stack.
3450 When output, any linefeed (LF) characters in the paste buffer are replaced with
3451 a separator, by default carriage return (CR).
3452 A custom separator may be specified using the
3453 .Fl s
3454 flag.
3456 .Fl r
3457 flag means to do no replacement (equivalent to a separator of LF).
3459 .Fl p
3460 is specified, paste bracket control codes are inserted around the
3461 buffer if the application has requested bracketed paste mode.
3462 .It Xo Ic save-buffer
3463 .Op Fl a
3464 .Op Fl b Ar buffer-index
3465 .Ar path
3467 .D1 (alias: Ic saveb )
3468 Save the contents of the specified paste buffer to
3469 .Ar path .
3471 .Fl a
3472 option appends to rather than overwriting the file.
3473 .It Xo Ic set-buffer
3474 .Op Fl b Ar buffer-index
3475 .Ar data
3477 .D1 (alias: Ic setb )
3478 Set the contents of the specified buffer to
3479 .Ar data .
3480 .It Xo Ic show-buffer
3481 .Op Fl b Ar buffer-index
3483 .D1 (alias: Ic showb )
3484 Display the contents of the specified buffer.
3486 .Sh MISCELLANEOUS
3487 Miscellaneous commands are as follows:
3488 .Bl -tag -width Ds
3489 .It Ic clock-mode Op Fl t Ar target-pane
3490 Display a large clock.
3491 .It Xo Ic if-shell
3492 .Op Fl t Ar target-pane
3493 .Op Fl b
3494 .Ar shell-command command
3495 .Op Ar command
3497 .D1 (alias: Ic if )
3498 Execute the first
3499 .Ar command
3501 .Ar shell-command
3502 returns success or the second
3503 .Ar command
3504 otherwise.
3505 Before being executed, shell-command is expanded using the rules specified in the
3506 .Sx FORMATS
3507 section, including those relevant to
3508 .Ar target-pane .
3509 With
3510 .Fl b ,
3511 .Ar shell-command
3512 is run in the background.
3513 .It Ic lock-server
3514 .D1 (alias: Ic lock )
3515 Lock each client individually by running the command specified by the
3516 .Ic lock-command
3517 option.
3518 .It Xo Ic run-shell
3519 .Fl b
3520 .Op Fl t Ar target-pane
3521 .Ar shell-command
3523 .D1 (alias: Ic run )
3524 Execute
3525 .Ar shell-command
3526 in the background without creating a window.
3527 Before being executed, shell-command is expanded using the rules specified in
3529 .Sx FORMATS
3530 section.
3531 With
3532 .Fl b ,
3533 the command is run in the background.
3534 After it finishes, any output to stdout is displayed in copy mode (in the pane
3535 specified by
3536 .Fl t
3537 or the current pane if omitted).
3538 If the command doesn't return success, the exit status is also displayed.
3539 .It Ic server-info
3540 .D1 (alias: Ic info )
3541 Show server information and terminal details.
3543 .Sh TERMINFO EXTENSIONS
3545 understands some extensions to
3546 .Xr terminfo 5 :
3547 .Bl -tag -width Ds
3548 .It Em Cc , Cr
3549 Set the cursor colour.
3550 The first takes a single string argument and is used to set the colour;
3551 the second takes no arguments and restores the default cursor colour.
3552 If set, a sequence such as this may be used
3553 to change the cursor colour from inside
3554 .Nm :
3555 .Bd -literal -offset indent
3556 $ printf '\e033]12;red\e033\e\e'
3558 .It Em Cs , Csr
3559 Change the cursor style.
3560 If set, a sequence such as this may be used
3561 to change the cursor to an underline:
3562 .Bd -literal -offset indent
3563 $ printf '\e033[4 q'
3567 .Em Csr
3568 is set, it will be used to reset the cursor style instead
3570 .Em Cs .
3571 .It Em \&Ms
3572 This sequence can be used by
3574 to store the current buffer in the host terminal's selection (clipboard).
3575 See the
3576 .Em set-clipboard
3577 option above and the
3578 .Xr xterm 1
3579 man page.
3581 .Sh FILES
3582 .Bl -tag -width "/etc/tmux.confXXX" -compact
3583 .It Pa ~/.tmux.conf
3584 Default
3586 configuration file.
3587 .It Pa /etc/tmux.conf
3588 System-wide configuration file.
3590 .Sh EXAMPLES
3591 To create a new
3593 session running
3594 .Xr vi 1 :
3596 .Dl $ tmux new-session vi
3598 Most commands have a shorter form, known as an alias.
3599 For new-session, this is
3600 .Ic new :
3602 .Dl $ tmux new vi
3604 Alternatively, the shortest unambiguous form of a command is accepted.
3605 If there are several options, they are listed:
3606 .Bd -literal -offset indent
3607 $ tmux n
3608 ambiguous command: n, could be: new-session, new-window, next-window
3611 Within an active session, a new window may be created by typing
3612 .Ql C-b c
3613 (Ctrl
3614 followed by the
3615 .Ql b
3617 followed by the
3618 .Ql c
3619 key).
3621 Windows may be navigated with:
3622 .Ql C-b 0
3623 (to select window 0),
3624 .Ql C-b 1
3625 (to select window 1), and so on;
3626 .Ql C-b n
3627 to select the next window; and
3628 .Ql C-b p
3629 to select the previous window.
3631 A session may be detached using
3632 .Ql C-b d
3633 (or by an external event such as
3634 .Xr ssh 1
3635 disconnection) and reattached with:
3637 .Dl $ tmux attach-session
3639 Typing
3640 .Ql C-b \&?
3641 lists the current key bindings in the current window; up and down may be used
3642 to navigate the list or
3643 .Ql q
3644 to exit from it.
3646 Commands to be run when the
3648 server is started may be placed in the
3649 .Pa ~/.tmux.conf
3650 configuration file.
3651 Common examples include:
3653 Changing the default prefix key:
3654 .Bd -literal -offset indent
3655 set-option -g prefix C-a
3656 unbind-key C-b
3657 bind-key C-a send-prefix
3660 Turning the status line off, or changing its colour:
3661 .Bd -literal -offset indent
3662 set-option -g status off
3663 set-option -g status-bg blue
3666 Setting other options, such as the default command,
3667 or locking after 30 minutes of inactivity:
3668 .Bd -literal -offset indent
3669 set-option -g default-command "exec /bin/ksh"
3670 set-option -g lock-after-time 1800
3673 Creating new key bindings:
3674 .Bd -literal -offset indent
3675 bind-key b set-option status
3676 bind-key / command-prompt "split-window 'exec man %%'"
3677 bind-key S command-prompt "new-window -n %1 'ssh %1'"
3679 .Sh SEE ALSO
3680 .Xr pty 4
3681 .Sh AUTHORS
3682 .An Nicholas Marriott Aq nicm@users.sourceforge.net