Merge branch 'obsd-master'
[tmux.git] / tmux.1
blob34ecc6325553d497d4bea55c0512e02c89b11100
1 .\" $OpenBSD$
2 .\"
3 .\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
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 2CDlNuVv
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 Fl T Ar features
32 .Op Ar command Op Ar flags
33 .Ek
34 .Sh DESCRIPTION
35 .Nm
36 is a terminal multiplexer:
37 it enables a number of terminals to be created, accessed, and
38 controlled from a single screen.
39 .Nm
40 may be detached from a screen
41 and continue running in the background,
42 then later reattached.
43 .Pp
44 When
45 .Nm
46 is started, it creates a new
47 .Em session
48 with a single
49 .Em window
50 and displays it on screen.
51 A status line at the bottom of the screen
52 shows information on the current session
53 and is used to enter interactive commands.
54 .Pp
55 A session is a single collection of
56 .Em pseudo terminals
57 under the management of
58 .Nm .
59 Each session has one or more
60 windows linked to it.
61 A window occupies the entire screen
62 and may be split into rectangular panes,
63 each of which is a separate pseudo terminal
64 (the
65 .Xr pty 4
66 manual page documents the technical details of pseudo terminals).
67 Any number of
68 .Nm
69 instances may connect to the same session,
70 and any number of windows may be present in the same session.
71 Once all sessions are killed,
72 .Nm
73 exits.
74 .Pp
75 Each session is persistent and will survive accidental disconnection
76 (such as
77 .Xr ssh 1
78 connection timeout) or intentional detaching (with the
79 .Ql C-b d
80 key strokes).
81 .Nm
82 may be reattached using:
83 .Pp
84 .Dl $ tmux attach
85 .Pp
87 .Nm ,
88 a session is displayed on screen by a
89 .Em client
90 and all sessions are managed by a single
91 .Em server .
92 The server and each client are separate processes which communicate through a
93 socket in
94 .Pa /tmp .
95 .Pp
96 The options are as follows:
97 .Bl -tag -width "XXXXXXXXXXXX"
98 .It Fl 2
99 Force
101 to assume the terminal supports 256 colours.
102 This is equivalent to
103 .Fl T Ar 256 .
104 .It Fl C
105 Start in control mode (see the
106 .Sx CONTROL MODE
107 section).
108 Given twice
109 .Xo ( Fl CC ) Xc
110 disables echo.
111 .It Fl c Ar shell-command
112 Execute
113 .Ar shell-command
114 using the default shell.
115 If necessary, the
117 server will be started to retrieve the
118 .Ic default-shell
119 option.
120 This option is for compatibility with
121 .Xr sh 1
122 when
124 is used as a login shell.
125 .It Fl D
126 Do not start the
128 server as a daemon.
129 This also turns the
130 .Ic exit-empty
131 option off.
132 With
133 .Fl D ,
134 .Ar command
135 may not be specified.
136 .It Fl f Ar file
137 Specify an alternative configuration file.
138 By default,
140 loads the system configuration file from
141 .Pa @SYSCONFDIR@/tmux.conf ,
142 if present, then looks for a user configuration file at
143 .Pa \[ti]/.tmux.conf
145 .Pa $XDG_CONFIG_HOME/tmux/tmux.conf .
147 The configuration file is a set of
149 commands which are executed in sequence when the server is first started.
151 loads configuration files once when the server process has started.
153 .Ic source-file
154 command may be used to load a file later.
157 shows any error messages from commands in configuration files in the first
158 session created, and continues to process the rest of the configuration file.
159 .It Fl L Ar socket-name
161 stores the server socket in a directory under
162 .Ev TMUX_TMPDIR
164 .Pa /tmp
165 if it is unset.
166 The default socket is named
167 .Em default .
168 This option allows a different socket name to be specified, allowing several
169 independent
171 servers to be run.
172 Unlike
173 .Fl S
174 a full path is not necessary: the sockets are all created in a directory
175 .Pa tmux-UID
176 under the directory given by
177 .Ev TMUX_TMPDIR
178 or in
179 .Pa /tmp .
181 .Pa tmux-UID
182 directory is created by
184 and must not be world readable, writable or executable.
186 If the socket is accidentally removed, the
187 .Dv SIGUSR1
188 signal may be sent to the
190 server process to recreate it (note that this will fail if any parent
191 directories are missing).
192 .It Fl l
193 Behave as a login shell.
194 This flag currently has no effect and is for compatibility with other shells
195 when using tmux as a login shell.
196 .It Fl N
197 Do not start the server even if the command would normally do so (for example
198 .Ic new-session
200 .Ic start-server ) .
201 .It Fl S Ar socket-path
202 Specify a full alternative path to the server socket.
204 .Fl S
205 is specified, the default socket directory is not used and any
206 .Fl L
207 flag is ignored.
208 .It Fl T Ar features
209 Set terminal features for the client.
210 This is a comma-separated list of features.
211 See the
212 .Ic terminal-features
213 option.
214 .It Fl u
215 Write UTF-8 output to the terminal even if the first environment
216 variable of
217 .Ev LC_ALL ,
218 .Ev LC_CTYPE ,
220 .Ev LANG
221 that is set does not contain
222 .Qq UTF-8
224 .Qq UTF8 .
225 .It Fl V
226 Report the
228 version.
229 .It Fl v
230 Request verbose logging.
231 Log messages will be saved into
232 .Pa tmux-client-PID.log
234 .Pa tmux-server-PID.log
235 files in the current directory, where
236 .Em PID
237 is the PID of the server or client process.
239 .Fl v
240 is specified twice, an additional
241 .Pa tmux-out-PID.log
242 file is generated with a copy of everything
244 writes to the terminal.
247 .Dv SIGUSR2
248 signal may be sent to the
250 server process to toggle logging between on (as if
251 .Fl v
252 was given) and off.
253 .It Ar command Op Ar flags
254 This specifies one of a set of commands used to control
255 .Nm ,
256 as described in the following sections.
257 If no commands are specified, the
258 .Ic new-session
259 command is assumed.
261 .Sh DEFAULT KEY BINDINGS
263 may be controlled from an attached client by using a key combination of a
264 prefix key,
265 .Ql C-b
266 (Ctrl-b) by default, followed by a command key.
268 The default command key bindings are:
270 .Bl -tag -width "XXXXXXXXXX" -offset indent -compact
271 .It C-b
272 Send the prefix key (C-b) through to the application.
273 .It C-o
274 Rotate the panes in the current window forwards.
275 .It C-z
276 Suspend the
278 client.
279 .It !
280 Break the current pane out of the window.
281 .It \&"
282 .\" "
283 Split the current pane into two, top and bottom.
284 .It #
285 List all paste buffers.
286 .It $
287 Rename the current session.
288 .It %
289 Split the current pane into two, left and right.
290 .It &
291 Kill the current window.
292 .It \[aq]
293 Prompt for a window index to select.
294 .It \&(
295 Switch the attached client to the previous session.
296 .It \&)
297 Switch the attached client to the next session.
298 .It ,
299 Rename the current window.
300 .It -
301 Delete the most recently copied buffer of text.
302 .It .
303 Prompt for an index to move the current window.
304 .It 0 to 9
305 Select windows 0 to 9.
306 .It :
307 Enter the
309 command prompt.
310 .It ;
311 Move to the previously active pane.
312 .It =
313 Choose which buffer to paste interactively from a list.
314 .It \&?
315 List all key bindings.
316 .It D
317 Choose a client to detach.
318 .It L
319 Switch the attached client back to the last session.
320 .It \&[
321 Enter copy mode to copy text or view the history.
322 .It \&]
323 Paste the most recently copied buffer of text.
324 .It c
325 Create a new window.
326 .It d
327 Detach the current client.
328 .It f
329 Prompt to search for text in open windows.
330 .It i
331 Display some information about the current window.
332 .It l
333 Move to the previously selected window.
334 .It m
335 Mark the current pane (see
336 .Ic select-pane
337 .Fl m ) .
338 .It M
339 Clear the marked pane.
340 .It n
341 Change to the next window.
342 .It o
343 Select the next pane in the current window.
344 .It p
345 Change to the previous window.
346 .It q
347 Briefly display pane indexes.
348 .It r
349 Force redraw of the attached client.
350 .It s
351 Select a new session for the attached client interactively.
352 .It t
353 Show the time.
354 .It w
355 Choose the current window interactively.
356 .It x
357 Kill the current pane.
358 .It z
359 Toggle zoom state of the current pane.
360 .It {
361 Swap the current pane with the previous pane.
362 .It }
363 Swap the current pane with the next pane.
364 .It \[ti]
365 Show previous messages from
366 .Nm ,
367 if any.
368 .It Page Up
369 Enter copy mode and scroll one page up.
370 .It Up, Down
371 .It Left, Right
372 Change to the pane above, below, to the left, or to the right of the current
373 pane.
374 .It M-1 to M-5
375 Arrange panes in one of the seven preset layouts:
376 even-horizontal, even-vertical,
377 main-horizontal, main-horizontal-mirrored,
378 main-vertical, main-vertical, or tiled.
379 .It Space
380 Arrange the current window in the next preset layout.
381 .It M-n
382 Move to the next window with a bell or activity marker.
383 .It M-o
384 Rotate the panes in the current window backwards.
385 .It M-p
386 Move to the previous window with a bell or activity marker.
387 .It C-Up, C-Down
388 .It C-Left, C-Right
389 Resize the current pane in steps of one cell.
390 .It M-Up, M-Down
391 .It M-Left, M-Right
392 Resize the current pane in steps of five cells.
395 Key bindings may be changed with the
396 .Ic bind-key
398 .Ic unbind-key
399 commands.
400 .Sh COMMAND PARSING AND EXECUTION
402 supports a large number of commands which can be used to control its
403 behaviour.
404 Each command is named and can accept zero or more flags and arguments.
405 They may be bound to a key with the
406 .Ic bind-key
407 command or run from the shell prompt, a shell script, a configuration file or
408 the command prompt.
409 For example, the same
410 .Ic set-option
411 command run from the shell prompt, from
412 .Pa \[ti]/.tmux.conf
413 and bound to a key may look like:
414 .Bd -literal -offset indent
415 $ tmux set-option -g status-style bg=cyan
417 set-option -g status-style bg=cyan
419 bind-key C set-option -g status-style bg=cyan
422 Here, the command name is
423 .Ql set-option ,
424 .Ql Fl g
425 is a flag and
426 .Ql status-style
428 .Ql bg=cyan
429 are arguments.
432 distinguishes between command parsing and execution.
433 In order to execute a command,
435 needs it to be split up into its name and arguments.
436 This is command parsing.
437 If a command is run from the shell, the shell parses it; from inside
439 or from a configuration file,
441 does.
442 Examples of when
444 parses commands are:
445 .Bl -dash -offset indent
447 in a configuration file;
449 typed at the command prompt (see
450 .Ic command-prompt ) ;
452 given to
453 .Ic bind-key ;
455 passed as arguments to
456 .Ic if-shell
458 .Ic confirm-before .
461 To execute commands, each client has a
462 .Ql command queue .
463 A global command queue not attached to any client is used on startup
464 for configuration files like
465 .Pa \[ti]/.tmux.conf .
466 Parsed commands added to the queue are executed in order.
467 Some commands, like
468 .Ic if-shell
470 .Ic confirm-before ,
471 parse their argument to create a new command which is inserted immediately
472 after themselves.
473 This means that arguments can be parsed twice or more - once when the parent
474 command (such as
475 .Ic if-shell )
476 is parsed and again when it parses and executes its command.
477 Commands like
478 .Ic if-shell ,
479 .Ic run-shell
481 .Ic display-panes
482 stop execution of subsequent commands on the queue until something happens -
483 .Ic if-shell
485 .Ic run-shell
486 until a shell command finishes and
487 .Ic display-panes
488 until a key is pressed.
489 For example, the following commands:
490 .Bd -literal -offset indent
491 new-session; new-window
492 if-shell "true" "split-window"
493 kill-session
496 Will execute
497 .Ic new-session ,
498 .Ic new-window ,
499 .Ic if-shell ,
500 the shell command
501 .Xr true 1 ,
502 .Ic split-window
504 .Ic kill-session
505 in that order.
508 .Sx COMMANDS
509 section lists the
511 commands and their arguments.
512 .Sh PARSING SYNTAX
513 This section describes the syntax of commands parsed by
514 .Nm ,
515 for example in a configuration file or at the command prompt.
516 Note that when commands are entered into the shell, they are parsed by the shell
517 - see for example
518 .Xr ksh 1
520 .Xr csh 1 .
522 Each command is terminated by a newline or a semicolon (;).
523 Commands separated by semicolons together form a
524 .Ql command sequence
525 - if a command in the sequence encounters an error, no subsequent commands are
526 executed.
528 It is recommended that a semicolon used as a command separator should be
529 written as an individual token, for example from
530 .Xr sh 1 :
531 .Bd -literal -offset indent
532 $ tmux neww \\; splitw
536 .Bd -literal -offset indent
537 $ tmux neww \[aq];\[aq] splitw
540 Or from the tmux command prompt:
541 .Bd -literal -offset indent
542 neww ; splitw
545 However, a trailing semicolon is also interpreted as a command separator,
546 for example in these
547 .Xr sh 1
548 commands:
549 .Bd -literal -offset indent
550 $ tmux neww\e; splitw
554 .Bd -literal -offset indent
555 $ tmux \[aq]neww;\[aq] splitw
558 As in these examples, when running tmux from the shell extra care must be taken
559 to properly quote semicolons:
560 .Bl -enum -offset Ds
562 Semicolons that should be interpreted as a command separator
563 should be escaped according to the shell conventions.
565 .Xr sh 1
566 this typically means quoted (such as
567 .Ql neww \[aq];\[aq] splitw )
568 or escaped (such as
569 .Ql neww \e\e\e\e; splitw ) .
571 Individual semicolons or trailing semicolons that should be interpreted as
572 arguments should be escaped twice: once according to the shell conventions and
573 a second time for
574 .Nm ;
575 for example:
576 .Bd -literal -offset indent
577 $ tmux neww \[aq]foo\e\e;\[aq] bar
578 $ tmux neww foo\e\e\e\e; bar
581 Semicolons that are not individual tokens or trailing another token should only
582 be escaped once according to shell conventions; for example:
583 .Bd -literal -offset indent
584 $ tmux neww \[aq]foo-;-bar\[aq]
585 $ tmux neww foo-\e\e;-bar
589 Comments are marked by the unquoted # character - any remaining text after a
590 comment is ignored until the end of the line.
592 If the last character of a line is \e, the line is joined with the following
593 line (the \e and the newline are completely removed).
594 This is called line continuation and applies both inside and outside quoted
595 strings and in comments, but not inside braces.
597 Command arguments may be specified as strings surrounded by single (\[aq])
598 quotes, double quotes (\[dq]) or braces ({}).
599 .\" "
600 This is required when the argument contains any special character.
601 Single and double quoted strings cannot span multiple lines except with line
602 continuation.
603 Braces can span multiple lines.
605 Outside of quotes and inside double quotes, these replacements are performed:
606 .Bl -dash -offset indent
608 Environment variables preceded by $ are replaced with their value from the
609 global environment (see the
610 .Sx GLOBAL AND SESSION ENVIRONMENT
611 section).
613 A leading \[ti] or \[ti]user is expanded to the home directory of the current or
614 specified user.
616 \euXXXX or \euXXXXXXXX is replaced by the Unicode codepoint corresponding to
617 the given four or eight digit hexadecimal number.
619 When preceded (escaped) by a \e, the following characters are replaced: \ee by
620 the escape character; \er by a carriage return; \en by a newline; and \et by a
621 tab.
623 \eooo is replaced by a character of the octal value ooo.
624 Three octal digits are required, for example \e001.
625 The largest valid character is \e377.
627 Any other characters preceded by \e are replaced by themselves (that is, the \e
628 is removed) and are not treated as having any special meaning - so for example
629 \e; will not mark a command sequence and \e$ will not expand an environment
630 variable.
633 Braces are parsed as a configuration file (so conditions such as
634 .Ql %if
635 are processed) and then converted into a string.
636 They are designed to avoid the need for additional escaping when passing a
637 group of
639 commands as an argument (for example to
640 .Ic if-shell ) .
641 These two examples produce an identical command - note that no escaping is
642 needed when using {}:
643 .Bd -literal -offset indent
644 if-shell true {
645     display -p \[aq]brace-dollar-foo: }$foo\[aq]
648 if-shell true "display -p \[aq]brace-dollar-foo: }\e$foo\[aq]"
651 Braces may be enclosed inside braces, for example:
652 .Bd -literal -offset indent
653 bind x if-shell "true" {
654     if-shell "true" {
655         display "true!"
656     }
660 Environment variables may be set by using the syntax
661 .Ql name=value ,
662 for example
663 .Ql HOME=/home/user .
664 Variables set during parsing are added to the global environment.
665 A hidden variable may be set with
666 .Ql %hidden ,
667 for example:
668 .Bd -literal -offset indent
669 %hidden MYVAR=42
672 Hidden variables are not passed to the environment of processes created
673 by tmux.
674 See the
675 .Sx GLOBAL AND SESSION ENVIRONMENT
676 section.
678 Commands may be parsed conditionally by surrounding them with
679 .Ql %if ,
680 .Ql %elif ,
681 .Ql %else
683 .Ql %endif .
684 The argument to
685 .Ql %if
687 .Ql %elif
688 is expanded as a format (see
689 .Sx FORMATS )
690 and if it evaluates to false (zero or empty), subsequent text is ignored until
691 the closing
692 .Ql %elif ,
693 .Ql %else
695 .Ql %endif .
696 For example:
697 .Bd -literal -offset indent
698 %if "#{==:#{host},myhost}"
699 set -g status-style bg=red
700 %elif "#{==:#{host},myotherhost}"
701 set -g status-style bg=green
702 %else
703 set -g status-style bg=blue
704 %endif
707 Will change the status line to red if running on
708 .Ql myhost ,
709 green if running on
710 .Ql myotherhost ,
711 or blue if running on another host.
712 Conditionals may be given on one line, for example:
713 .Bd -literal -offset indent
714 %if #{==:#{host},myhost} set -g status-style bg=red %endif
716 .Sh COMMANDS
717 This section describes the commands supported by
718 .Nm .
719 Most commands accept the optional
720 .Fl t
721 (and sometimes
722 .Fl s )
723 argument with one of
724 .Ar target-client ,
725 .Ar target-session ,
726 .Ar target-window ,
728 .Ar target-pane .
729 These specify the client, session, window or pane which a command should affect.
731 .Ar target-client
732 should be the name of the client,
733 typically the
734 .Xr pty 4
735 file to which the client is connected, for example either of
736 .Pa /dev/ttyp1
738 .Pa ttyp1
739 for the client attached to
740 .Pa /dev/ttyp1 .
741 If no client is specified,
743 attempts to work out the client currently in use; if that fails, an error is
744 reported.
745 Clients may be listed with the
746 .Ic list-clients
747 command.
749 .Ar target-session
750 is tried as, in order:
751 .Bl -enum -offset Ds
753 A session ID prefixed with a $.
755 An exact name of a session (as listed by the
756 .Ic list-sessions
757 command).
759 The start of a session name, for example
760 .Ql mysess
761 would match a session named
762 .Ql mysession .
765 .Xr fnmatch 3
766 pattern which is matched against the session name.
769 If the session name is prefixed with an
770 .Ql = ,
771 only an exact match is accepted (so
772 .Ql =mysess
773 will only match exactly
774 .Ql mysess ,
776 .Ql mysession ) .
778 If a single session is found, it is used as the target session; multiple matches
779 produce an error.
780 If a session is omitted, the current session is used if available; if no
781 current session is available, the most recently used is chosen.
783 .Ar target-window
785 .Ar src-window
787 .Ar dst-window )
788 specifies a window in the form
789 .Em session Ns \&: Ns Em window .
790 .Em session
791 follows the same rules as for
792 .Ar target-session ,
794 .Em window
795 is looked for in order as:
796 .Bl -enum -offset Ds
798 A special token, listed below.
800 A window index, for example
801 .Ql mysession:1
802 is window 1 in session
803 .Ql mysession .
805 A window ID, such as @1.
807 An exact window name, such as
808 .Ql mysession:mywindow .
810 The start of a window name, such as
811 .Ql mysession:mywin .
813 As an
814 .Xr fnmatch 3
815 pattern matched against the window name.
818 Like sessions, a
819 .Ql =
820 prefix will do an exact match only.
821 An empty window name specifies the next unused index if appropriate (for
822 example the
823 .Ic new-window
825 .Ic link-window
826 commands)
827 otherwise the current window in
828 .Em session
829 is chosen.
831 The following special tokens are available to indicate particular windows.
832 Each has a single-character alternative form.
833 .Bl -column "XXXXXXXXXX" "X"
834 .It Sy "Token" Ta Sy "" Ta Sy "Meaning"
835 .It Li "{start}" Ta "^" Ta "The lowest-numbered window"
836 .It Li "{end}" Ta "$" Ta "The highest-numbered window"
837 .It Li "{last}" Ta "!" Ta "The last (previously current) window"
838 .It Li "{next}" Ta "+" Ta "The next window by number"
839 .It Li "{previous}" Ta "-" Ta "The previous window by number"
842 .Ar target-pane
844 .Ar src-pane
846 .Ar dst-pane )
847 may be a pane ID or takes a similar form to
848 .Ar target-window
849 but with the optional addition of a period followed by a pane index or pane ID,
850 for example:
851 .Ql mysession:mywindow.1 .
852 If the pane index is omitted, the currently active pane in the specified
853 window is used.
854 The following special tokens are available for the pane index:
855 .Bl -column "XXXXXXXXXXXXXX" "X"
856 .It Sy "Token" Ta Sy "" Ta Sy "Meaning"
857 .It Li "{last}" Ta "!" Ta "The last (previously active) pane"
858 .It Li "{next}" Ta "+" Ta "The next pane by number"
859 .It Li "{previous}" Ta "-" Ta "The previous pane by number"
860 .It Li "{top}" Ta "" Ta "The top pane"
861 .It Li "{bottom}" Ta "" Ta "The bottom pane"
862 .It Li "{left}" Ta "" Ta "The leftmost pane"
863 .It Li "{right}" Ta "" Ta "The rightmost pane"
864 .It Li "{top-left}" Ta "" Ta "The top-left pane"
865 .It Li "{top-right}" Ta "" Ta "The top-right pane"
866 .It Li "{bottom-left}" Ta "" Ta "The bottom-left pane"
867 .It Li "{bottom-right}" Ta "" Ta "The bottom-right pane"
868 .It Li "{up-of}" Ta "" Ta "The pane above the active pane"
869 .It Li "{down-of}" Ta "" Ta "The pane below the active pane"
870 .It Li "{left-of}" Ta "" Ta "The pane to the left of the active pane"
871 .It Li "{right-of}" Ta "" Ta "The pane to the right of the active pane"
874 The tokens
875 .Ql +
877 .Ql -
878 may be followed by an offset, for example:
879 .Bd -literal -offset indent
880 select-window -t:+2
883 In addition,
884 .Em target-session ,
885 .Em target-window
887 .Em target-pane
888 may consist entirely of the token
889 .Ql {mouse}
890 (alternative form
891 .Ql = )
892 to specify the session, window or pane where the most recent mouse event
893 occurred (see the
894 .Sx MOUSE SUPPORT
895 section)
897 .Ql {marked}
898 (alternative form
899 .Ql \[ti] )
900 to specify the marked pane (see
901 .Ic select-pane
902 .Fl m ) .
904 Sessions, window and panes are each numbered with a unique ID; session IDs are
905 prefixed with a
906 .Ql $ ,
907 windows with a
908 .Ql @ ,
909 and panes with a
910 .Ql % .
911 These are unique and are unchanged for the life of the session, window or pane
912 in the
914 server.
915 The pane ID is passed to the child process of the pane in the
916 .Ev TMUX_PANE
917 environment variable.
918 IDs may be displayed using the
919 .Ql session_id ,
920 .Ql window_id ,
922 .Ql pane_id
923 formats (see the
924 .Sx FORMATS
925 section) and the
926 .Ic display-message ,
927 .Ic list-sessions ,
928 .Ic list-windows
930 .Ic list-panes
931 commands.
933 .Ar shell-command
934 arguments are
935 .Xr sh 1
936 commands.
937 This may be a single argument passed to the shell, for example:
938 .Bd -literal -offset indent
939 new-window \[aq]vi \[ti]/.tmux.conf\[aq]
942 Will run:
943 .Bd -literal -offset indent
944 /bin/sh -c \[aq]vi \[ti]/.tmux.conf\[aq]
947 Additionally, the
948 .Ic new-window ,
949 .Ic new-session ,
950 .Ic split-window ,
951 .Ic respawn-window
953 .Ic respawn-pane
954 commands allow
955 .Ar shell-command
956 to be given as multiple arguments and executed directly (without
957 .Ql sh -c ) .
958 This can avoid issues with shell quoting.
959 For example:
960 .Bd -literal -offset indent
961 $ tmux new-window vi \[ti]/.tmux.conf
964 Will run
965 .Xr vi 1
966 directly without invoking the shell.
968 .Ar command
969 .Op Ar argument ...
970 refers to a
972 command, either passed with the command and arguments separately, for example:
973 .Bd -literal -offset indent
974 bind-key F1 set-option status off
977 Or passed as a single string argument in
978 .Pa .tmux.conf ,
979 for example:
980 .Bd -literal -offset indent
981 bind-key F1 { set-option status off }
984 Example
986 commands include:
987 .Bd -literal -offset indent
988 refresh-client -t/dev/ttyp2
990 rename-session -tfirst newname
992 set-option -wt:0 monitor-activity on
994 new-window ; split-window -d
996 bind-key R source-file \[ti]/.tmux.conf \e; \e
997         display-message "source-file done"
1000 Or from
1001 .Xr sh 1 :
1002 .Bd -literal -offset indent
1003 $ tmux kill-window -t :1
1005 $ tmux new-window \e; split-window -d
1007 $ tmux new-session -d \[aq]vi \[ti]/.tmux.conf\[aq] \e; split-window -d \e; attach
1009 .Sh CLIENTS AND SESSIONS
1012 server manages clients, sessions, windows and panes.
1013 Clients are attached to sessions to interact with them, either
1014 when they are created with the
1015 .Ic new-session
1016 command, or later with the
1017 .Ic attach-session
1018 command.
1019 Each session has one or more windows
1020 .Em linked
1021 into it.
1022 Windows may be linked to multiple sessions and are made up of one or
1023 more panes,
1024 each of which contains a pseudo terminal.
1025 Commands for creating, linking and otherwise manipulating windows
1026 are covered
1027 in the
1028 .Sx WINDOWS AND PANES
1029 section.
1031 The following commands are available to manage clients and sessions:
1032 .Bl -tag -width Ds
1033 .Tg attach
1034 .It Xo Ic attach-session
1035 .Op Fl dErx
1036 .Op Fl c Ar working-directory
1037 .Op Fl f Ar flags
1038 .Op Fl t Ar target-session
1040 .D1 Pq alias: Ic attach
1041 If run from outside
1042 .Nm ,
1043 attach to
1044 .Ar target-session
1045 in the current terminal.
1046 .Ar target-session
1047 must already exist - to create a new session, see the
1048 .Ic new-session
1049 command (with
1050 .Fl A
1051 to create or attach).
1052 If used from inside, switch the currently attached session to
1053 .Ar target-session .
1055 .Fl d
1056 is specified, any other clients attached to the session are detached.
1058 .Fl x
1059 is given, send
1060 .Dv SIGHUP
1061 to the parent process of the client as well as
1062 detaching the client, typically causing it to exit.
1063 .Fl f
1064 sets a comma-separated list of client flags.
1065 The flags are:
1066 .Bl -tag -width Ds
1067 .It active-pane
1068 the client has an independent active pane
1069 .It ignore-size
1070 the client does not affect the size of other clients
1071 .It no-output
1072 the client does not receive pane output in control mode
1073 .It pause-after=seconds
1074 output is paused once the pane is
1075 .Ar seconds
1076 behind in control mode
1077 .It read-only
1078 the client is read-only
1079 .It wait-exit
1080 wait for an empty line input before exiting in control mode
1083 A leading
1084 .Ql \&!
1085 turns a flag off if the client is already attached.
1086 .Fl r
1087 is an alias for
1088 .Fl f
1089 .Ar read-only,ignore-size .
1090 When a client is read-only, only keys bound to the
1091 .Ic detach-client
1093 .Ic switch-client
1094 commands have any effect.
1095 A client with the
1096 .Ar active-pane
1097 flag allows the active pane to be selected independently of the window's active
1098 pane used by clients without the flag.
1099 This only affects the cursor position and commands issued from the client;
1100 other features such as hooks and styles continue to use the window's active
1101 pane.
1103 If no server is started,
1104 .Ic attach-session
1105 will attempt to start it; this will fail unless sessions are created in the
1106 configuration file.
1109 .Ar target-session
1110 rules for
1111 .Ic attach-session
1112 are slightly adjusted: if
1114 needs to select the most recently used session, it will prefer the most
1115 recently used
1116 .Em unattached
1117 session.
1119 .Fl c
1120 will set the session working directory (used for new windows) to
1121 .Ar working-directory .
1124 .Fl E
1125 is used, the
1126 .Ic update-environment
1127 option will not be applied.
1128 .Tg detach
1129 .It Xo Ic detach-client
1130 .Op Fl aP
1131 .Op Fl E Ar shell-command
1132 .Op Fl s Ar target-session
1133 .Op Fl t Ar target-client
1135 .D1 Pq alias: Ic detach
1136 Detach the current client if bound to a key, the client specified with
1137 .Fl t ,
1138 or all clients currently attached to the session specified by
1139 .Fl s .
1141 .Fl a
1142 option kills all but the client given with
1143 .Fl t .
1145 .Fl P
1146 is given, send
1147 .Dv SIGHUP
1148 to the parent process of the client, typically causing it
1149 to exit.
1150 With
1151 .Fl E ,
1153 .Ar shell-command
1154 to replace the client.
1155 .Tg has
1156 .It Ic has-session Op Fl t Ar target-session
1157 .D1 Pq alias: Ic has
1158 Report an error and exit with 1 if the specified session does not exist.
1159 If it does exist, exit with 0.
1160 .It Ic kill-server
1161 Kill the
1163 server and clients and destroy all sessions.
1164 .It Xo Ic kill-session
1165 .Op Fl aC
1166 .Op Fl t Ar target-session
1168 Destroy the given session, closing any windows linked to it and no other
1169 sessions, and detaching all clients attached to it.
1171 .Fl a
1172 is given, all sessions but the specified one is killed.
1174 .Fl C
1175 flag clears alerts (bell, activity, or silence) in all windows linked to the
1176 session.
1177 .Tg lsc
1178 .It Xo Ic list-clients
1179 .Op Fl F Ar format
1180 .Op Fl f Ar filter
1181 .Op Fl t Ar target-session
1183 .D1 Pq alias: Ic lsc
1184 List all clients attached to the server.
1185 .Fl F
1186 specifies the format of each line and
1187 .Fl f
1188 a filter.
1189 Only clients for which the filter is true are shown.
1190 See the
1191 .Sx FORMATS
1192 section.
1194 .Ar target-session
1195 is specified, list only clients connected to that session.
1196 .Tg lscm
1197 .It Xo Ic list-commands
1198 .Op Fl F Ar format
1199 .Op Ar command
1201 .D1 Pq alias: Ic lscm
1202 List the syntax of
1203 .Ar command
1204 or - if omitted - of all commands supported by
1205 .Nm .
1206 .Tg ls
1207 .It Xo Ic list-sessions
1208 .Op Fl F Ar format
1209 .Op Fl f Ar filter
1211 .D1 Pq alias: Ic ls
1212 List all sessions managed by the server.
1213 .Fl F
1214 specifies the format of each line and
1215 .Fl f
1216 a filter.
1217 Only sessions for which the filter is true are shown.
1218 See the
1219 .Sx FORMATS
1220 section.
1221 .Tg lockc
1222 .It Ic lock-client Op Fl t Ar target-client
1223 .D1 Pq alias: Ic lockc
1224 Lock
1225 .Ar target-client ,
1226 see the
1227 .Ic lock-server
1228 command.
1229 .Tg locks
1230 .It Ic lock-session Op Fl t Ar target-session
1231 .D1 Pq alias: Ic locks
1232 Lock all clients attached to
1233 .Ar target-session .
1234 .Tg new
1235 .It Xo Ic new-session
1236 .Op Fl AdDEPX
1237 .Op Fl c Ar start-directory
1238 .Op Fl e Ar environment
1239 .Op Fl f Ar flags
1240 .Op Fl F Ar format
1241 .Op Fl n Ar window-name
1242 .Op Fl s Ar session-name
1243 .Op Fl t Ar group-name
1244 .Op Fl x Ar width
1245 .Op Fl y Ar height
1246 .Op Ar shell-command
1248 .D1 Pq alias: Ic new
1249 Create a new session with name
1250 .Ar session-name .
1252 The new session is attached to the current terminal unless
1253 .Fl d
1254 is given.
1255 .Ar window-name
1257 .Ar shell-command
1258 are the name of and shell command to execute in the initial window.
1259 With
1260 .Fl d ,
1261 the initial size comes from the global
1262 .Ic default-size
1263 option;
1264 .Fl x
1266 .Fl y
1267 can be used to specify a different size.
1268 .Ql -
1269 uses the size of the current client if any.
1271 .Fl x
1273 .Fl y
1274 is given, the
1275 .Ic default-size
1276 option is set for the session.
1277 .Fl f
1278 sets a comma-separated list of client flags (see
1279 .Ic attach-session ) .
1281 If run from a terminal, any
1282 .Xr termios 4
1283 special characters are saved and used for new windows in the new session.
1286 .Fl A
1287 flag makes
1288 .Ic new-session
1289 behave like
1290 .Ic attach-session
1292 .Ar session-name
1293 already exists;
1295 .Fl A
1296 is given,
1297 .Fl D
1298 behaves like
1299 .Fl d
1301 .Ic attach-session ,
1303 .Fl X
1304 behaves like
1305 .Fl x
1307 .Ic attach-session .
1310 .Fl t
1311 is given, it specifies a
1312 .Ic session group .
1313 Sessions in the same group share the same set of windows - new windows are
1314 linked to all sessions in the group and any windows closed removed from all
1315 sessions.
1316 The current and previous window and any session options remain independent and
1317 any session in a group may be killed without affecting the others.
1319 .Ar group-name
1320 argument may be:
1321 .Bl -enum -width Ds
1323 the name of an existing group, in which case the new session is added to that
1324 group;
1326 the name of an existing session - the new session is added to the same group
1327 as that session, creating a new group if necessary;
1329 the name for a new group containing only the new session.
1332 .Fl n
1334 .Ar shell-command
1335 are invalid if
1336 .Fl t
1337 is used.
1340 .Fl P
1341 option prints information about the new session after it has been created.
1342 By default, it uses the format
1343 .Ql #{session_name}:\&
1344 but a different format may be specified with
1345 .Fl F .
1348 .Fl E
1349 is used, the
1350 .Ic update-environment
1351 option will not be applied.
1352 .Fl e
1353 takes the form
1354 .Ql VARIABLE=value
1355 and sets an environment variable for the newly created session; it may be
1356 specified multiple times.
1357 .Tg refresh
1358 .It Xo Ic refresh-client
1359 .Op Fl cDLRSU
1360 .Op Fl A Ar pane:state
1361 .Op Fl B Ar name:what:format
1362 .Op Fl C Ar size
1363 .Op Fl f Ar flags
1364 .Op Fl l Op Ar target-pane
1365 .Op Fl r Ar pane:report
1366 .Op Fl t Ar target-client
1367 .Op Ar adjustment
1369 .D1 Pq alias: Ic refresh
1370 Refresh the current client if bound to a key, or a single client if one is given
1371 with
1372 .Fl t .
1374 .Fl S
1375 is specified, only update the client's status line.
1378 .Fl U ,
1379 .Fl D ,
1380 .Fl L
1381 .Fl R ,
1383 .Fl c
1384 flags allow the visible portion of a window which is larger than the client
1385 to be changed.
1386 .Fl U
1387 moves the visible part up by
1388 .Ar adjustment
1389 rows and
1390 .Fl D
1391 down,
1392 .Fl L
1393 left by
1394 .Ar adjustment
1395 columns and
1396 .Fl R
1397 right.
1398 .Fl c
1399 returns to tracking the cursor automatically.
1401 .Ar adjustment
1402 is omitted, 1 is used.
1403 Note that the visible position is a property of the client not of the
1404 window, changing the current window in the attached session will reset
1407 .Fl C
1408 sets the width and height of a control mode client or of a window for a
1409 control mode client,
1410 .Ar size
1411 must be one of
1412 .Ql widthxheight
1414 .Ql window ID:widthxheight ,
1415 for example
1416 .Ql 80x24
1418 .Ql @0:80x24 .
1419 .Fl A
1420 allows a control mode client to trigger actions on a pane.
1421 The argument is a pane ID (with leading
1422 .Ql % ) ,
1423 a colon, then one of
1424 .Ql on ,
1425 .Ql off ,
1426 .Ql continue
1428 .Ql pause .
1430 .Ql off ,
1432 will not send output from the pane to the client and if all clients have turned
1433 the pane off, will stop reading from the pane.
1435 .Ql continue ,
1437 will return to sending output to the pane if it was paused (manually or with the
1438 .Ar pause-after
1439 flag).
1441 .Ql pause ,
1443 will pause the pane.
1444 .Fl A
1445 may be given multiple times for different panes.
1447 .Fl B
1448 sets a subscription to a format for a control mode client.
1449 The argument is split into three items by colons:
1450 .Ar name
1451 is a name for the subscription;
1452 .Ar what
1453 is a type of item to subscribe to;
1454 .Ar format
1455 is the format.
1456 After a subscription is added, changes to the format are reported with the
1457 .Ic %subscription-changed
1458 notification, at most once a second.
1459 If only the name is given, the subscription is removed.
1460 .Ar what
1461 may be empty to check the format only for the attached session, or one of:
1462 a pane ID such as
1463 .Ql %0 ;
1464 .Ql %*
1465 for all panes in the attached session;
1466 a window ID such as
1467 .Ql @0 ;
1469 .Ql @*
1470 for all windows in the attached session.
1472 .Fl f
1473 sets a comma-separated list of client flags, see
1474 .Ic attach-session .
1475 .Fl r
1476 allows a control mode client to provide information about a pane via a report
1477 (such as the response to OSC 10).
1478 The argument is a pane ID (with a leading
1479 .Ql % ) ,
1480 a colon, then a report escape sequence.
1482 .Fl l
1483 requests the clipboard from the client using the
1484 .Xr xterm 1
1485 escape sequence.
1487 .Ar target-pane
1488 is given, the clipboard is sent (in encoded form), otherwise it is stored in a
1489 new paste buffer.
1491 .Fl L ,
1492 .Fl R ,
1493 .Fl U
1495 .Fl D
1496 move the visible portion of the window left, right, up or down
1498 .Ar adjustment ,
1499 if the window is larger than the client.
1500 .Fl c
1501 resets so that the position follows the cursor.
1502 See the
1503 .Ic window-size
1504 option.
1505 .Tg rename
1506 .It Xo Ic rename-session
1507 .Op Fl t Ar target-session
1508 .Ar new-name
1510 .D1 Pq alias: Ic rename
1511 Rename the session to
1512 .Ar new-name .
1513 .It Xo Ic server-access
1514 .Op Fl adlrw
1515 .Op Ar user
1517 Change the access or read/write permission of
1518 .Ar user .
1519 The user running the
1521 server (its owner) and the root user cannot be changed and are always
1522 permitted access.
1524 .Fl a
1526 .Fl d
1527 are used to give or revoke access for the specified user.
1528 If the user is already attached, the
1529 .Fl d
1530 flag causes their clients to be detached.
1532 .Fl r
1534 .Fl w
1535 change the permissions for
1536 .Ar user :
1537 .Fl r
1538 makes their clients read-only and
1539 .Fl w
1540 writable.
1541 .Fl l
1542 lists current access permissions.
1544 By default, the access list is empty and
1546 creates sockets with file system permissions preventing access by any user
1547 other than the owner (and root).
1548 These permissions must be changed manually.
1549 Great care should be taken not to allow access to untrusted users even
1550 read-only.
1551 .Tg showmsgs
1552 .It Xo Ic show-messages
1553 .Op Fl JT
1554 .Op Fl t Ar target-client
1556 .D1 Pq alias: Ic showmsgs
1557 Show server messages or information.
1558 Messages are stored, up to a maximum of the limit set by the
1559 .Ar message-limit
1560 server option.
1561 .Fl J
1563 .Fl T
1564 show debugging information about jobs and terminals.
1565 .Tg source
1566 .It Xo Ic source-file
1567 .Op Fl Fnqv
1568 .Op Fl t Ar target-pane
1569 .Ar path ...
1571 .D1 Pq alias: Ic source
1572 Execute commands from one or more files specified by
1573 .Ar path
1574 (which may be
1575 .Xr glob 7
1576 patterns).
1578 .Fl F
1579 is present, then
1580 .Ar path
1581 is expanded as a format.
1583 .Fl q
1584 is given, no error will be returned if
1585 .Ar path
1586 does not exist.
1587 With
1588 .Fl n ,
1589 the file is parsed but no commands are executed.
1590 .Fl v
1591 shows the parsed commands and line numbers if possible.
1592 .Tg start
1593 .It Ic start-server
1594 .D1 Pq alias: Ic start
1595 Start the
1597 server, if not already running, without creating any sessions.
1599 Note that as by default the
1601 server will exit with no sessions, this is only useful if a session is created
1603 .Pa \[ti]/.tmux.conf ,
1604 .Ic exit-empty
1605 is turned off, or another command is run as part of the same command sequence.
1606 For example:
1607 .Bd -literal -offset indent
1608 $ tmux start \\; show -g
1610 .Tg suspendc
1611 .It Xo Ic suspend-client
1612 .Op Fl t Ar target-client
1614 .D1 Pq alias: Ic suspendc
1615 Suspend a client by sending
1616 .Dv SIGTSTP
1617 (tty stop).
1618 .Tg switchc
1619 .It Xo Ic switch-client
1620 .Op Fl ElnprZ
1621 .Op Fl c Ar target-client
1622 .Op Fl t Ar target-session
1623 .Op Fl T Ar key-table
1625 .D1 Pq alias: Ic switchc
1626 Switch the current session for client
1627 .Ar target-client
1629 .Ar target-session .
1630 As a special case,
1631 .Fl t
1632 may refer to a pane (a target that contains
1633 .Ql \&: ,
1634 .Ql \&.
1636 .Ql % ) ,
1637 to change session, window and pane.
1638 In that case,
1639 .Fl Z
1640 keeps the window zoomed if it was zoomed.
1642 .Fl l ,
1643 .Fl n
1645 .Fl p
1646 is used, the client is moved to the last, next or previous session
1647 respectively.
1648 .Fl r
1649 toggles the client
1650 .Ic read-only
1652 .Ic ignore-size
1653 flags (see the
1654 .Ic attach-session
1655 command).
1658 .Fl E
1659 is used,
1660 .Ic update-environment
1661 option will not be applied.
1663 .Fl T
1664 sets the client's key table; the next key from the client will be interpreted
1665 from
1666 .Ar key-table .
1667 This may be used to configure multiple prefix keys, or to bind commands to
1668 sequences of keys.
1669 For example, to make typing
1670 .Ql abc
1671 run the
1672 .Ic list-keys
1673 command:
1674 .Bd -literal -offset indent
1675 bind-key -Ttable2 c list-keys
1676 bind-key -Ttable1 b switch-client -Ttable2
1677 bind-key -Troot   a switch-client -Ttable1
1680 .Sh WINDOWS AND PANES
1681 Each window displayed by
1683 may be split into one or more
1684 .Em panes ;
1685 each pane takes up a certain area of the display and is a separate terminal.
1686 A window may be split into panes using the
1687 .Ic split-window
1688 command.
1689 Windows may be split horizontally (with the
1690 .Fl h
1691 flag) or vertically.
1692 Panes may be resized with the
1693 .Ic resize-pane
1694 command (bound to
1695 .Ql C-Up ,
1696 .Ql C-Down
1697 .Ql C-Left
1699 .Ql C-Right
1700 by default), the current pane may be changed with the
1701 .Ic select-pane
1702 command and the
1703 .Ic rotate-window
1705 .Ic swap-pane
1706 commands may be used to swap panes without changing their position.
1707 Panes are numbered beginning from zero in the order they are created.
1709 By default, a
1711 pane permits direct access to the terminal contained in the pane.
1712 A pane may also be put into one of several modes:
1713 .Bl -dash -offset indent
1715 Copy mode, which permits a section of a window or its
1716 history to be copied to a
1717 .Em paste buffer
1718 for later insertion into another window.
1719 This mode is entered with the
1720 .Ic copy-mode
1721 command, bound to
1722 .Ql \&[
1723 by default.
1724 Copied text can be pasted with the
1725 .Ic paste-buffer
1726 command, bound to
1727 .Ql \&] .
1729 View mode, which is like copy mode but is entered when a command that produces
1730 output, such as
1731 .Ic list-keys ,
1732 is executed from a key binding.
1734 Choose mode, which allows an item to be chosen from a list.
1735 This may be a client, a session or window or pane, or a buffer.
1736 This mode is entered with the
1737 .Ic choose-buffer ,
1738 .Ic choose-client
1740 .Ic choose-tree
1741 commands.
1744 In copy mode an indicator is displayed in the top-right corner of the pane with
1745 the current position and the number of lines in the history.
1747 Commands are sent to copy mode using the
1748 .Fl X
1749 flag to the
1750 .Ic send-keys
1751 command.
1752 When a key is pressed, copy mode automatically uses one of two key tables,
1753 depending on the
1754 .Ic mode-keys
1755 option:
1756 .Ic copy-mode
1757 for emacs, or
1758 .Ic copy-mode-vi
1759 for vi.
1760 Key tables may be viewed with the
1761 .Ic list-keys
1762 command.
1764 The following commands are supported in copy mode:
1765 .Bl -tag -width Ds
1766 .It Xo
1767 .Ic append-selection
1769 Append the selection to the top paste buffer.
1770 .It Xo
1771 .Ic append-selection-and-cancel
1772 (vi: A)
1774 Append the selection to the top paste buffer and exit copy mode.
1775 .It Xo
1776 .Ic back-to-indentation
1777 (vi: ^)
1778 (emacs: M-m)
1780 Move the cursor back to the indentation.
1781 .It Xo
1782 .Ic begin-selection
1783 (vi: Space)
1784 (emacs: C-Space)
1786 Begin selection.
1787 .It Xo
1788 .Ic bottom-line
1789 (vi: L)
1791 Move to the bottom line.
1792 .It Xo
1793 .Ic cancel
1794 (vi: q)
1795 (emacs: Escape)
1797 Exit copy mode.
1798 .It Xo
1799 .Ic clear-selection
1800 (vi: Escape)
1801 (emacs: C-g)
1803 Clear the current selection.
1804 .It Xo
1805 .Ic copy-end-of-line
1806 .Op Fl CP
1807 .Op Ar prefix
1809 Copy from the cursor position to the end of the line.
1810 .Ar prefix
1811 is used to name the new paste buffer.
1812 .It Xo
1813 .Ic copy-end-of-line-and-cancel
1814 .Op Fl CP
1815 .Op Ar prefix
1817 Copy from the cursor position and exit copy mode.
1818 .It Xo
1819 .Ic copy-pipe-end-of-line
1820 .Op Fl CP
1821 .Op Ar command
1822 .Op Ar prefix
1824 Copy from the cursor position to the end of the line and pipe the text to
1825 .Ar command .
1826 .Ar prefix
1827 is used to name the new paste buffer.
1828 .It Xo
1829 .Ic copy-pipe-end-of-line-and-cancel
1830 .Op Fl CP
1831 .Op Ar command
1832 .Op Ar prefix
1834 Same as
1835 .Ic copy-pipe-end-of-line
1836 but also exit copy mode.
1837 .It Xo
1838 .Ic copy-line
1839 .Op Fl CP
1840 .Op Ar prefix
1842 Copy the entire line.
1843 .It Xo
1844 .Ic copy-line-and-cancel
1845 .Op Fl CP
1846 .Op Ar prefix
1848 Copy the entire line and exit copy mode.
1849 .It Xo
1850 .Ic copy-pipe-line
1851 .Op Fl CP
1852 .Op Ar command
1853 .Op Ar prefix
1855 Copy the entire line and pipe the text to
1856 .Ar command .
1857 .Ar prefix
1858 is used to name the new paste buffer.
1859 .It Xo
1860 .Ic copy-pipe-line-and-cancel
1861 .Op Fl CP
1862 .Op Ar command
1863 .Op Ar prefix
1865 Same as
1866 .Ic copy-pipe-line
1867 but also exit copy mode.
1868 .It Xo
1869 .Ic copy-pipe
1870 .Op Fl CP
1871 .Op Ar command
1872 .Op Ar prefix
1874 Copy the selection, clear it and pipe its text to
1875 .Ar command .
1876 .Ar prefix
1877 is used to name the new paste buffer.
1878 .It Xo
1879 .Ic copy-pipe-no-clear
1880 .Op Fl CP
1881 .Op Ar command
1882 .Op Ar prefix
1884 Same as
1885 .Ic copy-pipe
1886 but do not clear the selection.
1887 .It Xo
1888 .Ic copy-pipe-and-cancel
1889 .Op Fl CP
1890 .Op Ar command
1891 .Op Ar prefix
1893 Same as
1894 .Ic copy-pipe
1895 but also exit copy mode.
1896 .It Xo
1897 .Ic copy-selection
1898 .Op Fl CP
1899 .Op Ar prefix
1901 Copies the current selection.
1902 .It Xo
1903 .Ic copy-selection-no-clear
1904 .Op Fl CP
1905 .Op Ar prefix
1907 Same as
1908 .Ic copy-selection
1909 but do not clear the selection.
1910 .It Xo
1911 .Ic copy-selection-and-cancel
1912 .Op Fl CP
1913 .Op Ar prefix
1914 (vi: Enter)
1915 (emacs: M-w)
1917 Copy the current selection and exit copy mode.
1918 .It Xo
1919 .Ic cursor-down
1920 (vi: j)
1921 (emacs: Down)
1923 Move the cursor down.
1924 .It Xo
1925 .Ic cursor-down-and-cancel
1927 Same as
1928 .Ic cursor-down
1929 but also exit copy mode if reaching the bottom.
1930 .It Xo
1931 .Ic cursor-left
1932 (vi: h)
1933 (emacs: Left)
1935 Move the cursor left.
1936 .It Xo
1937 .Ic cursor-right
1938 (vi: l)
1939 (emacs: Right)
1941 Move the cursor right.
1942 .It Xo
1943 .Ic cursor-up
1944 (vi: k)
1945 (emacs: Up)
1947 Move the cursor up.
1948 .It Xo
1949 .Ic end-of-line
1950 (vi: $)
1951 (emacs: C-e)
1953 Move the cursor to the end of the line.
1954 .It Xo
1955 .Ic goto-line
1956 .Ar line
1957 (vi: :)
1958 (emacs: g)
1960 Move the cursor to a specific line.
1961 .It Xo
1962 .Ic halfpage-down
1963 (vi: C-d)
1964 (emacs: M-Down)
1966 Scroll down by half a page.
1967 .It Xo
1968 .Ic halfpage-down-and-cancel
1970 Same as
1971 .Ic halfpage-down
1972 but also exit copy mode if reaching the bottom.
1973 .It Xo
1974 .Ic halfpage-up
1975 (vi: C-u)
1976 (emacs: M-Up)
1978 Scroll up by half a page.
1979 .It Xo
1980 .Ic history-bottom
1981 (vi: G)
1982 (emacs: M->)
1984 Scroll to the bottom of the history.
1985 .It Xo
1986 .Ic history-top
1987 (vi: g)
1988 (emacs: M-<)
1990 Scroll to the top of the history.
1991 .It Xo
1992 .Ic jump-again
1993 (vi: ;)
1994 (emacs: ;)
1996 Repeat the last jump.
1997 .It Xo
1998 .Ic jump-backward
1999 .Ar to
2000 (vi: F)
2001 (emacs: F)
2003 Jump backwards to the specified text.
2004 .It Xo
2005 .Ic jump-forward
2006 .Ar to
2007 (vi: f)
2008 (emacs: f)
2010 Jump forward to the specified text.
2011 .It Xo
2012 .Ic jump-reverse
2013 (vi: ,)
2014 (emacs: ,)
2016 Repeat the last jump in the reverse direction (forward becomes backward and
2017 backward becomes forward).
2018 .It Xo
2019 .Ic jump-to-backward
2020 .Ar to
2021 (vi: T)
2023 Jump backwards, but one character less, placing the cursor on the character
2024 after the target.
2025 .It Xo
2026 .Ic jump-to-forward
2027 .Ar to
2028 (vi: t)
2030 Jump forward, but one character less, placing the cursor on the character
2031 before the target.
2032 .It Xo
2033 .Ic jump-to-mark
2034 (vi: M-x)
2035 (emacs: M-x)
2037 Jump to the last mark.
2038 .It Xo
2039 .Ic middle-line
2040 (vi: M)
2041 (emacs: M-r)
2043 Move to the middle line.
2044 .It Xo
2045 .Ic next-matching-bracket
2046 (vi: %)
2047 (emacs: M-C-f)
2049 Move to the next matching bracket.
2050 .It Xo
2051 .Ic next-paragraph
2052 (vi: })
2053 (emacs: M-})
2055 Move to the next paragraph.
2056 .It Xo
2057 .Ic next-prompt
2058 .Op Fl o
2060 Move to the next prompt.
2061 .It Xo
2062 .Ic next-word
2063 (vi: w)
2065 Move to the next word.
2066 .It Xo
2067 .Ic next-word-end
2068 (vi: e)
2069 (emacs: M-f)
2071 Move to the end of the next word.
2072 .It Xo
2073 .Ic next-space
2074 (vi: W)
2076 Same as
2077 .Ic next-word
2078 but use a space alone as the word separator.
2079 .It Xo
2080 .Ic next-space-end
2081 (vi: E)
2083 Same as
2084 .Ic next-word-end
2085 but use a space alone as the word separator.
2086 .It Xo
2087 .Ic other-end
2088 (vi: o)
2090 Switch at which end of the selection the cursor sits.
2091 .It Xo
2092 .Ic page-down
2093 (vi: C-f)
2094 (emacs: PageDown)
2096 Scroll down by one page.
2097 .It Xo
2098 .Ic page-down-and-cancel
2100 Same as
2101 .Ic page-down
2102 but also exit copy mode if reaching the bottom.
2103 .It Xo
2104 .Ic page-up
2105 (vi: C-b)
2106 (emacs: PageUp)
2108 Scroll up by one page.
2109 .It Xo
2110 .Ic pipe
2111 .Op Ar command
2113 Pipe the selected text to
2114 .Ar command
2115 and clear the selection.
2116 .It Xo
2117 .Ic pipe-no-clear
2118 .Op Ar command
2120 Same as
2121 .Ic pipe
2122 but do not clear the selection.
2123 .It Xo
2124 .Ic pipe-and-cancel
2125 .Op Ar command
2126 .Op Ar prefix
2128 Same as
2129 .Ic pipe
2130 but also exit copy mode.
2131 .It Xo
2132 .Ic previous-matching-bracket
2133 (emacs: M-C-b)
2135 Move to the previous matching bracket.
2136 .It Xo
2137 .Ic previous-paragraph
2138 (vi: {)
2139 (emacs: M-{)
2141 Move to the previous paragraph.
2142 .It Xo
2143 .Ic previous-prompt
2144 .Op Fl o
2146 Move to the previous prompt.
2147 .It Xo
2148 .Ic previous-word
2149 (vi: b)
2150 (emacs: M-b)
2152 Move to the previous word.
2153 .It Xo
2154 .Ic previous-space
2155 (vi: B)
2157 Same as
2158 .Ic previous-word
2159 but use a space alone as the word separator.
2160 .It Xo
2161 .Ic rectangle-on
2163 Turn on rectangle selection mode.
2164 .It Xo
2165 .Ic rectangle-off
2167 Turn off rectangle selection mode.
2168 .It Xo
2169 .Ic rectangle-toggle
2170 (vi: v)
2171 (emacs: R)
2173 Toggle rectangle selection mode.
2174 .It Xo
2175 .Ic refresh-from-pane
2176 (vi: r)
2177 (emacs: r)
2179 Refresh the content from the pane.
2180 .It Xo
2181 .Ic scroll-bottom
2183 Scroll up until the current line is at the bottom while keeping the cursor on
2184 that line.
2185 .It Xo
2186 .Ic scroll-down
2187 (vi: C-e)
2188 (emacs: C-Down)
2190 Scroll down.
2191 .It Xo
2192 .Ic scroll-down-and-cancel
2194 Same as
2195 .Ic scroll-down
2196 but also exit copy mode if the cursor reaches the bottom.
2197 .It Xo
2198 .Ic scroll-middle
2199 (vi: z)
2201 Scroll so that the current line becomes the middle one while keeping the
2202 cursor on that line.
2203 .It Xo
2204 .Ic scroll-top
2206 Scroll down until the current line is at the top while keeping the cursor on
2207 that line.
2208 .It Xo
2209 .Ic scroll-up
2210 (vi: C-y)
2211 (emacs: C-Up)
2213 Scroll up.
2214 .It Xo
2215 .Ic search-again
2216 (vi: n)
2217 (emacs: n)
2219 Repeat the last search.
2220 .It Xo
2221 .Ic search-backward
2222 .Ar text
2223 (vi: ?)
2225 Search backwards for the specified text.
2226 .It Xo
2227 .Ic search-backward-incremental
2228 .Ar text
2229 (emacs: C-r)
2231 Search backwards incrementally for the specified text.
2232 Is expected to be used with the
2233 .Fl i
2234 flag to the
2235 .Ic command-prompt
2236 command.
2237 .It Xo
2238 .Ic search-backward-text
2239 .Ar text
2241 Search backwards for the specified plain text.
2242 .It Xo
2243 .Ic search-forward
2244 .Ar text
2245 (vi: /)
2247 Search forward for the specified text.
2248 .It Xo
2249 .Ic search-forward-incremental
2250 .Ar text
2251 (emacs: C-s)
2253 Search forward incrementally for the specified text.
2254 Is expected to be used with the
2255 .Fl i
2256 flag to the
2257 .Ic command-prompt
2258 command.
2259 .It Xo
2260 .Ic search-forward-text
2261 .Ar text
2263 Search forward for the specified plain text.
2264 .It Xo
2265 .Ic search-reverse
2266 (vi: N)
2267 (emacs: N)
2269 Repeat the last search in the reverse direction (forward becomes backward and
2270 backward becomes forward).
2271 .It Xo
2272 .Ic select-line
2273 (vi: V)
2275 Select the current line.
2276 .It Xo
2277 .Ic select-word
2279 Select the current word.
2280 .It Xo
2281 .Ic set-mark
2282 (vi: X)
2283 (emacs: X)
2285 Mark the current line.
2286 .It Xo
2287 .Ic start-of-line
2288 (vi: 0)
2289 (emacs: C-a)
2291 Move the cursor to the start of the line.
2292 .It Xo
2293 .Ic stop-selection
2295 Stop selecting without clearing the current selection.
2296 .It Xo
2297 .Ic toggle-position
2298 (vi: P)
2299 (emacs: P)
2301 Toggle the visibility of the position indicator in the top right.
2302 .It Xo
2303 .Ic top-line
2304 (vi: H)
2305 (emacs: M-R)
2307 Move to the top line.
2310 The search commands come in several varieties:
2311 .Ql search-forward
2313 .Ql search-backward
2314 search for a regular expression;
2316 .Ql -text
2317 variants search for a plain text string rather than a regular expression;
2318 .Ql -incremental
2319 perform an incremental search and expect to be used with the
2320 .Fl i
2321 flag to the
2322 .Ic command-prompt
2323 command.
2324 .Ql search-again
2325 repeats the last search and
2326 .Ql search-reverse
2327 does the same but reverses the direction (forward becomes backward and backward
2328 becomes forward).
2331 .Ql next-prompt
2333 .Ql previous-prompt
2334 move between shell prompts, but require the shell to emit an escape sequence
2335 (\e033]133;A\e033\e\e) to tell
2337 where the prompts are located; if the shell does not do this, these commands
2338 will do nothing.
2340 .Fl o
2341 flag jumps to the beginning of the command output instead of the shell prompt.
2343 Copy commands may take an optional buffer prefix argument which is used
2344 to generate the buffer name (the default is
2345 .Ql buffer
2346 so buffers are named
2347 .Ql buffer0 ,
2348 .Ql buffer1
2349 and so on).
2350 Pipe commands take a command argument which is the command to which the
2351 selected text is piped.
2352 .Ql copy-pipe
2353 variants also copy the selection.
2355 .Ql -and-cancel
2356 variants of some commands exit copy mode after they have completed (for copy
2357 commands) or when the cursor reaches the bottom (for scrolling commands).
2358 .Ql -no-clear
2359 variants do not clear the selection.
2360 All the copy commands can take the
2361 .Fl C
2363 .Fl P
2364 flags.
2366 .Fl C
2367 flag suppresses setting the terminal clipboard when copying, while the
2368 .Fl P
2369 flag suppresses adding a paste buffer with the text.
2371 The next and previous word keys skip over whitespace and treat consecutive
2372 runs of either word separators or other letters as words.
2373 Word separators can be customized with the
2374 .Em word-separators
2375 session option.
2376 Next word moves to the start of the next word, next word end to the end of the
2377 next word and previous word to the start of the previous word.
2378 The three next and previous space keys work similarly but use a space alone as
2379 the word separator.
2380 Setting
2381 .Em word-separators
2382 to the empty string makes next/previous word equivalent to next/previous space.
2384 The jump commands enable quick movement within a line.
2385 For instance, typing
2386 .Ql f
2387 followed by
2388 .Ql /
2389 will move the cursor to the next
2390 .Ql /
2391 character on the current line.
2393 .Ql \&;
2394 will then jump to the next occurrence.
2396 Commands in copy mode may be prefaced by an optional repeat count.
2397 With vi key bindings, a prefix is entered using the number keys; with
2398 emacs, the Alt (meta) key and a number begins prefix entry.
2400 The synopsis for the
2401 .Ic copy-mode
2402 command is:
2403 .Bl -tag -width Ds
2404 .It Xo Ic copy-mode
2405 .Op Fl deHMqu
2406 .Op Fl s Ar src-pane
2407 .Op Fl t Ar target-pane
2409 Enter copy mode.
2410 .Fl u
2411 also scrolls one page up after entering and
2412 .Fl d
2413 one page down if already in copy mode.
2414 .Fl M
2415 begins a mouse drag (only valid if bound to a mouse key binding, see
2416 .Sx MOUSE SUPPORT ) .
2417 .Fl H
2418 hides the position indicator in the top right.
2419 .Fl q
2420 cancels copy mode and any other modes.
2421 .Fl s
2422 copies from
2423 .Ar src-pane
2424 instead of
2425 .Ar target-pane .
2427 .Fl e
2428 specifies that scrolling to the bottom of the history (to the visible screen)
2429 should exit copy mode.
2430 While in copy mode, pressing a key other than those used for scrolling will
2431 disable this behaviour.
2432 This is intended to allow fast scrolling through a pane's history, for
2433 example with:
2434 .Bd -literal -offset indent
2435 bind PageUp copy-mode -eu
2436 bind PageDown copy-mode -ed
2440 A number of preset arrangements of panes are available, these are called
2441 layouts.
2442 These may be selected with the
2443 .Ic select-layout
2444 command or cycled with
2445 .Ic next-layout
2446 (bound to
2447 .Ql Space
2448 by default); once a layout is chosen, panes within it may be moved and resized
2449 as normal.
2451 The following layouts are supported:
2452 .Bl -tag -width Ds
2453 .It Ic even-horizontal
2454 Panes are spread out evenly from left to right across the window.
2455 .It Ic even-vertical
2456 Panes are spread evenly from top to bottom.
2457 .It Ic main-horizontal
2458 A large (main) pane is shown at the top of the window and the remaining panes
2459 are spread from left to right in the leftover space at the bottom.
2460 Use the
2461 .Em main-pane-height
2462 window option to specify the height of the top pane.
2463 .It Ic main-horizontal-mirrored
2464 The same as
2465 .Ic main-horizontal
2466 but mirrored so the main pane is at the bottom of the window.
2467 .It Ic main-vertical
2468 A large (main) pane is shown on the left of the window and the remaining panes
2469 are spread from top to bottom in the leftover space on the right.
2470 Use the
2471 .Em main-pane-width
2472 window option to specify the width of the left pane.
2473 .It Ic main-vertical-mirrored
2474 The same as
2475 .Ic main-vertical
2476 but mirrored so the main pane is on the right of the window.
2477 .It Ic tiled
2478 Panes are spread out as evenly as possible over the window in both rows and
2479 columns.
2482 In addition,
2483 .Ic select-layout
2484 may be used to apply a previously used layout - the
2485 .Ic list-windows
2486 command displays the layout of each window in a form suitable for use with
2487 .Ic select-layout .
2488 For example:
2489 .Bd -literal -offset indent
2490 $ tmux list-windows
2491 0: ksh [159x48]
2492     layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
2493 $ tmux select-layout \[aq]bb62,159x48,0,0{79x48,0,0,79x48,80,0}\[aq]
2497 automatically adjusts the size of the layout for the current window size.
2498 Note that a layout cannot be applied to a window with more panes than that
2499 from which the layout was originally defined.
2501 Commands related to windows and panes are as follows:
2502 .Bl -tag -width Ds
2503 .Tg breakp
2504 .It Xo Ic break-pane
2505 .Op Fl abdP
2506 .Op Fl F Ar format
2507 .Op Fl n Ar window-name
2508 .Op Fl s Ar src-pane
2509 .Op Fl t Ar dst-window
2511 .D1 Pq alias: Ic breakp
2512 Break
2513 .Ar src-pane
2514 off from its containing window to make it the only pane in
2515 .Ar dst-window .
2516 With
2517 .Fl a
2519 .Fl b ,
2520 the window is moved to the next index after or before (existing windows are
2521 moved if necessary).
2523 .Fl d
2524 is given, the new window does not become the current window.
2526 .Fl P
2527 option prints information about the new window after it has been created.
2528 By default, it uses the format
2529 .Ql #{session_name}:#{window_index}.#{pane_index}
2530 but a different format may be specified with
2531 .Fl F .
2532 .Tg capturep
2533 .It Xo Ic capture-pane
2534 .Op Fl aAepPqCJN
2535 .Op Fl b Ar buffer-name
2536 .Op Fl E Ar end-line
2537 .Op Fl S Ar start-line
2538 .Op Fl t Ar target-pane
2540 .D1 Pq alias: Ic capturep
2541 Capture the contents of a pane.
2543 .Fl p
2544 is given, the output goes to stdout, otherwise to the buffer specified with
2545 .Fl b
2546 or a new buffer if omitted.
2548 .Fl a
2549 is given, the alternate screen is used, and the history is not accessible.
2550 If no alternate screen exists, an error will be returned unless
2551 .Fl q
2552 is given.
2554 .Fl e
2555 is given, the output includes escape sequences for text and background
2556 attributes.
2557 .Fl C
2558 also escapes non-printable characters as octal \exxx.
2559 .Fl T
2560 ignores trailing positions that do not contain a character.
2561 .Fl N
2562 preserves trailing spaces at each line's end and
2563 .Fl J
2564 preserves trailing spaces and joins any wrapped lines;
2565 .Fl J
2566 implies
2567 .Fl T .
2568 .Fl P
2569 captures only any output that the pane has received that is the beginning of an
2570 as-yet incomplete escape sequence.
2572 .Fl S
2574 .Fl E
2575 specify the starting and ending line numbers, zero is the first line of the
2576 visible pane and negative numbers are lines in the history.
2577 .Ql -
2579 .Fl S
2580 is the start of the history and to
2581 .Fl E
2582 the end of the visible pane.
2583 The default is to capture only the visible contents of the pane.
2584 .It Xo
2585 .Ic choose-client
2586 .Op Fl NryZ
2587 .Op Fl F Ar format
2588 .Op Fl f Ar filter
2589 .Op Fl K Ar key-format
2590 .Op Fl O Ar sort-order
2591 .Op Fl t Ar target-pane
2592 .Op Ar template
2594 Put a pane into client mode, allowing a client to be selected interactively from
2595 a list.
2596 Each client is shown on one line.
2597 A shortcut key is shown on the left in brackets allowing for immediate choice,
2598 or the list may be navigated and an item chosen or otherwise manipulated using
2599 the keys below.
2600 .Fl Z
2601 zooms the pane.
2602 .Fl y
2603 disables any confirmation prompts.
2604 The following keys may be used in client mode:
2605 .Bl -column "Key" "Function" -offset indent
2606 .It Sy "Key" Ta Sy "Function"
2607 .It Li "Enter" Ta "Choose selected client"
2608 .It Li "Up" Ta "Select previous client"
2609 .It Li "Down" Ta "Select next client"
2610 .It Li "C-s" Ta "Search by name"
2611 .It Li "n" Ta "Repeat last search forwards"
2612 .It Li "N" Ta "Repeat last search backwards"
2613 .It Li "t" Ta "Toggle if client is tagged"
2614 .It Li "T" Ta "Tag no clients"
2615 .It Li "C-t" Ta "Tag all clients"
2616 .It Li "d" Ta "Detach selected client"
2617 .It Li "D" Ta "Detach tagged clients"
2618 .It Li "x" Ta "Detach and HUP selected client"
2619 .It Li "X" Ta "Detach and HUP tagged clients"
2620 .It Li "z" Ta "Suspend selected client"
2621 .It Li "Z" Ta "Suspend tagged clients"
2622 .It Li "f" Ta "Enter a format to filter items"
2623 .It Li "O" Ta "Change sort field"
2624 .It Li "r" Ta "Reverse sort order"
2625 .It Li "v" Ta "Toggle preview"
2626 .It Li "q" Ta "Exit mode"
2629 After a client is chosen,
2630 .Ql %%
2631 is replaced by the client name in
2632 .Ar template
2633 and the result executed as a command.
2635 .Ar template
2636 is not given, "detach-client -t \[aq]%%\[aq]" is used.
2638 .Fl O
2639 specifies the initial sort field: one of
2640 .Ql name ,
2641 .Ql size ,
2642 .Ql creation
2643 (time),
2645 .Ql activity
2646 (time).
2647 .Fl r
2648 reverses the sort order.
2649 .Fl f
2650 specifies an initial filter: the filter is a format - if it evaluates to zero,
2651 the item in the list is not shown, otherwise it is shown.
2652 If a filter would lead to an empty list, it is ignored.
2653 .Fl F
2654 specifies the format for each item in the list and
2655 .Fl K
2656 a format for each shortcut key; both are evaluated once for each line.
2657 .Fl N
2658 starts without the preview or if given twice with the larger preview.
2659 This command works only if at least one client is attached.
2660 .It Xo
2661 .Ic choose-tree
2662 .Op Fl GNrswyZ
2663 .Op Fl F Ar format
2664 .Op Fl f Ar filter
2665 .Op Fl K Ar key-format
2666 .Op Fl O Ar sort-order
2667 .Op Fl t Ar target-pane
2668 .Op Ar template
2670 Put a pane into tree mode, where a session, window or pane may be chosen
2671 interactively from a tree.
2672 Each session, window or pane is shown on one line.
2673 A shortcut key is shown on the left in brackets allowing for immediate choice,
2674 or the tree may be navigated and an item chosen or otherwise manipulated using
2675 the keys below.
2676 .Fl s
2677 starts with sessions collapsed and
2678 .Fl w
2679 with windows collapsed.
2680 .Fl Z
2681 zooms the pane.
2682 .Fl y
2683 disables any confirmation prompts.
2684 The following keys may be used in tree mode:
2685 .Bl -column "Key" "Function" -offset indent
2686 .It Sy "Key" Ta Sy "Function"
2687 .It Li "Enter" Ta "Choose selected item"
2688 .It Li "Up" Ta "Select previous item"
2689 .It Li "Down" Ta "Select next item"
2690 .It Li "+" Ta "Expand selected item"
2691 .It Li "-" Ta "Collapse selected item"
2692 .It Li "M-+" Ta "Expand all items"
2693 .It Li "M--" Ta "Collapse all items"
2694 .It Li "x" Ta "Kill selected item"
2695 .It Li "X" Ta "Kill tagged items"
2696 .It Li "<" Ta "Scroll list of previews left"
2697 .It Li ">" Ta "Scroll list of previews right"
2698 .It Li "C-s" Ta "Search by name"
2699 .It Li "m" Ta "Set the marked pane"
2700 .It Li "M" Ta "Clear the marked pane"
2701 .It Li "n" Ta "Repeat last search forwards"
2702 .It Li "N" Ta "Repeat last search backwards"
2703 .It Li "t" Ta "Toggle if item is tagged"
2704 .It Li "T" Ta "Tag no items"
2705 .It Li "C-t" Ta "Tag all items"
2706 .It Li "\&:" Ta "Run a command for each tagged item"
2707 .It Li "f" Ta "Enter a format to filter items"
2708 .It Li "H" Ta "Jump to the starting pane"
2709 .It Li "O" Ta "Change sort field"
2710 .It Li "r" Ta "Reverse sort order"
2711 .It Li "v" Ta "Toggle preview"
2712 .It Li "q" Ta "Exit mode"
2715 After a session, window or pane is chosen, the first instance of
2716 .Ql %%
2717 and all instances of
2718 .Ql %1
2719 are replaced by the target in
2720 .Ar template
2721 and the result executed as a command.
2723 .Ar template
2724 is not given, "switch-client -t \[aq]%%\[aq]" is used.
2726 .Fl O
2727 specifies the initial sort field: one of
2728 .Ql index ,
2729 .Ql name ,
2731 .Ql time
2732 (activity).
2733 .Fl r
2734 reverses the sort order.
2735 .Fl f
2736 specifies an initial filter: the filter is a format - if it evaluates to zero,
2737 the item in the list is not shown, otherwise it is shown.
2738 If a filter would lead to an empty list, it is ignored.
2739 .Fl F
2740 specifies the format for each item in the tree and
2741 .Fl K
2742 a format for each shortcut key; both are evaluated once for each line.
2743 .Fl N
2744 starts without the preview or if given twice with the larger preview.
2745 .Fl G
2746 includes all sessions in any session groups in the tree rather than only the
2747 first.
2748 This command works only if at least one client is attached.
2749 .It Xo
2750 .Ic customize-mode
2751 .Op Fl NZ
2752 .Op Fl F Ar format
2753 .Op Fl f Ar filter
2754 .Op Fl t Ar target-pane
2755 .Op Ar template
2757 Put a pane into customize mode, where options and key bindings may be browsed
2758 and modified from a list.
2759 Option values in the list are shown for the active pane in the current window.
2760 .Fl Z
2761 zooms the pane.
2762 The following keys may be used in customize mode:
2763 .Bl -column "Key" "Function" -offset indent
2764 .It Sy "Key" Ta Sy "Function"
2765 .It Li "Enter" Ta "Set pane, window, session or global option value"
2766 .It Li "Up" Ta "Select previous item"
2767 .It Li "Down" Ta "Select next item"
2768 .It Li "+" Ta "Expand selected item"
2769 .It Li "-" Ta "Collapse selected item"
2770 .It Li "M-+" Ta "Expand all items"
2771 .It Li "M--" Ta "Collapse all items"
2772 .It Li "s" Ta "Set option value or key attribute"
2773 .It Li "S" Ta "Set global option value"
2774 .It Li "w" Ta "Set window option value, if option is for pane and window"
2775 .It Li "d" Ta "Set an option or key to the default"
2776 .It Li "D" Ta "Set tagged options and tagged keys to the default"
2777 .It Li "u" Ta "Unset an option (set to default value if global) or unbind a key"
2778 .It Li "U" Ta "Unset tagged options and unbind tagged keys"
2779 .It Li "C-s" Ta "Search by name"
2780 .It Li "n" Ta "Repeat last search forwards"
2781 .It Li "N" Ta "Repeat last search backwards"
2782 .It Li "t" Ta "Toggle if item is tagged"
2783 .It Li "T" Ta "Tag no items"
2784 .It Li "C-t" Ta "Tag all items"
2785 .It Li "f" Ta "Enter a format to filter items"
2786 .It Li "v" Ta "Toggle option information"
2787 .It Li "q" Ta "Exit mode"
2790 .Fl f
2791 specifies an initial filter: the filter is a format - if it evaluates to zero,
2792 the item in the list is not shown, otherwise it is shown.
2793 If a filter would lead to an empty list, it is ignored.
2794 .Fl F
2795 specifies the format for each item in the tree.
2796 .Fl N
2797 starts without the option information.
2798 This command works only if at least one client is attached.
2799 .It Xo
2800 .Tg displayp
2801 .Ic display-panes
2802 .Op Fl bN
2803 .Op Fl d Ar duration
2804 .Op Fl t Ar target-client
2805 .Op Ar template
2807 .D1 Pq alias: Ic displayp
2808 Display a visible indicator of each pane shown by
2809 .Ar target-client .
2810 See the
2811 .Ic display-panes-colour
2813 .Ic display-panes-active-colour
2814 session options.
2815 The indicator is closed when a key is pressed (unless
2816 .Fl N
2817 is given) or
2818 .Ar duration
2819 milliseconds have passed.
2821 .Fl d
2822 is not given,
2823 .Ic display-panes-time
2824 is used.
2825 A duration of zero means the indicator stays until a key is pressed.
2826 While the indicator is on screen, a pane may be chosen with the
2827 .Ql 0
2829 .Ql 9
2830 keys, which will cause
2831 .Ar template
2832 to be executed as a command with
2833 .Ql %%
2834 substituted by the pane ID.
2835 The default
2836 .Ar template
2837 is "select-pane -t \[aq]%%\[aq]".
2838 With
2839 .Fl b ,
2840 other commands are not blocked from running until the indicator is closed.
2841 .Tg findw
2842 .It Xo Ic find-window
2843 .Op Fl iCNrTZ
2844 .Op Fl t Ar target-pane
2845 .Ar match-string
2847 .D1 Pq alias: Ic findw
2848 Search for a
2849 .Xr fnmatch 3
2850 pattern or, with
2851 .Fl r ,
2852 regular expression
2853 .Ar match-string
2854 in window names, titles, and visible content (but not history).
2855 The flags control matching behavior:
2856 .Fl C
2857 matches only visible window contents,
2858 .Fl N
2859 matches only the window name and
2860 .Fl T
2861 matches only the window title.
2862 .Fl i
2863 makes the search ignore case.
2864 The default is
2865 .Fl CNT .
2866 .Fl Z
2867 zooms the pane.
2869 This command works only if at least one client is attached.
2870 .Tg joinp
2871 .It Xo Ic join-pane
2872 .Op Fl bdfhv
2873 .Op Fl l Ar size
2874 .Op Fl s Ar src-pane
2875 .Op Fl t Ar dst-pane
2877 .D1 Pq alias: Ic joinp
2878 Like
2879 .Ic split-window ,
2880 but instead of splitting
2881 .Ar dst-pane
2882 and creating a new pane, split it and move
2883 .Ar src-pane
2884 into the space.
2885 This can be used to reverse
2886 .Ic break-pane .
2888 .Fl b
2889 option causes
2890 .Ar src-pane
2891 to be joined to left of or above
2892 .Ar dst-pane .
2895 .Fl s
2896 is omitted and a marked pane is present (see
2897 .Ic select-pane
2898 .Fl m ) ,
2899 the marked pane is used rather than the current pane.
2900 .Tg killp
2901 .It Xo Ic kill-pane
2902 .Op Fl a
2903 .Op Fl t Ar target-pane
2905 .D1 Pq alias: Ic killp
2906 Destroy the given pane.
2907 If no panes remain in the containing window, it is also destroyed.
2909 .Fl a
2910 option kills all but the pane given with
2911 .Fl t .
2912 .Tg killw
2913 .It Xo Ic kill-window
2914 .Op Fl a
2915 .Op Fl t Ar target-window
2917 .D1 Pq alias: Ic killw
2918 Kill the current window or the window at
2919 .Ar target-window ,
2920 removing it from any sessions to which it is linked.
2922 .Fl a
2923 option kills all but the window given with
2924 .Fl t .
2925 .Tg lastp
2926 .It Xo Ic last-pane
2927 .Op Fl deZ
2928 .Op Fl t Ar target-window
2930 .D1 Pq alias: Ic lastp
2931 Select the last (previously selected) pane.
2932 .Fl Z
2933 keeps the window zoomed if it was zoomed.
2934 .Fl e
2935 enables or
2936 .Fl d
2937 disables input to the pane.
2938 .Tg last
2939 .It Ic last-window Op Fl t Ar target-session
2940 .D1 Pq alias: Ic last
2941 Select the last (previously selected) window.
2942 If no
2943 .Ar target-session
2944 is specified, select the last window of the current session.
2945 .Tg link
2946 .It Xo Ic link-window
2947 .Op Fl abdk
2948 .Op Fl s Ar src-window
2949 .Op Fl t Ar dst-window
2951 .D1 Pq alias: Ic linkw
2952 Link the window at
2953 .Ar src-window
2954 to the specified
2955 .Ar dst-window .
2957 .Ar dst-window
2958 is specified and no such window exists, the
2959 .Ar src-window
2960 is linked there.
2961 With
2962 .Fl a
2964 .Fl b
2965 the window is moved to the next index after or before
2966 .Ar dst-window
2967 (existing windows are moved if necessary).
2969 .Fl k
2970 is given and
2971 .Ar dst-window
2972 exists, it is killed, otherwise an error is generated.
2974 .Fl d
2975 is given, the newly linked window is not selected.
2976 .Tg lsp
2977 .It Xo Ic list-panes
2978 .Op Fl as
2979 .Op Fl F Ar format
2980 .Op Fl f Ar filter
2981 .Op Fl t Ar target
2983 .D1 Pq alias: Ic lsp
2985 .Fl a
2986 is given,
2987 .Ar target
2988 is ignored and all panes on the server are listed.
2990 .Fl s
2991 is given,
2992 .Ar target
2993 is a session (or the current session).
2994 If neither is given,
2995 .Ar target
2996 is a window (or the current window).
2997 .Fl F
2998 specifies the format of each line and
2999 .Fl f
3000 a filter.
3001 Only panes for which the filter is true are shown.
3002 See the
3003 .Sx FORMATS
3004 section.
3005 .Tg lsw
3006 .It Xo Ic list-windows
3007 .Op Fl a
3008 .Op Fl F Ar format
3009 .Op Fl f Ar filter
3010 .Op Fl t Ar target-session
3012 .D1 Pq alias: Ic lsw
3014 .Fl a
3015 is given, list all windows on the server.
3016 Otherwise, list windows in the current session or in
3017 .Ar target-session .
3018 .Fl F
3019 specifies the format of each line and
3020 .Fl f
3021 a filter.
3022 Only windows for which the filter is true are shown.
3023 See the
3024 .Sx FORMATS
3025 section.
3026 .Tg movep
3027 .It Xo Ic move-pane
3028 .Op Fl bdfhv
3029 .Op Fl l Ar size
3030 .Op Fl s Ar src-pane
3031 .Op Fl t Ar dst-pane
3033 .D1 Pq alias: Ic movep
3034 Does the same as
3035 .Ic join-pane .
3036 .Tg movew
3037 .It Xo Ic move-window
3038 .Op Fl abrdk
3039 .Op Fl s Ar src-window
3040 .Op Fl t Ar dst-window
3042 .D1 Pq alias: Ic movew
3043 This is similar to
3044 .Ic link-window ,
3045 except the window at
3046 .Ar src-window
3047 is moved to
3048 .Ar dst-window .
3049 With
3050 .Fl r ,
3051 all windows in the session are renumbered in sequential order, respecting
3053 .Ic base-index
3054 option.
3055 .Tg neww
3056 .It Xo Ic new-window
3057 .Op Fl abdkPS
3058 .Op Fl c Ar start-directory
3059 .Op Fl e Ar environment
3060 .Op Fl F Ar format
3061 .Op Fl n Ar window-name
3062 .Op Fl t Ar target-window
3063 .Op Ar shell-command
3065 .D1 Pq alias: Ic neww
3066 Create a new window.
3067 With
3068 .Fl a
3070 .Fl b ,
3071 the new window is inserted at the next index after or before the specified
3072 .Ar target-window ,
3073 moving windows up if necessary;
3074 otherwise
3075 .Ar target-window
3076 is the new window location.
3079 .Fl d
3080 is given, the session does not make the new window the current window.
3081 .Ar target-window
3082 represents the window to be created; if the target already exists an error is
3083 shown, unless the
3084 .Fl k
3085 flag is used, in which case it is destroyed.
3087 .Fl S
3088 is given and a window named
3089 .Ar window-name
3090 already exists, it is selected (unless
3091 .Fl d
3092 is also given in which case the command does nothing).
3094 .Ar shell-command
3095 is the command to execute.
3097 .Ar shell-command
3098 is not specified, the value of the
3099 .Ic default-command
3100 option is used.
3101 .Fl c
3102 specifies the working directory in which the new window is created.
3104 When the shell command completes, the window closes.
3105 See the
3106 .Ic remain-on-exit
3107 option to change this behaviour.
3109 .Fl e
3110 takes the form
3111 .Ql VARIABLE=value
3112 and sets an environment variable for the newly created window; it may be
3113 specified multiple times.
3116 .Ev TERM
3117 environment variable must be set to
3118 .Ql screen
3120 .Ql tmux
3121 for all programs running
3122 .Em inside
3123 .Nm .
3124 New windows will automatically have
3125 .Ql TERM=screen
3126 added to their environment, but care must be taken not to reset this in shell
3127 start-up files or by the
3128 .Fl e
3129 option.
3132 .Fl P
3133 option prints information about the new window after it has been created.
3134 By default, it uses the format
3135 .Ql #{session_name}:#{window_index}
3136 but a different format may be specified with
3137 .Fl F .
3138 .Tg nextl
3139 .It Ic next-layout Op Fl t Ar target-window
3140 .D1 Pq alias: Ic nextl
3141 Move a window to the next layout and rearrange the panes to fit.
3142 .Tg next
3143 .It Xo Ic next-window
3144 .Op Fl a
3145 .Op Fl t Ar target-session
3147 .D1 Pq alias: Ic next
3148 Move to the next window in the session.
3150 .Fl a
3151 is used, move to the next window with an alert.
3152 .Tg pipep
3153 .It Xo Ic pipe-pane
3154 .Op Fl IOo
3155 .Op Fl t Ar target-pane
3156 .Op Ar shell-command
3158 .D1 Pq alias: Ic pipep
3159 Pipe output sent by the program in
3160 .Ar target-pane
3161 to a shell command or vice versa.
3162 A pane may only be connected to one command at a time, any existing pipe is
3163 closed before
3164 .Ar shell-command
3165 is executed.
3167 .Ar shell-command
3168 string may contain the special character sequences supported by the
3169 .Ic status-left
3170 option.
3171 If no
3172 .Ar shell-command
3173 is given, the current pipe (if any) is closed.
3175 .Fl I
3177 .Fl O
3178 specify which of the
3179 .Ar shell-command
3180 output streams are connected to the pane:
3181 with
3182 .Fl I
3183 stdout is connected (so anything
3184 .Ar shell-command
3185 prints is written to the pane as if it were typed);
3186 with
3187 .Fl O
3188 stdin is connected (so any output in the pane is piped to
3189 .Ar shell-command ) .
3190 Both may be used together and if neither are specified,
3191 .Fl O
3192 is used.
3195 .Fl o
3196 option only opens a new pipe if no previous pipe exists, allowing a pipe to
3197 be toggled with a single key, for example:
3198 .Bd -literal -offset indent
3199 bind-key C-p pipe-pane -o \[aq]cat >>\[ti]/output.#I-#P\[aq]
3201 .Tg prevl
3202 .It Xo Ic previous-layout
3203 .Op Fl t Ar target-window
3205 .D1 Pq alias: Ic prevl
3206 Move to the previous layout in the session.
3207 .Tg prev
3208 .It Xo Ic previous-window
3209 .Op Fl a
3210 .Op Fl t Ar target-session
3212 .D1 Pq alias: Ic prev
3213 Move to the previous window in the session.
3214 With
3215 .Fl a ,
3216 move to the previous window with an alert.
3217 .Tg renamew
3218 .It Xo Ic rename-window
3219 .Op Fl t Ar target-window
3220 .Ar new-name
3222 .D1 Pq alias: Ic renamew
3223 Rename the current window, or the window at
3224 .Ar target-window
3225 if specified, to
3226 .Ar new-name .
3227 .Tg resizep
3228 .It Xo Ic resize-pane
3229 .Op Fl DLMRTUZ
3230 .Op Fl t Ar target-pane
3231 .Op Fl x Ar width
3232 .Op Fl y Ar height
3233 .Op Ar adjustment
3235 .D1 Pq alias: Ic resizep
3236 Resize a pane, up, down, left or right by
3237 .Ar adjustment
3238 with
3239 .Fl U ,
3240 .Fl D ,
3241 .Fl L
3243 .Fl R ,
3245 to an absolute size
3246 with
3247 .Fl x
3249 .Fl y .
3251 .Ar adjustment
3252 is given in lines or columns (the default is 1);
3253 .Fl x
3255 .Fl y
3256 may be a given as a number of lines or columns or followed by
3257 .Ql %
3258 for a percentage of the window size (for example
3259 .Ql -x 10% ) .
3260 With
3261 .Fl Z ,
3262 the active pane is toggled between zoomed (occupying the whole of the window)
3263 and unzoomed (its normal position in the layout).
3265 .Fl M
3266 begins mouse resizing (only valid if bound to a mouse key binding, see
3267 .Sx MOUSE SUPPORT ) .
3269 .Fl T
3270 trims all lines below the current cursor position and moves lines out of the
3271 history to replace them.
3272 .Tg resizew
3273 .It Xo Ic resize-window
3274 .Op Fl aADLRU
3275 .Op Fl t Ar target-window
3276 .Op Fl x Ar width
3277 .Op Fl y Ar height
3278 .Op Ar adjustment
3280 .D1 Pq alias: Ic resizew
3281 Resize a window, up, down, left or right by
3282 .Ar adjustment
3283 with
3284 .Fl U ,
3285 .Fl D ,
3286 .Fl L
3288 .Fl R ,
3290 to an absolute size
3291 with
3292 .Fl x
3294 .Fl y .
3296 .Ar adjustment
3297 is given in lines or cells (the default is 1).
3298 .Fl A
3299 sets the size of the largest session containing the window;
3300 .Fl a
3301 the size of the smallest.
3302 This command will automatically set
3303 .Ic window-size
3304 to manual in the window options.
3305 .Tg respawnp
3306 .It Xo Ic respawn-pane
3307 .Op Fl k
3308 .Op Fl c Ar start-directory
3309 .Op Fl e Ar environment
3310 .Op Fl t Ar target-pane
3311 .Op Ar shell-command
3313 .D1 Pq alias: Ic respawnp
3314 Reactivate a pane in which the command has exited (see the
3315 .Ic remain-on-exit
3316 window option).
3318 .Ar shell-command
3319 is not given, the command used when the pane was created or last respawned is
3320 executed.
3321 The pane must be already inactive, unless
3322 .Fl k
3323 is given, in which case any existing command is killed.
3324 .Fl c
3325 specifies a new working directory for the pane.
3327 .Fl e
3328 option has the same meaning as for the
3329 .Ic new-window
3330 command.
3331 .Tg respawnw
3332 .It Xo Ic respawn-window
3333 .Op Fl k
3334 .Op Fl c Ar start-directory
3335 .Op Fl e Ar environment
3336 .Op Fl t Ar target-window
3337 .Op Ar shell-command
3339 .D1 Pq alias: Ic respawnw
3340 Reactivate a window in which the command has exited (see the
3341 .Ic remain-on-exit
3342 window option).
3344 .Ar shell-command
3345 is not given, the command used when the window was created or last respawned is
3346 executed.
3347 The window must be already inactive, unless
3348 .Fl k
3349 is given, in which case any existing command is killed.
3350 .Fl c
3351 specifies a new working directory for the window.
3353 .Fl e
3354 option has the same meaning as for the
3355 .Ic new-window
3356 command.
3357 .Tg rotatew
3358 .It Xo Ic rotate-window
3359 .Op Fl DUZ
3360 .Op Fl t Ar target-window
3362 .D1 Pq alias: Ic rotatew
3363 Rotate the positions of the panes within a window, either upward (numerically
3364 lower) with
3365 .Fl U
3366 or downward (numerically higher).
3367 .Fl Z
3368 keeps the window zoomed if it was zoomed.
3369 .Tg selectl
3370 .It Xo Ic select-layout
3371 .Op Fl Enop
3372 .Op Fl t Ar target-pane
3373 .Op Ar layout-name
3375 .D1 Pq alias: Ic selectl
3376 Choose a specific layout for a window.
3378 .Ar layout-name
3379 is not given, the last preset layout used (if any) is reapplied.
3380 .Fl n
3382 .Fl p
3383 are equivalent to the
3384 .Ic next-layout
3386 .Ic previous-layout
3387 commands.
3388 .Fl o
3389 applies the last set layout if possible (undoes the most recent layout change).
3390 .Fl E
3391 spreads the current pane and any panes next to it out evenly.
3392 .Tg selectp
3393 .It Xo Ic select-pane
3394 .Op Fl DdeLlMmRUZ
3395 .Op Fl T Ar title
3396 .Op Fl t Ar target-pane
3398 .D1 Pq alias: Ic selectp
3399 Make pane
3400 .Ar target-pane
3401 the active pane in its window.
3402 If one of
3403 .Fl D ,
3404 .Fl L ,
3405 .Fl R ,
3407 .Fl U
3408 is used, respectively the pane below, to the left, to the right, or above the
3409 target pane is used.
3410 .Fl Z
3411 keeps the window zoomed if it was zoomed.
3412 .Fl l
3413 is the same as using the
3414 .Ic last-pane
3415 command.
3416 .Fl e
3417 enables or
3418 .Fl d
3419 disables input to the pane.
3420 .Fl T
3421 sets the pane title.
3423 .Fl m
3425 .Fl M
3426 are used to set and clear the
3427 .Em marked pane .
3428 There is one marked pane at a time, setting a new marked pane clears the last.
3429 The marked pane is the default target for
3430 .Fl s
3432 .Ic join-pane ,
3433 .Ic move-pane ,
3434 .Ic swap-pane
3436 .Ic swap-window .
3437 .Tg selectw
3438 .It Xo Ic select-window
3439 .Op Fl lnpT
3440 .Op Fl t Ar target-window
3442 .D1 Pq alias: Ic selectw
3443 Select the window at
3444 .Ar target-window .
3445 .Fl l ,
3446 .Fl n
3448 .Fl p
3449 are equivalent to the
3450 .Ic last-window ,
3451 .Ic next-window
3453 .Ic previous-window
3454 commands.
3456 .Fl T
3457 is given and the selected window is already the current window,
3458 the command behaves like
3459 .Ic last-window .
3460 .Tg splitw
3461 .It Xo Ic split-window
3462 .Op Fl bdfhIvPZ
3463 .Op Fl c Ar start-directory
3464 .Op Fl e Ar environment
3465 .Op Fl l Ar size
3466 .Op Fl t Ar target-pane
3467 .Op Ar shell-command
3468 .Op Fl F Ar format
3470 .D1 Pq alias: Ic splitw
3471 Create a new pane by splitting
3472 .Ar target-pane :
3473 .Fl h
3474 does a horizontal split and
3475 .Fl v
3476 a vertical split; if neither is specified,
3477 .Fl v
3478 is assumed.
3480 .Fl l
3481 option specifies the size of the new pane in lines (for vertical split) or in
3482 columns (for horizontal split);
3483 .Ar size
3484 may be followed by
3485 .Ql %
3486 to specify a percentage of the available space.
3488 .Fl b
3489 option causes the new pane to be created to the left of or above
3490 .Ar target-pane .
3492 .Fl f
3493 option creates a new pane spanning the full window height (with
3494 .Fl h )
3495 or full window width (with
3496 .Fl v ) ,
3497 instead of splitting the active pane.
3498 .Fl Z
3499 zooms if the window is not zoomed, or keeps it zoomed if already zoomed.
3501 An empty
3502 .Ar shell-command
3503 (\[aq]\[aq]) will create a pane with no command running in it.
3504 Output can be sent to such a pane with the
3505 .Ic display-message
3506 command.
3508 .Fl I
3509 flag (if
3510 .Ar shell-command
3511 is not specified or empty)
3512 will create an empty pane and forward any output from stdin to it.
3513 For example:
3514 .Bd -literal -offset indent
3515 $ make 2>&1|tmux splitw -dI &
3518 All other options have the same meaning as for the
3519 .Ic new-window
3520 command.
3521 .Tg swapp
3522 .It Xo Ic swap-pane
3523 .Op Fl dDUZ
3524 .Op Fl s Ar src-pane
3525 .Op Fl t Ar dst-pane
3527 .D1 Pq alias: Ic swapp
3528 Swap two panes.
3530 .Fl U
3531 is used and no source pane is specified with
3532 .Fl s ,
3533 .Ar dst-pane
3534 is swapped with the previous pane (before it numerically);
3535 .Fl D
3536 swaps with the next pane (after it numerically).
3537 .Fl d
3538 instructs
3540 not to change the active pane and
3541 .Fl Z
3542 keeps the window zoomed if it was zoomed.
3545 .Fl s
3546 is omitted and a marked pane is present (see
3547 .Ic select-pane
3548 .Fl m ) ,
3549 the marked pane is used rather than the current pane.
3550 .Tg swapw
3551 .It Xo Ic swap-window
3552 .Op Fl d
3553 .Op Fl s Ar src-window
3554 .Op Fl t Ar dst-window
3556 .D1 Pq alias: Ic swapw
3557 This is similar to
3558 .Ic link-window ,
3559 except the source and destination windows are swapped.
3560 It is an error if no window exists at
3561 .Ar src-window .
3563 .Fl d
3564 is given, the new window does not become the current window.
3567 .Fl s
3568 is omitted and a marked pane is present (see
3569 .Ic select-pane
3570 .Fl m ) ,
3571 the window containing the marked pane is used rather than the current window.
3572 .Tg unlinkw
3573 .It Xo Ic unlink-window
3574 .Op Fl k
3575 .Op Fl t Ar target-window
3577 .D1 Pq alias: Ic unlinkw
3578 Unlink
3579 .Ar target-window .
3580 Unless
3581 .Fl k
3582 is given, a window may be unlinked only if it is linked to multiple sessions -
3583 windows may not be linked to no sessions;
3585 .Fl k
3586 is specified and the window is linked to only one session, it is unlinked and
3587 destroyed.
3589 .Sh KEY BINDINGS
3591 allows a command to be bound to most keys, with or without a prefix key.
3592 When specifying keys, most represent themselves (for example
3593 .Ql A
3595 .Ql Z ) .
3596 Ctrl keys may be prefixed with
3597 .Ql C-
3599 .Ql ^ ,
3600 Shift keys with
3601 .Ql S-
3602 and Alt (meta) with
3603 .Ql M- .
3604 In addition, the following special key names are accepted:
3605 .Em Up ,
3606 .Em Down ,
3607 .Em Left ,
3608 .Em Right ,
3609 .Em BSpace ,
3610 .Em BTab ,
3611 .Em DC
3612 (Delete),
3613 .Em End ,
3614 .Em Enter ,
3615 .Em Escape ,
3616 .Em F1
3618 .Em F12 ,
3619 .Em Home ,
3620 .Em IC
3621 (Insert),
3622 .Em NPage/PageDown/PgDn ,
3623 .Em PPage/PageUp/PgUp ,
3624 .Em Space ,
3626 .Em Tab .
3627 Note that to bind the
3628 .Ql \&"
3630 .Ql \[aq]
3631 keys, quotation marks are necessary, for example:
3632 .Bd -literal -offset indent
3633 bind-key \[aq]"\[aq] split-window
3634 bind-key "\[aq]" new-window
3637 A command bound to the
3638 .Em Any
3639 key will execute for all keys which do not have a more specific binding.
3641 Commands related to key bindings are as follows:
3642 .Bl -tag -width Ds
3643 .Tg bind
3644 .It Xo Ic bind-key
3645 .Op Fl nr
3646 .Op Fl N Ar note
3647 .Op Fl T Ar key-table
3648 .Ar key command Op Ar argument ...
3650 .D1 Pq alias: Ic bind
3651 Bind key
3652 .Ar key
3654 .Ar command .
3655 Keys are bound in a key table.
3656 By default (without -T), the key is bound in
3658 .Em prefix
3659 key table.
3660 This table is used for keys pressed after the prefix key (for example,
3661 by default
3662 .Ql c
3663 is bound to
3664 .Ic new-window
3665 in the
3666 .Em prefix
3667 table, so
3668 .Ql C-b c
3669 creates a new window).
3671 .Em root
3672 table is used for keys pressed without the prefix key: binding
3673 .Ql c
3675 .Ic new-window
3676 in the
3677 .Em root
3678 table (not recommended) means a plain
3679 .Ql c
3680 will create a new window.
3681 .Fl n
3682 is an alias
3684 .Fl T Ar root .
3685 Keys may also be bound in custom key tables and the
3686 .Ic switch-client
3687 .Fl T
3688 command used to switch to them from a key binding.
3690 .Fl r
3691 flag indicates this key may repeat, see the
3692 .Ic initial-repeat-time
3694 .Ic repeat-time
3695 options.
3696 .Fl N
3697 attaches a note to the key (shown with
3698 .Ic list-keys
3699 .Fl N ) .
3701 To view the default bindings and possible commands, see the
3702 .Ic list-keys
3703 command.
3704 .Tg lsk
3705 .It Xo Ic list-keys
3706 .Op Fl 1aN
3707 .Op Fl P Ar prefix-string Fl T Ar key-table
3708 .Op Ar key
3710 .D1 Pq alias: Ic lsk
3711 List key bindings.
3712 There are two forms: the default lists keys as
3713 .Ic bind-key
3714 commands;
3715 .Fl N
3716 lists only keys with attached notes and shows only the key and note for each
3717 key.
3719 With the default form, all key tables are listed by default.
3720 .Fl T
3721 lists only keys in
3722 .Ar key-table .
3724 With the
3725 .Fl N
3726 form, only keys in the
3727 .Em root
3729 .Em prefix
3730 key tables are listed by default;
3731 .Fl T
3732 also lists only keys in
3733 .Ar key-table .
3734 .Fl P
3735 specifies a prefix to print before each key and
3736 .Fl 1
3737 lists only the first matching key.
3738 .Fl a
3739 lists the command for keys that do not have a note rather than skipping them.
3740 .Tg send
3741 .It Xo Ic send-keys
3742 .Op Fl FHKlMRX
3743 .Op Fl c Ar target-client
3744 .Op Fl N Ar repeat-count
3745 .Op Fl t Ar target-pane
3746 .Ar key ...
3748 .D1 Pq alias: Ic send
3749 Send a key or keys to a window or client.
3750 Each argument
3751 .Ar key
3752 is the name of the key (such as
3753 .Ql C-a
3755 .Ql NPage )
3756 to send; if the string is not recognised as a key, it is sent as a series of
3757 characters.
3759 .Fl K
3760 is given, keys are sent to
3761 .Ar target-client ,
3762 so they are looked up in the client's key table, rather than to
3763 .Ar target-pane .
3764 All arguments are sent sequentially from first to last.
3765 If no keys are given and the command is bound to a key, then that key is used.
3768 .Fl l
3769 flag disables key name lookup and processes the keys as literal UTF-8
3770 characters.
3772 .Fl H
3773 flag expects each key to be a hexadecimal number for an ASCII character.
3776 .Fl R
3777 flag causes the terminal state to be reset.
3779 .Fl M
3780 passes through a mouse event (only valid if bound to a mouse key binding, see
3781 .Sx MOUSE SUPPORT ) .
3783 .Fl X
3784 is used to send a command into copy mode - see
3786 .Sx WINDOWS AND PANES
3787 section.
3788 .Fl N
3789 specifies a repeat count and
3790 .Fl F
3791 expands formats in arguments where appropriate.
3792 .It Xo Ic send-prefix
3793 .Op Fl 2
3794 .Op Fl t Ar target-pane
3796 Send the prefix key, or with
3797 .Fl 2
3798 the secondary prefix key, to a window as if it was pressed.
3799 .Tg unbind
3800 .It Xo Ic unbind-key
3801 .Op Fl anq
3802 .Op Fl T Ar key-table
3803 .Ar key
3805 .D1 Pq alias: Ic unbind
3806 Unbind the command bound to
3807 .Ar key .
3808 .Fl n
3810 .Fl T
3811 are the same as for
3812 .Ic bind-key .
3814 .Fl a
3815 is present, all key bindings are removed.
3817 .Fl q
3818 option prevents errors being returned.
3820 .Sh OPTIONS
3821 The appearance and behaviour of
3823 may be modified by changing the value of various options.
3824 There are four types of option:
3825 .Em server options ,
3826 .Em session options ,
3827 .Em window options ,
3829 .Em pane options .
3833 server has a set of global server options which do not apply to any particular
3834 window or session or pane.
3835 These are altered with the
3836 .Ic set-option
3837 .Fl s
3838 command, or displayed with the
3839 .Ic show-options
3840 .Fl s
3841 command.
3843 In addition, each individual session may have a set of session options, and
3844 there is a separate set of global session options.
3845 Sessions which do not have a particular option configured inherit the value
3846 from the global session options.
3847 Session options are set or unset with the
3848 .Ic set-option
3849 command and may be listed with the
3850 .Ic show-options
3851 command.
3852 The available server and session options are listed under the
3853 .Ic set-option
3854 command.
3856 Similarly, a set of window options is attached to each window and a set of pane
3857 options to each pane.
3858 Pane options inherit from window options.
3859 This means any pane option may be set as a window option to apply the option to
3860 all panes in the window without the option set, for example these commands will
3861 set the background colour to red for all panes except pane 0:
3862 .Bd -literal -offset indent
3863 set -w window-style bg=red
3864 set -pt:.0 window-style bg=blue
3867 There is also a set of global window options from which any unset window or
3868 pane options are inherited.
3869 Window and pane options are altered with
3870 .Ic set-option
3871 .Fl w
3873 .Fl p
3874 commands and displayed with
3875 .Ic show-option
3876 .Fl w
3878 .Fl p .
3881 also supports user options which are prefixed with a
3882 .Ql \&@ .
3883 User options may have any name, so long as they are prefixed with
3884 .Ql \&@ ,
3885 and be set to any string.
3886 For example:
3887 .Bd -literal -offset indent
3888 $ tmux set -wq @foo "abc123"
3889 $ tmux show -wv @foo
3890 abc123
3893 Commands which set options are as follows:
3894 .Bl -tag -width Ds
3895 .Tg set
3896 .It Xo Ic set-option
3897 .Op Fl aFgopqsuUw
3898 .Op Fl t Ar target-pane
3899 .Ar option Ar value
3901 .D1 Pq alias: Ic set
3902 Set a pane option with
3903 .Fl p ,
3904 a window option with
3905 .Fl w ,
3906 a server option with
3907 .Fl s ,
3908 otherwise a session option.
3909 If the option is not a user option,
3910 .Fl w
3912 .Fl s
3913 may be unnecessary -
3915 will infer the type from the option name, assuming
3916 .Fl w
3917 for pane options.
3919 .Fl g
3920 is given, the global session or window option is set.
3922 .Fl F
3923 expands formats in the option value.
3925 .Fl u
3926 flag unsets an option, so a session inherits the option from the global
3927 options (or with
3928 .Fl g ,
3929 restores a global option to the default).
3930 .Fl U
3931 unsets an option (like
3932 .Fl u )
3933 but if the option is a pane option also unsets the option on any panes in the
3934 window.
3935 .Ar value
3936 depends on the option and may be a number, a string, or a flag (on, off, or
3937 omitted to toggle).
3940 .Fl o
3941 flag prevents setting an option that is already set and the
3942 .Fl q
3943 flag suppresses errors about unknown or ambiguous options.
3945 With
3946 .Fl a ,
3947 and if the option expects a string or a style,
3948 .Ar value
3949 is appended to the existing setting.
3950 For example:
3951 .Bd -literal -offset indent
3952 set -g status-left "foo"
3953 set -ag status-left "bar"
3956 Will result in
3957 .Ql foobar .
3958 And:
3959 .Bd -literal -offset indent
3960 set -g status-style "bg=red"
3961 set -ag status-style "fg=blue"
3964 Will result in a red background
3965 .Em and
3966 blue foreground.
3967 Without
3968 .Fl a ,
3969 the result would be the default background and a blue foreground.
3970 .Tg show
3971 .It Xo Ic show-options
3972 .Op Fl AgHpqsvw
3973 .Op Fl t Ar target-pane
3974 .Op Ar option
3976 .D1 Pq alias: Ic show
3977 Show the pane options (or a single option if
3978 .Ar option
3979 is provided) with
3980 .Fl p ,
3981 the window options with
3982 .Fl w ,
3983 the server options with
3984 .Fl s ,
3985 otherwise the session options.
3986 If the option is not a user option,
3987 .Fl w
3989 .Fl s
3990 may be unnecessary -
3992 will infer the type from the option name, assuming
3993 .Fl w
3994 for pane options.
3995 Global session or window options are listed if
3996 .Fl g
3997 is used.
3998 .Fl v
3999 shows only the option value, not the name.
4001 .Fl q
4002 is set, no error will be returned if
4003 .Ar option
4004 is unset.
4005 .Fl H
4006 includes hooks (omitted by default).
4007 .Fl A
4008 includes options inherited from a parent set of options, such options are
4009 marked with an asterisk.
4012 Available server options are:
4013 .Bl -tag -width Ds
4014 .It Ic backspace Ar key
4015 Set the key sent by
4017 for backspace.
4018 .It Ic buffer-limit Ar number
4019 Set the number of buffers; as new buffers are added to the top of the stack,
4020 old ones are removed from the bottom if necessary to maintain this maximum
4021 length.
4022 .It Xo Ic command-alias[]
4023 .Ar name=value
4025 This is an array of custom aliases for commands.
4026 If an unknown command matches
4027 .Ar name ,
4028 it is replaced with
4029 .Ar value .
4030 For example, after:
4032 .Dl set -s command-alias[100] zoom=\[aq]resize-pane -Z\[aq]
4034 Using:
4036 .Dl zoom -t:.1
4038 Is equivalent to:
4040 .Dl resize-pane -Z -t:.1
4042 Note that aliases are expanded when a command is parsed rather than when it is
4043 executed, so binding an alias with
4044 .Ic bind-key
4045 will bind the expanded form.
4046 .It Ic copy-command Ar shell-command
4047 Give the command to pipe to if the
4048 .Ic copy-pipe
4049 copy mode command is used without arguments.
4050 .It Ic default-terminal Ar terminal
4051 Set the default terminal for new windows created in this session - the
4052 default value of the
4053 .Ev TERM
4054 environment variable.
4057 to work correctly, this
4058 .Em must
4059 be set to
4060 .Ql screen ,
4061 .Ql tmux
4062 or a derivative of them.
4063 .It Ic escape-time Ar time
4064 Set the time in milliseconds for which
4066 waits after an escape is input to determine if it is part of a function or meta
4067 key sequences.
4068 .It Ic editor Ar shell-command
4069 Set the command used when
4071 runs an editor.
4072 .It Xo Ic exit-empty
4073 .Op Ic on | off
4075 If enabled (the default), the server will exit when there are no active
4076 sessions.
4077 .It Xo Ic exit-unattached
4078 .Op Ic on | off
4080 If enabled, the server will exit when there are no attached clients.
4081 .It Xo Ic extended-keys
4082 .Op Ic on | off | always
4084 Controls how modified keys (keys pressed together with Control, Meta, or Shift)
4085 are reported.
4086 This is the equivalent of the
4087 .Ic modifyOtherKeys
4088 .Xr xterm 1
4089 resource.
4091 When set to
4092 .Ic on ,
4093 the program inside the pane can request one of two modes: mode 1 which changes
4094 the sequence for only keys which lack an existing well-known representation; or
4095 mode 2 which changes the sequence for all keys.
4096 When set to
4097 .Ic always ,
4098 modes 1 and 2 can still be requested by applications, but mode 1 will be forced
4099 instead of the standard mode.
4100 When set to
4101 .Ic off ,
4102 this feature is disabled and only standard keys are reported.
4105 will always request extended keys itself if the terminal supports them.
4106 See also the
4107 .Ic extkeys
4108 feature for the
4109 .Ic terminal-features
4110 option, the
4111 .Ic extended-keys-format
4112 option and the
4113 .Ic pane_key_mode
4114 variable.
4115 .It Xo Ic extended-keys-format
4116 .Op Ic csi-u | xterm
4118 Selects one of the two possible formats for reporting modified keys to
4119 applications.
4120 This is the equivalent of the
4121 .Ic formatOtherKeys
4122 .Xr xterm 1
4123 resource.
4124 For example, C-S-a will be reported as
4125 .Ql ^[[27;6;65~
4126 when set to
4127 .Ic xterm ,
4128 and as
4129 .Ql ^[[65;6u
4130 when set to
4131 .Ic csi-u .
4132 .It Xo Ic focus-events
4133 .Op Ic on | off
4135 When enabled, focus events are requested from the terminal if supported and
4136 passed through to applications running in
4137 .Nm .
4138 Attached clients should be detached and attached again after changing this
4139 option.
4140 .It Ic history-file Ar path
4141 If not empty, a file to which
4143 will write command prompt history on exit and load it from on start.
4144 .It Ic message-limit Ar number
4145 Set the number of error or information messages to save in the message log for
4146 each client.
4147 .It Ic prompt-history-limit Ar number
4148 Set the number of history items to save in the history file for each type of
4149 command prompt.
4150 .It Xo Ic set-clipboard
4151 .Op Ic on | external | off
4153 Attempt to set the terminal clipboard content using the
4154 .Xr xterm 1
4155 escape sequence, if there is an
4156 .Em \&Ms
4157 entry in the
4158 .Xr terminfo 5
4159 description (see the
4160 .Sx TERMINFO EXTENSIONS
4161 section).
4163 If set to
4164 .Ic on ,
4166 will both accept the escape sequence to create a buffer and attempt to set
4167 the terminal clipboard.
4168 If set to
4169 .Ic external ,
4171 will attempt to set the terminal clipboard but ignore attempts
4172 by applications to set
4174 buffers.
4176 .Ic off ,
4178 will neither accept the clipboard escape sequence nor attempt to set the
4179 clipboard.
4181 Note that this feature needs to be enabled in
4182 .Xr xterm 1
4183 by setting the resource:
4184 .Bd -literal -offset indent
4185 disallowedWindowOps: 20,21,SetXprop
4188 Or changing this property from the
4189 .Xr xterm 1
4190 interactive menu when required.
4191 .It Ic terminal-features[] Ar string
4192 Set terminal features for terminal types read from
4193 .Xr terminfo 5 .
4195 has a set of named terminal features.
4196 Each will apply appropriate changes to the
4197 .Xr terminfo 5
4198 entry in use.
4201 can detect features for a few common terminals; this option can be used to
4202 easily tell tmux about features supported by terminals it cannot detect.
4204 .Ic terminal-overrides
4205 option allows individual
4206 .Xr terminfo 5
4207 capabilities to be set instead,
4208 .Ic terminal-features
4209 is intended for classes of functionality supported in a standard way but not
4210 reported by
4211 .Xr terminfo 5 .
4212 Care must be taken to configure this only with features the terminal actually
4213 supports.
4215 This is an array option where each entry is a colon-separated string made up
4216 of a terminal type pattern (matched using
4217 .Xr fnmatch 3 )
4218 followed by a list of terminal features.
4219 The available features are:
4220 .Bl -tag -width Ds
4221 .It 256
4222 Supports 256 colours with the SGR escape sequences.
4223 .It clipboard
4224 Allows setting the system clipboard.
4225 .It ccolour
4226 Allows setting the cursor colour.
4227 .It cstyle
4228 Allows setting the cursor style.
4229 .It extkeys
4230 Supports extended keys.
4231 .It focus
4232 Supports focus reporting.
4233 .It hyperlinks
4234 Supports OSC 8 hyperlinks.
4235 .It ignorefkeys
4236 Ignore function keys from
4237 .Xr terminfo 5
4238 and use the
4240 internal set only.
4241 .It margins
4242 Supports DECSLRM margins.
4243 .It mouse
4244 Supports
4245 .Xr xterm 1
4246 mouse sequences.
4247 .It osc7
4248 Supports the OSC 7 working directory extension.
4249 .It overline
4250 Supports the overline SGR attribute.
4251 .It rectfill
4252 Supports the DECFRA rectangle fill escape sequence.
4253 .It RGB
4254 Supports RGB colour with the SGR escape sequences.
4255 .It sixel
4256 Supports SIXEL graphics.
4257 .It strikethrough
4258 Supports the strikethrough SGR escape sequence.
4259 .It sync
4260 Supports synchronized updates.
4261 .It title
4262 Supports
4263 .Xr xterm 1
4264 title setting.
4265 .It usstyle
4266 Allows underscore style and colour to be set.
4268 .It Ic terminal-overrides[] Ar string
4269 Allow terminal descriptions read using
4270 .Xr terminfo 5
4271 to be overridden.
4272 Each entry is a colon-separated string made up of a terminal type pattern
4273 (matched using
4274 .Xr fnmatch 3 )
4275 and a set of
4276 .Em name=value
4277 entries.
4279 For example, to set the
4280 .Ql clear
4281 .Xr terminfo 5
4282 entry to
4283 .Ql \ee[H\ee[2J
4284 for all terminal types matching
4285 .Ql rxvt* :
4287 .Dl "rxvt*:clear=\ee[H\ee[2J"
4289 The terminal entry value is passed through
4290 .Xr strunvis 3
4291 before interpretation.
4292 .It Ic user-keys[] Ar key
4293 Set list of user-defined key escape sequences.
4294 Each item is associated with a key named
4295 .Ql User0 ,
4296 .Ql User1 ,
4297 and so on.
4299 For example:
4300 .Bd -literal -offset indent
4301 set -s user-keys[0] "\ee[5;30012\[ti]"
4302 bind User0 resize-pane -L 3
4306 Available session options are:
4307 .Bl -tag -width Ds
4308 .It Xo Ic activity-action
4309 .Op Ic any | none | current | other
4311 Set action on window activity when
4312 .Ic monitor-activity
4313 is on.
4314 .Ic any
4315 means activity in any window linked to a session causes a bell or message
4316 (depending on
4317 .Ic visual-activity )
4318 in the current window of that session,
4319 .Ic none
4320 means all activity is ignored (equivalent to
4321 .Ic monitor-activity
4322 being off),
4323 .Ic current
4324 means only activity in windows other than the current window are ignored and
4325 .Ic other
4326 means activity in the current window is ignored but not those in other windows.
4327 .It Ic assume-paste-time Ar milliseconds
4328 If keys are entered faster than one in
4329 .Ar milliseconds ,
4330 they are assumed to have been pasted rather than typed and
4332 key bindings are not processed.
4333 The default is one millisecond and zero disables.
4334 .It Ic base-index Ar index
4335 Set the base index from which an unused index should be searched when a new
4336 window is created.
4337 The default is zero.
4338 .It Xo Ic bell-action
4339 .Op Ic any | none | current | other
4341 Set action on a bell in a window when
4342 .Ic monitor-bell
4343 is on.
4344 The values are the same as those for
4345 .Ic activity-action .
4346 .It Ic default-command Ar shell-command
4347 Set the command used for new windows (if not specified when the window is
4348 created) to
4349 .Ar shell-command ,
4350 which may be any
4351 .Xr sh 1
4352 command.
4353 The default is an empty string, which instructs
4355 to create a login shell using the value of the
4356 .Ic default-shell
4357 option.
4358 .It Ic default-shell Ar path
4359 Specify the default shell.
4360 This is used as the login shell for new windows when the
4361 .Ic default-command
4362 option is set to empty, and must be the full path of the executable.
4363 When started
4365 tries to set a default value from the first suitable of the
4366 .Ev SHELL
4367 environment variable, the shell returned by
4368 .Xr getpwuid 3 ,
4370 .Pa /bin/sh .
4371 This option should be configured when
4373 is used as a login shell.
4374 .It Ic default-size Ar XxY
4375 Set the default size of new windows when the
4376 .Ic window-size
4377 option is set to manual or when a session is created with
4378 .Ic new-session
4379 .Fl d .
4380 The value is the width and height separated by an
4381 .Ql x
4382 character.
4383 The default is 80x24.
4384 .It Xo Ic destroy-unattached
4385 .Op Ic off | on | keep-last | keep-group
4388 .Ic on ,
4389 destroy the session after the last client has detached.
4391 .Ic off
4392 (the default), leave the session orphaned.
4394 .Ic keep-last ,
4395 destroy the session only if it is in a group and has other sessions in that
4396 group.
4398 .Ic keep-group ,
4399 destroy the session unless it is in a group and is the only session in that
4400 group.
4401 .It Xo Ic detach-on-destroy
4402 .Op Ic off | on | no-detached | previous | next
4405 .Ic on
4406 (the default), the client is detached when the session it is attached to
4407 is destroyed.
4409 .Ic off ,
4410 the client is switched to the most recently active of the remaining
4411 sessions.
4413 .Ic no-detached ,
4414 the client is detached only if there are no detached sessions; if detached
4415 sessions exist, the client is switched to the most recently active.
4417 .Ic previous
4419 .Ic next ,
4420 the client is switched to the previous or next session in alphabetical order.
4421 .It Ic display-panes-active-colour Ar colour
4422 Set the colour used by the
4423 .Ic display-panes
4424 command to show the indicator for the active pane.
4425 .It Ic display-panes-colour Ar colour
4426 Set the colour used by the
4427 .Ic display-panes
4428 command to show the indicators for inactive panes.
4429 .It Ic display-panes-time Ar time
4430 Set the time in milliseconds for which the indicators shown by the
4431 .Ic display-panes
4432 command appear.
4433 .It Ic display-time Ar time
4434 Set the amount of time for which status line messages and other on-screen
4435 indicators are displayed.
4436 If set to 0, messages and indicators are displayed until a key is pressed.
4437 .Ar time
4438 is in milliseconds.
4439 .It Ic history-limit Ar lines
4440 Set the maximum number of lines held in window history.
4441 This setting applies only to new windows - existing window histories are not
4442 resized and retain the limit at the point they were created.
4443 .It Ic initial-repeat-time Ar time
4444 Set the time in milliseconds for the initial repeat when a key is bound with the
4445 .Fl r
4446 flag.
4447 This allows multiple commands to be entered without pressing the prefix key
4448 again.
4449 See also the
4450 .Ic repeat-time
4451 option.
4453 .Ic initial-repeat-time
4454 is zero,
4455 .Ic repeat-time
4456 is used for the first key press.
4457 .It Ic key-table Ar key-table
4458 Set the default key table to
4459 .Ar key-table
4460 instead of
4461 .Em root .
4462 .It Ic lock-after-time Ar number
4463 Lock the session (like the
4464 .Ic lock-session
4465 command) after
4466 .Ar number
4467 seconds of inactivity.
4468 The default is not to lock (set to 0).
4469 .It Ic lock-command Ar shell-command
4470 Command to run when locking each client.
4471 The default is to run
4472 .Xr lock 1
4473 with
4474 .Fl np .
4475 .It Ic menu-style Ar style
4476 Set the menu style.
4477 See the
4478 .Sx STYLES
4479 section on how to specify
4480 .Ar style .
4481 .It Ic menu-selected-style Ar style
4482 Set the selected menu item style.
4483 See the
4484 .Sx STYLES
4485 section on how to specify
4486 .Ar style .
4487 .It Ic menu-border-style Ar style
4488 Set the menu border style.
4489 See the
4490 .Sx STYLES
4491 section on how to specify
4492 .Ar style .
4493 .It Ic menu-border-lines Ar type
4494 Set the type of characters used for drawing menu borders.
4496 .Ic popup-border-lines
4497 for possible values for
4498 .Ar border-lines .
4499 .It Ic message-command-style Ar style
4500 Set status line message command style.
4501 This is used for the command prompt with
4502 .Xr vi 1
4503 keys when in command mode.
4504 For how to specify
4505 .Ar style ,
4506 see the
4507 .Sx STYLES
4508 section.
4509 .It Xo Ic message-line
4510 .Op Ic 0 | 1 | 2 | 3 | 4
4512 Set line on which status line messages and the command prompt are shown.
4513 .It Ic message-style Ar style
4514 Set status line message style.
4515 This is used for messages and for the command prompt.
4516 For how to specify
4517 .Ar style ,
4518 see the
4519 .Sx STYLES
4520 section.
4521 .It Xo Ic mouse
4522 .Op Ic on | off
4524 If on,
4526 captures the mouse and allows mouse events to be bound as key bindings.
4527 See the
4528 .Sx MOUSE SUPPORT
4529 section for details.
4530 .It Ic prefix Ar key
4531 Set the key accepted as a prefix key.
4532 In addition to the standard keys described under
4533 .Sx KEY BINDINGS ,
4534 .Ic prefix
4535 can be set to the special key
4536 .Ql None
4537 to set no prefix.
4538 .It Ic prefix2 Ar key
4539 Set a secondary key accepted as a prefix key.
4540 Like
4541 .Ic prefix ,
4542 .Ic prefix2
4543 can be set to
4544 .Ql None .
4545 .It Ic prefix-timeout Ar time
4546 Set the time in milliseconds for which
4548 waits after
4549 .Ic prefix
4550 is input before dismissing it.
4551 Can be set to zero to disable any timeout.
4552 .It Ic prompt-cursor-colour Ar colour
4553 Set the colour of the cursor in the command prompt.
4554 .It Ic prompt-cursor-style Ar style
4555 Set the style of the cursor in the command prompt.
4556 See the
4557 .Ic cursor-style
4558 options for available styles.
4559 .It Xo Ic renumber-windows
4560 .Op Ic on | off
4562 If on, when a window is closed in a session, automatically renumber the other
4563 windows in numerical order.
4564 This respects the
4565 .Ic base-index
4566 option if it has been set.
4567 If off, do not renumber the windows.
4568 .It Ic repeat-time Ar time
4569 Allow multiple commands to be entered without pressing the prefix key again
4570 in the specified
4571 .Ar time
4572 milliseconds (the default is 500).
4573 Whether a key repeats may be set when it is bound using the
4574 .Fl r
4575 flag to
4576 .Ic bind-key .
4577 Repeat is enabled for the default keys bound to the
4578 .Ic resize-pane
4579 command.
4580 See also the
4581 .Ic initial-repeat-time
4582 option.
4583 .It Xo Ic set-titles
4584 .Op Ic on | off
4586 Attempt to set the client terminal title using the
4587 .Em tsl
4589 .Em fsl
4590 .Xr terminfo 5
4591 entries if they exist.
4593 automatically sets these to the \ee]0;...\e007 sequence if
4594 the terminal appears to be
4595 .Xr xterm 1 .
4596 This option is off by default.
4597 .It Ic set-titles-string Ar string
4598 String used to set the client terminal title if
4599 .Ic set-titles
4600 is on.
4601 Formats are expanded, see the
4602 .Sx FORMATS
4603 section.
4604 .It Xo Ic silence-action
4605 .Op Ic any | none | current | other
4607 Set action on window silence when
4608 .Ic monitor-silence
4609 is on.
4610 The values are the same as those for
4611 .Ic activity-action .
4612 .It Xo Ic status
4613 .Op Ic off | on | 2 | 3 | 4 | 5
4615 Show or hide the status line or specify its size.
4616 Using
4617 .Ic on
4618 gives a status line one row in height;
4619 .Ic 2 ,
4620 .Ic 3 ,
4621 .Ic 4
4623 .Ic 5
4624 more rows.
4625 .It Ic status-format[] Ar format
4626 Specify the format to be used for each line of the status line.
4627 The default builds the top status line from the various individual status
4628 options below.
4629 .It Ic status-interval Ar interval
4630 Update the status line every
4631 .Ar interval
4632 seconds.
4633 By default, updates will occur every 15 seconds.
4634 A setting of zero disables redrawing at interval.
4635 .It Xo Ic status-justify
4636 .Op Ic left | centre | right | absolute-centre
4638 Set the position of the window list in the status line: left, centre or right.
4639 centre puts the window list in the relative centre of the available free space;
4640 absolute-centre uses the centre of the entire horizontal space.
4641 .It Xo Ic status-keys
4642 .Op Ic vi | emacs
4644 Use vi or emacs-style
4645 key bindings in the status line, for example at the command prompt.
4646 The default is emacs, unless the
4647 .Ev VISUAL
4649 .Ev EDITOR
4650 environment variables are set and contain the string
4651 .Ql vi .
4652 .It Ic status-left Ar string
4653 Display
4654 .Ar string
4655 (by default the session name) to the left of the status line.
4656 .Ar string
4657 will be passed through
4658 .Xr strftime 3 .
4659 Also see the
4660 .Sx FORMATS
4662 .Sx STYLES
4663 sections.
4665 For details on how the names and titles can be set see the
4666 .Sx "NAMES AND TITLES"
4667 section.
4669 Examples are:
4670 .Bd -literal -offset indent
4671 #(sysctl vm.loadavg)
4672 #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
4675 The default is
4676 .Ql "[#S] " .
4677 .It Ic status-left-length Ar length
4678 Set the maximum
4679 .Ar length
4680 of the left component of the status line.
4681 The default is 10.
4682 .It Ic status-left-style Ar style
4683 Set the style of the left part of the status line.
4684 For how to specify
4685 .Ar style ,
4686 see the
4687 .Sx STYLES
4688 section.
4689 .It Xo Ic status-position
4690 .Op Ic top | bottom
4692 Set the position of the status line.
4693 .It Ic status-right Ar string
4694 Display
4695 .Ar string
4696 to the right of the status line.
4697 By default, the current pane title in double quotes, the date and the time
4698 are shown.
4699 As with
4700 .Ic status-left ,
4701 .Ar string
4702 will be passed to
4703 .Xr strftime 3
4704 and character pairs are replaced.
4705 .It Ic status-right-length Ar length
4706 Set the maximum
4707 .Ar length
4708 of the right component of the status line.
4709 The default is 40.
4710 .It Ic status-right-style Ar style
4711 Set the style of the right part of the status line.
4712 For how to specify
4713 .Ar style ,
4714 see the
4715 .Sx STYLES
4716 section.
4717 .It Ic status-style Ar style
4718 Set status line style.
4719 For how to specify
4720 .Ar style ,
4721 see the
4722 .Sx STYLES
4723 section.
4724 .It Ic update-environment[] Ar variable
4725 Set list of environment variables to be copied into the session environment
4726 when a new session is created or an existing session is attached.
4727 Any variables that do not exist in the source environment are set to be
4728 removed from the session environment (as if
4729 .Fl r
4730 was given to the
4731 .Ic set-environment
4732 command).
4733 .It Xo Ic visual-activity
4734 .Op Ic on | off | both
4736 If on, display a message instead of sending a bell when activity occurs in a
4737 window for which the
4738 .Ic monitor-activity
4739 window option is enabled.
4740 If set to both, a bell and a message are produced.
4741 .It Xo Ic visual-bell
4742 .Op Ic on | off | both
4744 If on, a message is shown on a bell in a window for which the
4745 .Ic monitor-bell
4746 window option is enabled instead of it being passed through to the
4747 terminal (which normally makes a sound).
4748 If set to both, a bell and a message are produced.
4749 Also see the
4750 .Ic bell-action
4751 option.
4752 .It Xo Ic visual-silence
4753 .Op Ic on | off | both
4756 .Ic monitor-silence
4757 is enabled, prints a message after the interval has expired on a given window
4758 instead of sending a bell.
4759 If set to both, a bell and a message are produced.
4760 .It Ic word-separators Ar string
4761 Sets the session's conception of what characters are considered word
4762 separators, for the purposes of the next and previous word commands in
4763 copy mode.
4766 Available window options are:
4768 .Bl -tag -width Ds -compact
4769 .It Xo Ic aggressive-resize
4770 .Op Ic on | off
4772 Aggressively resize the chosen window.
4773 This means that
4775 will resize the window to the size of the smallest or largest session
4776 (see the
4777 .Ic window-size
4778 option) for which it is the current window, rather than the session to
4779 which it is attached.
4780 The window may resize when the current window is changed on another
4781 session; this option is good for full-screen programs which support
4782 .Dv SIGWINCH
4783 and poor for interactive programs such as shells.
4785 .It Xo Ic automatic-rename
4786 .Op Ic on | off
4788 Control automatic window renaming.
4789 When this setting is enabled,
4791 will rename the window automatically using the format specified by
4792 .Ic automatic-rename-format .
4793 This flag is automatically disabled for an individual window when a name
4794 is specified at creation with
4795 .Ic new-window
4797 .Ic new-session ,
4798 or later with
4799 .Ic rename-window ,
4800 or with a terminal escape sequence.
4801 It may be switched off globally with:
4802 .Bd -literal -offset indent
4803 set-option -wg automatic-rename off
4806 .It Ic automatic-rename-format Ar format
4807 The format (see
4808 .Sx FORMATS )
4809 used when the
4810 .Ic automatic-rename
4811 option is enabled.
4813 .It Ic clock-mode-colour Ar colour
4814 Set clock colour.
4816 .It Xo Ic clock-mode-style
4817 .Op Ic 12 | 24
4819 Set clock hour format.
4821 .It Ic fill-character Ar character
4822 Set the character used to fill areas of the terminal unused by a window.
4824 .It Ic main-pane-height Ar height
4825 .It Ic main-pane-width Ar width
4826 Set the width or height of the main (left or top) pane in the
4827 .Ic main-horizontal ,
4828 .Ic main-horizontal-mirrored ,
4829 .Ic main-vertical ,
4831 .Ic main-vertical-mirrored
4832 layouts.
4833 If suffixed by
4834 .Ql % ,
4835 this is a percentage of the window size.
4837 .It Ic copy-mode-match-style Ar style
4838 Set the style of search matches in copy mode.
4839 For how to specify
4840 .Ar style ,
4841 see the
4842 .Sx STYLES
4843 section.
4845 .It Ic copy-mode-mark-style Ar style
4846 Set the style of the line containing the mark in copy mode.
4847 For how to specify
4848 .Ar style ,
4849 see the
4850 .Sx STYLES
4851 section.
4853 .It Ic copy-mode-current-match-style Ar style
4854 Set the style of the current search match in copy mode.
4855 For how to specify
4856 .Ar style ,
4857 see the
4858 .Sx STYLES
4859 section.
4861 .It Ic copy-mode-position-format Ar format
4862 Format of the position indicator in copy mode.
4863 .It Xo Ic mode-keys
4864 .Op Ic vi | emacs
4866 Use vi or emacs-style key bindings in copy mode.
4867 The default is emacs, unless
4868 .Ev VISUAL
4870 .Ev EDITOR
4871 contains
4872 .Ql vi .
4874 .It Ic mode-style Ar style
4875 Set window modes style.
4876 For how to specify
4877 .Ar style ,
4878 see the
4879 .Sx STYLES
4880 section.
4882 .It Xo Ic monitor-activity
4883 .Op Ic on | off
4885 Monitor for activity in the window.
4886 Windows with activity are highlighted in the status line.
4888 .It Xo Ic monitor-bell
4889 .Op Ic on | off
4891 Monitor for a bell in the window.
4892 Windows with a bell are highlighted in the status line.
4894 .It Xo Ic monitor-silence
4895 .Op Ic interval
4897 Monitor for silence (no activity) in the window within
4898 .Ic interval
4899 seconds.
4900 Windows that have been silent for the interval are highlighted in the
4901 status line.
4902 An interval of zero disables the monitoring.
4904 .It Ic other-pane-height Ar height
4905 Set the height of the other panes (not the main pane) in the
4906 .Ic main-horizontal
4908 .Ic main-horizontal-mirrored
4909 layouts.
4910 If this option is set to 0 (the default), it will have no effect.
4911 If both the
4912 .Ic main-pane-height
4914 .Ic other-pane-height
4915 options are set, the main pane will grow taller to make the other panes the
4916 specified height, but will never shrink to do so.
4917 If suffixed by
4918 .Ql % ,
4919 this is a percentage of the window size.
4921 .It Ic other-pane-width Ar width
4922 Like
4923 .Ic other-pane-height ,
4924 but set the width of other panes in the
4925 .Ic main-vertical
4927 .Ic main-vertical-mirrored
4928 layouts.
4930 .It Ic pane-active-border-style Ar style
4931 Set the pane border style for the currently active pane.
4932 For how to specify
4933 .Ar style ,
4934 see the
4935 .Sx STYLES
4936 section.
4937 Attributes are ignored.
4939 .It Ic pane-base-index Ar index
4940 Like
4941 .Ic base-index ,
4942 but set the starting index for pane numbers.
4944 .It Ic pane-border-format Ar format
4945 Set the text shown in pane border status lines.
4947 .It Xo Ic pane-border-indicators
4948 .Op Ic off | colour | arrows | both
4950 Indicate active pane by colouring only half of the border in windows with
4951 exactly two panes, by displaying arrow markers, by drawing both or neither.
4953 .It Ic pane-border-lines Ar type
4954 Set the type of characters used for drawing pane borders.
4955 .Ar type
4956 may be one of:
4957 .Bl -tag -width Ds
4958 .It single
4959 single lines using ACS or UTF-8 characters
4960 .It double
4961 double lines using UTF-8 characters
4962 .It heavy
4963 heavy lines using UTF-8 characters
4964 .It simple
4965 simple ASCII characters
4966 .It number
4967 the pane number
4970 .Ql double
4972 .Ql heavy
4973 will fall back to standard ACS line drawing when UTF-8 is not supported.
4975 .It Xo Ic pane-border-status
4976 .Op Ic off | top | bottom
4978 Turn pane border status lines off or set their position.
4980 .It Ic pane-border-style Ar style
4981 Set the pane border style for panes aside from the active pane.
4982 For how to specify
4983 .Ar style ,
4984 see the
4985 .Sx STYLES
4986 section.
4987 Attributes are ignored.
4989 .It Ic popup-style Ar style
4990 Set the popup style.
4991 See the
4992 .Sx STYLES
4993 section on how to specify
4994 .Ar style .
4995 Attributes are ignored.
4997 .It Ic popup-border-style Ar style
4998 Set the popup border style.
4999 See the
5000 .Sx STYLES
5001 section on how to specify
5002 .Ar style .
5003 Attributes are ignored.
5005 .It Ic popup-border-lines Ar type
5006 Set the type of characters used for drawing popup borders.
5007 .Ar type
5008 may be one of:
5009 .Bl -tag -width Ds
5010 .It single
5011 single lines using ACS or UTF-8 characters (default)
5012 .It rounded
5013 variation of single with rounded corners using UTF-8 characters
5014 .It double
5015 double lines using UTF-8 characters
5016 .It heavy
5017 heavy lines using UTF-8 characters
5018 .It simple
5019 simple ASCII characters
5020 .It padded
5021 simple ASCII space character
5022 .It none
5023 no border
5026 .Ql double
5028 .Ql heavy
5029 will fall back to standard ACS line drawing when UTF-8 is not supported.
5031 .It Xo Ic pane-scrollbars
5032 .Op Ic off | modal | on
5034 When enabled, a character based scrollbar appears on the left or right
5035 of each pane.
5036 A filled section of the scrollbar, known as the
5037 .Ql slider ,
5038 represents the position and size of the visible part of the pane content.
5040 If set to
5041 .Ic on
5042 the scrollbar is visible all the time.
5043 If set to
5044 .Ic modal
5045 the scrollbar only appears when the pane is in copy mode or view mode.
5046 When the scrollbar is visible, the pane is narrowed by the width of the
5047 scrollbar and the text in the pane is reflowed.
5048 If set to
5049 .Ic modal ,
5050 the pane is narrowed only when the scrollbar is visible.
5052 See also
5053 .Ic pane-scrollbars-style .
5055 .It Ic pane-scrollbars-style Ar style
5056 Set the scrollbars style.
5057 For how to specify
5058 .Ar style ,
5059 see the
5060 .Sx STYLES
5061 section.
5062 The foreground colour is used for the slider, the background for the rest of the
5063 scrollbar.
5064 Attributes are ignored.
5066 .It Xo Ic pane-scrollbars-position
5067 .Op Ic left | right
5069 Sets which side of the pane to display pane scrollbars on.
5071 .It Ic window-status-activity-style Ar style
5072 Set status line style for windows with an activity alert.
5073 For how to specify
5074 .Ar style ,
5075 see the
5076 .Sx STYLES
5077 section.
5079 .It Ic window-status-bell-style Ar style
5080 Set status line style for windows with a bell alert.
5081 For how to specify
5082 .Ar style ,
5083 see the
5084 .Sx STYLES
5085 section.
5087 .It Ic window-status-current-format Ar string
5088 Like
5089 .Ar window-status-format ,
5090 but is the format used when the window is the current window.
5092 .It Ic window-status-current-style Ar style
5093 Set status line style for the currently active window.
5094 For how to specify
5095 .Ar style ,
5096 see the
5097 .Sx STYLES
5098 section.
5100 .It Ic window-status-format Ar string
5101 Set the format in which the window is displayed in the status line window list.
5102 See the
5103 .Sx FORMATS
5105 .Sx STYLES
5106 sections.
5108 .It Ic window-status-last-style Ar style
5109 Set status line style for the last active window.
5110 For how to specify
5111 .Ar style ,
5112 see the
5113 .Sx STYLES
5114 section.
5116 .It Ic window-status-separator Ar string
5117 Sets the separator drawn between windows in the status line.
5118 The default is a single space character.
5120 .It Ic window-status-style Ar style
5121 Set status line style for a single window.
5122 For how to specify
5123 .Ar style ,
5124 see the
5125 .Sx STYLES
5126 section.
5128 .It Xo Ic window-size
5129 .Ar largest | Ar smallest | Ar manual | Ar latest
5131 Configure how
5133 determines the window size.
5134 If set to
5135 .Ar largest ,
5136 the size of the largest attached session is used; if
5137 .Ar smallest ,
5138 the size of the smallest.
5140 .Ar manual ,
5141 the size of a new window is set from the
5142 .Ic default-size
5143 option and windows are resized automatically.
5144 With
5145 .Ar latest ,
5147 uses the size of the client that had the most recent activity.
5148 See also the
5149 .Ic resize-window
5150 command and the
5151 .Ic aggressive-resize
5152 option.
5154 .It Xo Ic wrap-search
5155 .Op Ic on | off
5157 If this option is set, searches will wrap around the end of the pane contents.
5158 The default is on.
5161 Available pane options are:
5163 .Bl -tag -width Ds -compact
5164 .It Xo Ic allow-passthrough
5165 .Op Ic on | off | all
5167 Allow programs in the pane to bypass
5169 using a terminal escape sequence (\eePtmux;...\ee\e\e).
5170 If set to
5171 .Ic on ,
5172 passthrough sequences will be allowed only if the pane is visible.
5173 If set to
5174 .Ic all ,
5175 they will be allowed even if the pane is invisible.
5177 .It Xo Ic allow-rename
5178 .Op Ic on | off
5180 Allow programs in the pane to change the window name using a terminal escape
5181 sequence (\eek...\ee\e\e).
5183 .It Xo Ic allow-set-title
5184 .Op Ic on | off
5186 Allow programs in the pane to change the title using the terminal escape
5187 sequences (\ee]2;...\ee\e\e or \ee]0;...\ee\e\e).
5189 .It Xo Ic alternate-screen
5190 .Op Ic on | off
5192 This option configures whether programs running inside the pane may use the
5193 terminal alternate screen feature, which allows the
5194 .Em smcup
5196 .Em rmcup
5197 .Xr terminfo 5
5198 capabilities.
5199 The alternate screen feature preserves the contents of the window when an
5200 interactive application starts and restores it on exit, so that any output
5201 visible before the application starts reappears unchanged after it exits.
5203 .It Ic cursor-colour Ar colour
5204 Set the colour of the cursor.
5206 .It Ic cursor-style Ar style
5207 Set the style of the cursor.
5208 Available styles are:
5209 .Ic default ,
5210 .Ic blinking-block ,
5211 .Ic block ,
5212 .Ic blinking-underline ,
5213 .Ic underline ,
5214 .Ic blinking-bar ,
5215 .Ic bar .
5217 .It Ic pane-colours[] Ar colour
5218 The default colour palette.
5219 Each entry in the array defines the colour
5221 uses when the colour with that index is requested.
5222 The index may be from zero to 255.
5224 .It Xo Ic remain-on-exit
5225 .Op Ic on | off | failed
5227 A pane with this flag set is not destroyed when the program running in it
5228 exits.
5229 If set to
5230 .Ic failed ,
5231 then only when the program exit status is not zero.
5232 The pane may be reactivated with the
5233 .Ic respawn-pane
5234 command.
5236 .It Ic remain-on-exit-format Ar string
5237 Set the text shown at the bottom of exited panes when
5238 .Ic remain-on-exit
5239 is enabled.
5241 .It Xo Ic scroll-on-clear
5242 .Op Ic on | off
5244 When the entire screen is cleared and this option is on, scroll the contents of
5245 the screen into history before clearing it.
5247 .It Xo Ic synchronize-panes
5248 .Op Ic on | off
5250 Duplicate input to all other panes in the same window where this option is also
5251 on (only for panes that are not in any mode).
5253 .It Ic window-active-style Ar style
5254 Set the pane style when it is the active pane.
5255 For how to specify
5256 .Ar style ,
5257 see the
5258 .Sx STYLES
5259 section.
5261 .It Ic window-style Ar style
5262 Set the pane style.
5263 For how to specify
5264 .Ar style ,
5265 see the
5266 .Sx STYLES
5267 section.
5269 .Sh HOOKS
5271 allows commands to run on various triggers, called
5272 .Em hooks .
5273 Most
5275 commands have an
5276 .Em after
5277 hook and there are a number of hooks not associated with commands.
5279 Hooks are stored as array options, members of the array are executed in
5280 order when the hook is triggered.
5281 Like options different hooks may be global or belong to a session, window or
5282 pane.
5283 Hooks may be configured with the
5284 .Ic set-hook
5286 .Ic set-option
5287 commands and displayed with
5288 .Ic show-hooks
5290 .Ic show-options
5291 .Fl H .
5292 The following two commands are equivalent:
5293 .Bd -literal -offset indent.
5294 set-hook -g pane-mode-changed[42] \[aq]set -g status-left-style bg=red\[aq]
5295 set-option -g pane-mode-changed[42] \[aq]set -g status-left-style bg=red\[aq]
5298 Setting a hook without specifying an array index clears the hook and sets the
5299 first member of the array.
5301 A command's after
5302 hook is run after it completes, except when the command is run as part of a hook
5303 itself.
5304 They are named with an
5305 .Ql after-
5306 prefix.
5307 For example, the following command adds a hook to select the even-vertical
5308 layout after every
5309 .Ic split-window :
5310 .Bd -literal -offset indent
5311 set-hook -g after-split-window "selectl even-vertical"
5314 If a command fails, the
5315 .Ql command-error
5316 hook will be fired.
5317 For example, this could be used to write to a log file:
5318 .Bd -literal -offset indent
5319 set-hook -g command-error "run-shell \\"echo 'a tmux command failed' >>/tmp/log\\""
5322 All the notifications listed in the
5323 .Sx CONTROL MODE
5324 section are hooks (without any arguments), except
5325 .Ic %exit .
5326 The following additional hooks are available:
5327 .Bl -tag -width "XXXXXXXXXXXXXXXXXXXXXX"
5328 .It alert-activity
5329 Run when a window has activity.
5331 .Ic monitor-activity .
5332 .It alert-bell
5333 Run when a window has received a bell.
5335 .Ic monitor-bell .
5336 .It alert-silence
5337 Run when a window has been silent.
5339 .Ic monitor-silence .
5340 .It client-active
5341 Run when a client becomes the latest active client of its session.
5342 .It client-attached
5343 Run when a client is attached.
5344 .It client-detached
5345 Run when a client is detached
5346 .It client-focus-in
5347 Run when focus enters a client
5348 .It client-focus-out
5349 Run when focus exits a client
5350 .It client-resized
5351 Run when a client is resized.
5352 .It client-session-changed
5353 Run when a client's attached session is changed.
5354 .It command-error
5355 Run when a command fails.
5356 .It pane-died
5357 Run when the program running in a pane exits, but
5358 .Ic remain-on-exit
5359 is on so the pane has not closed.
5360 .It pane-exited
5361 Run when the program running in a pane exits.
5362 .It pane-focus-in
5363 Run when the focus enters a pane, if the
5364 .Ic focus-events
5365 option is on.
5366 .It pane-focus-out
5367 Run when the focus exits a pane, if the
5368 .Ic focus-events
5369 option is on.
5370 .It pane-set-clipboard
5371 Run when the terminal clipboard is set using the
5372 .Xr xterm 1
5373 escape sequence.
5374 .It session-created
5375 Run when a new session created.
5376 .It session-closed
5377 Run when a session closed.
5378 .It session-renamed
5379 Run when a session is renamed.
5380 .It window-layout-changed
5381 Run when a window layout is changed.
5382 .It window-linked
5383 Run when a window is linked into a session.
5384 .It window-renamed
5385 Run when a window is renamed.
5386 .It window-resized
5387 Run when a window is resized.
5388 This may be after the
5389 .Ar client-resized
5390 hook is run.
5391 .It window-unlinked
5392 Run when a window is unlinked from a session.
5395 Hooks are managed with these commands:
5396 .Bl -tag -width Ds
5397 .It Xo Ic set-hook
5398 .Op Fl agpRuw
5399 .Op Fl t Ar target-pane
5400 .Ar hook-name
5401 .Ar command
5403 Without
5404 .Fl R ,
5405 sets (or with
5406 .Fl u
5407 unsets) hook
5408 .Ar hook-name
5410 .Ar command .
5411 The flags are the same as for
5412 .Ic set-option .
5414 With
5415 .Fl R ,
5417 .Ar hook-name
5418 immediately.
5419 .It Xo Ic show-hooks
5420 .Op Fl gpw
5421 .Op Fl t Ar target-pane
5423 Shows hooks.
5424 The flags are the same as for
5425 .Ic show-options .
5427 .Sh MOUSE SUPPORT
5428 If the
5429 .Ic mouse
5430 option is on (the default is off),
5432 allows mouse events to be bound as keys.
5433 The name of each key is made up of a mouse event (such as
5434 .Ql MouseUp1 )
5435 and a location suffix, one of the following:
5436 .Bl -column "XXXXXXXXXXXXX" -offset indent
5437 .It Li "Pane" Ta "the contents of a pane"
5438 .It Li "Border" Ta "a pane border"
5439 .It Li "Status" Ta "the status line window list"
5440 .It Li "StatusLeft" Ta "the left part of the status line"
5441 .It Li "StatusRight" Ta "the right part of the status line"
5442 .It Li "StatusDefault" Ta "any other part of the status line"
5445 The following mouse events are available:
5446 .Bl -column "MouseDown1" "MouseDrag1" "WheelDown" -offset indent
5447 .It Li "WheelUp" Ta "WheelDown" Ta ""
5448 .It Li "MouseDown1" Ta "MouseUp1" Ta "MouseDrag1" Ta "MouseDragEnd1"
5449 .It Li "MouseDown2" Ta "MouseUp2" Ta "MouseDrag2" Ta "MouseDragEnd2"
5450 .It Li "MouseDown3" Ta "MouseUp3" Ta "MouseDrag3" Ta "MouseDragEnd3"
5451 .It Li "SecondClick1" Ta "SecondClick2" Ta "SecondClick3"
5452 .It Li "DoubleClick1" Ta "DoubleClick2" Ta "DoubleClick3"
5453 .It Li "TripleClick1" Ta "TripleClick2" Ta "TripleClick3"
5457 .Ql SecondClick
5458 events are fired for the second click of a double click, even if there may be a
5459 third click which will fire
5460 .Ql TripleClick
5461 instead of
5462 .Ql DoubleClick .
5464 Each should be suffixed with a location, for example
5465 .Ql MouseDown1Status .
5467 The special token
5468 .Ql {mouse}
5470 .Ql =
5471 may be used as
5472 .Ar target-window
5474 .Ar target-pane
5475 in commands bound to mouse key bindings.
5476 It resolves to the window or pane over which the mouse event took place
5477 (for example, the window in the status line over which button 1 was released
5478 for a
5479 .Ql MouseUp1Status
5480 binding, or the pane over which the wheel was scrolled for a
5481 .Ql WheelDownPane
5482 binding).
5485 .Ic send-keys
5486 .Fl M
5487 flag may be used to forward a mouse event to a pane.
5489 The default key bindings allow the mouse to be used to select and resize panes,
5490 to copy text and to change window using the status line.
5491 These take effect if the
5492 .Ic mouse
5493 option is turned on.
5494 .Sh FORMATS
5495 Certain commands accept the
5496 .Fl F
5497 flag with a
5498 .Ar format
5499 argument.
5500 This is a string which controls the output format of the command.
5501 Format variables are enclosed in
5502 .Ql #{
5504 .Ql } ,
5505 for example
5506 .Ql #{session_name} .
5507 The possible variables are listed in the table below, or the name of a
5509 option may be used for an option's value.
5510 Some variables have a shorter alias such as
5511 .Ql #S ;
5512 .Ql ##
5513 is replaced by a single
5514 .Ql # ,
5515 .Ql #,
5516 by a
5517 .Ql \&,
5519 .Ql #}
5520 by a
5521 .Ql } .
5523 Conditionals are available by prefixing with
5524 .Ql \&?
5525 and separating two alternatives with a comma;
5526 if the specified variable exists and is not zero, the first alternative
5527 is chosen, otherwise the second is used.
5528 For example
5529 .Ql #{?session_attached,attached,not attached}
5530 will include the string
5531 .Ql attached
5532 if the session is attached and the string
5533 .Ql not attached
5534 if it is unattached, or
5535 .Ql #{?automatic-rename,yes,no}
5536 will include
5537 .Ql yes
5539 .Ic automatic-rename
5540 is enabled, or
5541 .Ql no
5542 if not.
5543 Conditionals can be nested arbitrarily.
5544 Inside a conditional,
5545 .Ql \&,
5547 .Ql }
5548 must be escaped as
5549 .Ql #,
5551 .Ql #} ,
5552 unless they are part of a
5553 .Ql #{...}
5554 replacement.
5555 For example:
5556 .Bd -literal -offset indent
5557 #{?pane_in_mode,#[fg=white#,bg=red],#[fg=red#,bg=white]}#W .
5560 String comparisons may be expressed by prefixing two comma-separated
5561 alternatives by
5562 .Ql == ,
5563 .Ql != ,
5564 .Ql < ,
5565 .Ql > ,
5566 .Ql <=
5568 .Ql >=
5569 and a colon.
5570 For example
5571 .Ql #{==:#{host},myhost}
5572 will be replaced by
5573 .Ql 1
5574 if running on
5575 .Ql myhost ,
5576 otherwise by
5577 .Ql 0 .
5578 .Ql ||
5580 .Ql &&
5581 evaluate to true if either or both of two comma-separated alternatives are
5582 true, for example
5583 .Ql #{||:#{pane_in_mode},#{alternate_on}} .
5586 .Ql m
5587 specifies an
5588 .Xr fnmatch 3
5589 or regular expression comparison.
5590 The first argument is the pattern and the second the string to compare.
5591 An optional argument specifies flags:
5592 .Ql r
5593 means the pattern is a regular expression instead of the default
5594 .Xr fnmatch 3
5595 pattern, and
5596 .Ql i
5597 means to ignore case.
5598 For example:
5599 .Ql #{m:*foo*,#{host}}
5601 .Ql #{m/ri:^A,MYVAR} .
5603 .Ql C
5604 performs a search for an
5605 .Xr fnmatch 3
5606 pattern or regular expression in the pane content and evaluates to zero if not
5607 found, or a line number if found.
5608 Like
5609 .Ql m ,
5611 .Ql r
5612 flag means search for a regular expression and
5613 .Ql i
5614 ignores case.
5615 For example:
5616 .Ql #{C/r:^Start}
5618 Numeric operators may be performed by prefixing two comma-separated alternatives
5619 with an
5620 .Ql e
5621 and an operator.
5622 An optional
5623 .Ql f
5624 flag may be given after the operator to use floating point numbers, otherwise
5625 integers are used.
5626 This may be followed by a number giving the number of decimal places to use for
5627 the result.
5628 The available operators are:
5629 addition
5630 .Ql + ,
5631 subtraction
5632 .Ql - ,
5633 multiplication
5634 .Ql * ,
5635 division
5636 .Ql / ,
5637 modulus
5638 .Ql m
5640 .Ql %
5641 (note that
5642 .Ql %
5643 must be escaped as
5644 .Ql %%
5645 in formats which are also expanded by
5646 .Xr strftime 3 )
5647 and numeric comparison operators
5648 .Ql == ,
5649 .Ql != ,
5650 .Ql < ,
5651 .Ql <= ,
5652 .Ql >
5654 .Ql >= .
5655 For example,
5656 .Ql #{e|*|f|4:5.5,3}
5657 multiplies 5.5 by 3 for a result with four decimal places and
5658 .Ql #{e|%%:7,3}
5659 returns the modulus of 7 and 3.
5660 .Ql a
5661 replaces a numeric argument by its ASCII equivalent, so
5662 .Ql #{a:98}
5663 results in
5664 .Ql b .
5665 .Ql c
5666 replaces a
5668 colour by its six-digit hexadecimal RGB value.
5670 A limit may be placed on the length of the resultant string by prefixing it
5671 by an
5672 .Ql = ,
5673 a number and a colon.
5674 Positive numbers count from the start of the string and negative from the end,
5676 .Ql #{=5:pane_title}
5677 will include at most the first five characters of the pane title, or
5678 .Ql #{=-5:pane_title}
5679 the last five characters.
5680 A suffix or prefix may be given as a second argument - if provided then it is
5681 appended or prepended to the string if the length has been trimmed, for example
5682 .Ql #{=/5/...:pane_title}
5683 will append
5684 .Ql ...
5685 if the pane title is more than five characters.
5686 Similarly,
5687 .Ql p
5688 pads the string to a given width, for example
5689 .Ql #{p10:pane_title}
5690 will result in a width of at least 10 characters.
5691 A positive width pads on the left, a negative on the right.
5692 .Ql n
5693 expands to the length of the variable and
5694 .Ql w
5695 to its width when displayed, for example
5696 .Ql #{n:window_name} .
5698 Prefixing a time variable with
5699 .Ql t:\&
5700 will convert it to a string, so if
5701 .Ql #{window_activity}
5702 gives
5703 .Ql 1445765102 ,
5704 .Ql #{t:window_activity}
5705 gives
5706 .Ql Sun Oct 25 09:25:02 2015 .
5707 Adding
5708 .Ql p (
5709 .Ql `t/p` )
5710 will use shorter but less accurate time format for times in the past.
5711 A custom format may be given using an
5712 .Ql f
5713 suffix (note that
5714 .Ql %
5715 must be escaped as
5716 .Ql %%
5717 if the format is separately being passed through
5718 .Xr strftime 3 ,
5719 for example in the
5720 .Ic status-left
5721 option):
5722 .Ql #{t/f/%%H#:%%M:window_activity} ,
5724 .Xr strftime 3 .
5727 .Ql b:\&
5729 .Ql d:\&
5730 prefixes are
5731 .Xr basename 3
5733 .Xr dirname 3
5734 of the variable respectively.
5735 .Ql q:\&
5736 will escape
5737 .Xr sh 1
5738 special characters or with a
5739 .Ql h
5740 suffix, escape hash characters (so
5741 .Ql #
5742 becomes
5743 .Ql ## ) .
5744 .Ql E:\&
5745 will expand the format twice, for example
5746 .Ql #{E:status-left}
5747 is the result of expanding the content of the
5748 .Ic status-left
5749 option rather than the option itself.
5750 .Ql T:\&
5751 is like
5752 .Ql E:\&
5753 but also expands
5754 .Xr strftime 3
5755 specifiers.
5756 .Ql S:\& ,
5757 .Ql W:\& ,
5758 .Ql P:\&
5760 .Ql L:\&
5761 will loop over each session, window, pane or client and insert the format once
5762 for each.
5763 For windows and panes, two comma-separated formats may be given:
5764 the second is used for the current window or active pane.
5765 For example, to get a list of windows formatted like the status line:
5766 .Bd -literal -offset indent
5767 #{W:#{E:window-status-format} ,#{E:window-status-current-format} }
5770 .Ql N:\&
5771 checks if a window (without any suffix or with the
5772 .Ql w
5773 suffix) or a session (with the
5774 .Ql s
5775 suffix) name exists, for example
5776 .Ql `N/w:foo`
5777 is replaced with 1 if a window named
5778 .Ql foo
5779 exists.
5781 A prefix of the form
5782 .Ql s/foo/bar/:\&
5783 will substitute
5784 .Ql foo
5785 with
5786 .Ql bar
5787 throughout.
5788 The first argument may be an extended regular expression and a final argument
5789 may be
5790 .Ql i
5791 to ignore case, for example
5792 .Ql s/a(.)/\e1x/i:\&
5793 would change
5794 .Ql abABab
5795 into
5796 .Ql bxBxbx .
5797 A different delimiter character may also be used, to avoid collisions with
5798 literal slashes in the pattern.
5799 For example,
5800 .Ql s|foo/|bar/|:\&
5801 will substitute
5802 .Ql foo/
5803 with
5804 .Ql bar/
5805 throughout.
5807 In addition, the last line of a shell command's output may be inserted using
5808 .Ql #() .
5809 For example,
5810 .Ql #(uptime)
5811 will insert the system's uptime.
5812 When constructing formats,
5814 does not wait for
5815 .Ql #()
5816 commands to finish; instead, the previous result from running the same command
5817 is used, or a placeholder if the command has not been run before.
5818 If the command hasn't exited, the most recent line of output will be used, but
5819 the status line will not be updated more than once a second.
5820 Commands are executed using
5821 .Pa /bin/sh
5822 and with the
5824 global environment set (see the
5825 .Sx GLOBAL AND SESSION ENVIRONMENT
5826 section).
5829 .Ql l
5830 specifies that a string should be interpreted literally and not expanded.
5831 For example
5832 .Ql #{l:#{?pane_in_mode,yes,no}}
5833 will be replaced by
5834 .Ql #{?pane_in_mode,yes,no} .
5836 The following variables are available, where appropriate:
5837 .Bl -column "XXXXXXXXXXXXXXXXXXX" "XXXXX"
5838 .It Sy "Variable name" Ta Sy "Alias" Ta Sy "Replaced with"
5839 .It Li "active_window_index" Ta "" Ta "Index of active window in session"
5840 .It Li "alternate_on" Ta "" Ta "1 if pane is in alternate screen"
5841 .It Li "alternate_saved_x" Ta "" Ta "Saved cursor X in alternate screen"
5842 .It Li "alternate_saved_y" Ta "" Ta "Saved cursor Y in alternate screen"
5843 .It Li "buffer_created" Ta "" Ta "Time buffer created"
5844 .It Li "buffer_name" Ta "" Ta "Name of buffer"
5845 .It Li "buffer_sample" Ta "" Ta "Sample of start of buffer"
5846 .It Li "buffer_size" Ta "" Ta "Size of the specified buffer in bytes"
5847 .It Li "client_activity" Ta "" Ta "Time client last had activity"
5848 .It Li "client_cell_height" Ta "" Ta "Height of each client cell in pixels"
5849 .It Li "client_cell_width" Ta "" Ta "Width of each client cell in pixels"
5850 .It Li "client_control_mode" Ta "" Ta "1 if client is in control mode"
5851 .It Li "client_created" Ta "" Ta "Time client created"
5852 .It Li "client_discarded" Ta "" Ta "Bytes discarded when client behind"
5853 .It Li "client_flags" Ta "" Ta "List of client flags"
5854 .It Li "client_height" Ta "" Ta "Height of client"
5855 .It Li "client_key_table" Ta "" Ta "Current key table"
5856 .It Li "client_last_session" Ta "" Ta "Name of the client's last session"
5857 .It Li "client_name" Ta "" Ta "Name of client"
5858 .It Li "client_pid" Ta "" Ta "PID of client process"
5859 .It Li "client_prefix" Ta "" Ta "1 if prefix key has been pressed"
5860 .It Li "client_readonly" Ta "" Ta "1 if client is read-only"
5861 .It Li "client_session" Ta "" Ta "Name of the client's session"
5862 .It Li "client_termfeatures" Ta "" Ta "Terminal features of client, if any"
5863 .It Li "client_termname" Ta "" Ta "Terminal name of client"
5864 .It Li "client_termtype" Ta "" Ta "Terminal type of client, if available"
5865 .It Li "client_tty" Ta "" Ta "Pseudo terminal of client"
5866 .It Li "client_uid" Ta "" Ta "UID of client process"
5867 .It Li "client_user" Ta "" Ta "User of client process"
5868 .It Li "client_utf8" Ta "" Ta "1 if client supports UTF-8"
5869 .It Li "client_width" Ta "" Ta "Width of client"
5870 .It Li "client_written" Ta "" Ta "Bytes written to client"
5871 .It Li "command" Ta "" Ta "Name of command in use, if any"
5872 .It Li "command_list_alias" Ta "" Ta "Command alias if listing commands"
5873 .It Li "command_list_name" Ta "" Ta "Command name if listing commands"
5874 .It Li "command_list_usage" Ta "" Ta "Command usage if listing commands"
5875 .It Li "config_files" Ta "" Ta "List of configuration files loaded"
5876 .It Li "copy_cursor_hyperlink" Ta "" Ta "Hyperlink under cursor in copy mode"
5877 .It Li "copy_cursor_line" Ta "" Ta "Line the cursor is on in copy mode"
5878 .It Li "copy_cursor_word" Ta "" Ta "Word under cursor in copy mode"
5879 .It Li "copy_cursor_x" Ta "" Ta "Cursor X position in copy mode"
5880 .It Li "copy_cursor_y" Ta "" Ta "Cursor Y position in copy mode"
5881 .It Li "current_file" Ta "" Ta "Current configuration file"
5882 .It Li "cursor_character" Ta "" Ta "Character at cursor in pane"
5883 .It Li "cursor_flag" Ta "" Ta "Pane cursor flag"
5884 .It Li "cursor_x" Ta "" Ta "Cursor X position in pane"
5885 .It Li "cursor_y" Ta "" Ta "Cursor Y position in pane"
5886 .It Li "history_bytes" Ta "" Ta "Number of bytes in window history"
5887 .It Li "history_limit" Ta "" Ta "Maximum window history lines"
5888 .It Li "history_size" Ta "" Ta "Size of history in lines"
5889 .It Li "hook" Ta "" Ta "Name of running hook, if any"
5890 .It Li "hook_client" Ta "" Ta "Name of client where hook was run, if any"
5891 .It Li "hook_pane" Ta "" Ta "ID of pane where hook was run, if any"
5892 .It Li "hook_session" Ta "" Ta "ID of session where hook was run, if any"
5893 .It Li "hook_session_name" Ta "" Ta "Name of session where hook was run, if any"
5894 .It Li "hook_window" Ta "" Ta "ID of window where hook was run, if any"
5895 .It Li "hook_window_name" Ta "" Ta "Name of window where hook was run, if any"
5896 .It Li "host" Ta "#H" Ta "Hostname of local host"
5897 .It Li "host_short" Ta "#h" Ta "Hostname of local host (no domain name)"
5898 .It Li "insert_flag" Ta "" Ta "Pane insert flag"
5899 .It Li "keypad_cursor_flag" Ta "" Ta "Pane keypad cursor flag"
5900 .It Li "keypad_flag" Ta "" Ta "Pane keypad flag"
5901 .It Li "last_window_index" Ta "" Ta "Index of last window in session"
5902 .It Li "line" Ta "" Ta "Line number in the list"
5903 .It Li "mouse_all_flag" Ta "" Ta "Pane mouse all flag"
5904 .It Li "mouse_any_flag" Ta "" Ta "Pane mouse any flag"
5905 .It Li "mouse_button_flag" Ta "" Ta "Pane mouse button flag"
5906 .It Li "mouse_hyperlink" Ta "" Ta "Hyperlink under mouse, if any"
5907 .It Li "mouse_line" Ta "" Ta "Line under mouse, if any"
5908 .It Li "mouse_sgr_flag" Ta "" Ta "Pane mouse SGR flag"
5909 .It Li "mouse_standard_flag" Ta "" Ta "Pane mouse standard flag"
5910 .It Li "mouse_status_line" Ta "" Ta "Status line on which mouse event took place"
5911 .It Li "mouse_status_range" Ta "" Ta "Range type or argument of mouse event on status line"
5912 .It Li "mouse_utf8_flag" Ta "" Ta "Pane mouse UTF-8 flag"
5913 .It Li "mouse_word" Ta "" Ta "Word under mouse, if any"
5914 .It Li "mouse_x" Ta "" Ta "Mouse X position, if any"
5915 .It Li "mouse_y" Ta "" Ta "Mouse Y position, if any"
5916 .It Li "next_session_id" Ta "" Ta "Unique session ID for next new session"
5917 .It Li "origin_flag" Ta "" Ta "Pane origin flag"
5918 .It Li "pane_active" Ta "" Ta "1 if active pane"
5919 .It Li "pane_at_bottom" Ta "" Ta "1 if pane is at the bottom of window"
5920 .It Li "pane_at_left" Ta "" Ta "1 if pane is at the left of window"
5921 .It Li "pane_at_right" Ta "" Ta "1 if pane is at the right of window"
5922 .It Li "pane_at_top" Ta "" Ta "1 if pane is at the top of window"
5923 .It Li "pane_bg" Ta "" Ta "Pane background colour"
5924 .It Li "pane_bottom" Ta "" Ta "Bottom of pane"
5925 .It Li "pane_current_command" Ta "" Ta "Current command if available"
5926 .It Li "pane_current_path" Ta "" Ta "Current path if available"
5927 .It Li "pane_dead" Ta "" Ta "1 if pane is dead"
5928 .It Li "pane_dead_signal" Ta "" Ta "Exit signal of process in dead pane"
5929 .It Li "pane_dead_status" Ta "" Ta "Exit status of process in dead pane"
5930 .It Li "pane_dead_time" Ta "" Ta "Exit time of process in dead pane"
5931 .It Li "pane_fg" Ta "" Ta "Pane foreground colour"
5932 .It Li "pane_format" Ta "" Ta "1 if format is for a pane"
5933 .It Li "pane_height" Ta "" Ta "Height of pane"
5934 .It Li "pane_id" Ta "#D" Ta "Unique pane ID"
5935 .It Li "pane_in_mode" Ta "" Ta "1 if pane is in a mode"
5936 .It Li "pane_index" Ta "#P" Ta "Index of pane"
5937 .It Li "pane_input_off" Ta "" Ta "1 if input to pane is disabled"
5938 .It Li "pane_key_mode" Ta "" Ta "Extended key reporting mode in this pane"
5939 .It Li "pane_last" Ta "" Ta "1 if last pane"
5940 .It Li "pane_left" Ta "" Ta "Left of pane"
5941 .It Li "pane_marked" Ta "" Ta "1 if this is the marked pane"
5942 .It Li "pane_marked_set" Ta "" Ta "1 if a marked pane is set"
5943 .It Li "pane_mode" Ta "" Ta "Name of pane mode, if any"
5944 .It Li "pane_path" Ta "" Ta "Path of pane (can be set by application)"
5945 .It Li "pane_pid" Ta "" Ta "PID of first process in pane"
5946 .It Li "pane_pipe" Ta "" Ta "1 if pane is being piped"
5947 .It Li "pane_right" Ta "" Ta "Right of pane"
5948 .It Li "pane_search_string" Ta "" Ta "Last search string in copy mode"
5949 .It Li "pane_start_command" Ta "" Ta "Command pane started with"
5950 .It Li "pane_start_path" Ta "" Ta "Path pane started with"
5951 .It Li "pane_synchronized" Ta "" Ta "1 if pane is synchronized"
5952 .It Li "pane_tabs" Ta "" Ta "Pane tab positions"
5953 .It Li "pane_title" Ta "#T" Ta "Title of pane (can be set by application)"
5954 .It Li "pane_top" Ta "" Ta "Top of pane"
5955 .It Li "pane_tty" Ta "" Ta "Pseudo terminal of pane"
5956 .It Li "pane_unseen_changes" Ta "" Ta "1 if there were changes in pane while in mode"
5957 .It Li "pane_width" Ta "" Ta "Width of pane"
5958 .It Li "pid" Ta "" Ta "Server PID"
5959 .It Li "rectangle_toggle" Ta "" Ta "1 if rectangle selection is activated"
5960 .It Li "scroll_position" Ta "" Ta "Scroll position in copy mode"
5961 .It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane"
5962 .It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane"
5963 .It Li "search_count" Ta "" Ta "Count of search results"
5964 .It Li "search_count_partial" Ta "" Ta "1 if search count is partial count"
5965 .It Li "search_match" Ta "" Ta "Search match if any"
5966 .It Li "search_present" Ta "" Ta "1 if search started in copy mode"
5967 .It Li "selection_active" Ta "" Ta "1 if selection started and changes with the cursor in copy mode"
5968 .It Li "selection_end_x" Ta "" Ta "X position of the end of the selection"
5969 .It Li "selection_end_y" Ta "" Ta "Y position of the end of the selection"
5970 .It Li "selection_present" Ta "" Ta "1 if selection started in copy mode"
5971 .It Li "selection_start_x" Ta "" Ta "X position of the start of the selection"
5972 .It Li "selection_start_y" Ta "" Ta "Y position of the start of the selection"
5973 .It Li "server_sessions" Ta "" Ta "Number of sessions"
5974 .It Li "session_activity" Ta "" Ta "Time of session last activity"
5975 .It Li "session_alerts" Ta "" Ta "List of window indexes with alerts"
5976 .It Li "session_attached" Ta "" Ta "Number of clients session is attached to"
5977 .It Li "session_attached_list" Ta "" Ta "List of clients session is attached to"
5978 .It Li "session_created" Ta "" Ta "Time session created"
5979 .It Li "session_format" Ta "" Ta "1 if format is for a session"
5980 .It Li "session_group" Ta "" Ta "Name of session group"
5981 .It Li "session_group_attached" Ta "" Ta "Number of clients sessions in group are attached to"
5982 .It Li "session_group_attached_list" Ta "" Ta "List of clients sessions in group are attached to"
5983 .It Li "session_group_list" Ta "" Ta "List of sessions in group"
5984 .It Li "session_group_many_attached" Ta "" Ta "1 if multiple clients attached to sessions in group"
5985 .It Li "session_group_size" Ta "" Ta "Size of session group"
5986 .It Li "session_grouped" Ta "" Ta "1 if session in a group"
5987 .It Li "session_id" Ta "" Ta "Unique session ID"
5988 .It Li "session_last_attached" Ta "" Ta "Time session last attached"
5989 .It Li "session_many_attached" Ta "" Ta "1 if multiple clients attached"
5990 .It Li "session_marked" Ta "" Ta "1 if this session contains the marked pane"
5991 .It Li "session_name" Ta "#S" Ta "Name of session"
5992 .It Li "session_path" Ta "" Ta "Working directory of session"
5993 .It Li "session_stack" Ta "" Ta "Window indexes in most recent order"
5994 .It Li "session_windows" Ta "" Ta "Number of windows in session"
5995 .It Li "socket_path" Ta "" Ta "Server socket path"
5996 .It Li "sixel_support" Ta "" Ta "1 if server has support for SIXEL"
5997 .It Li "start_time" Ta "" Ta "Server start time"
5998 .It Li "uid" Ta "" Ta "Server UID"
5999 .It Li "user" Ta "" Ta "Server user"
6000 .It Li "version" Ta "" Ta "Server version"
6001 .It Li "window_active" Ta "" Ta "1 if window active"
6002 .It Li "window_active_clients" Ta "" Ta "Number of clients viewing this window"
6003 .It Li "window_active_clients_list" Ta "" Ta "List of clients viewing this window"
6004 .It Li "window_active_sessions" Ta "" Ta "Number of sessions on which this window is active"
6005 .It Li "window_active_sessions_list" Ta "" Ta "List of sessions on which this window is active"
6006 .It Li "window_activity" Ta "" Ta "Time of window last activity"
6007 .It Li "window_activity_flag" Ta "" Ta "1 if window has activity"
6008 .It Li "window_bell_flag" Ta "" Ta "1 if window has bell"
6009 .It Li "window_bigger" Ta "" Ta "1 if window is larger than client"
6010 .It Li "window_cell_height" Ta "" Ta "Height of each cell in pixels"
6011 .It Li "window_cell_width" Ta "" Ta "Width of each cell in pixels"
6012 .It Li "window_end_flag" Ta "" Ta "1 if window has the highest index"
6013 .It Li "window_flags" Ta "#F" Ta "Window flags with # escaped as ##"
6014 .It Li "window_format" Ta "" Ta "1 if format is for a window"
6015 .It Li "window_height" Ta "" Ta "Height of window"
6016 .It Li "window_id" Ta "" Ta "Unique window ID"
6017 .It Li "window_index" Ta "#I" Ta "Index of window"
6018 .It Li "window_last_flag" Ta "" Ta "1 if window is the last used"
6019 .It Li "window_layout" Ta "" Ta "Window layout description, ignoring zoomed window panes"
6020 .It Li "window_linked" Ta "" Ta "1 if window is linked across sessions"
6021 .It Li "window_linked_sessions" Ta "" Ta "Number of sessions this window is linked to"
6022 .It Li "window_linked_sessions_list" Ta "" Ta "List of sessions this window is linked to"
6023 .It Li "window_marked_flag" Ta "" Ta "1 if window contains the marked pane"
6024 .It Li "window_name" Ta "#W" Ta "Name of window"
6025 .It Li "window_offset_x" Ta "" Ta "X offset into window if larger than client"
6026 .It Li "window_offset_y" Ta "" Ta "Y offset into window if larger than client"
6027 .It Li "window_panes" Ta "" Ta "Number of panes in window"
6028 .It Li "window_raw_flags" Ta "" Ta "Window flags with nothing escaped"
6029 .It Li "window_silence_flag" Ta "" Ta "1 if window has silence alert"
6030 .It Li "window_stack_index" Ta "" Ta "Index in session most recent stack"
6031 .It Li "window_start_flag" Ta "" Ta "1 if window has the lowest index"
6032 .It Li "window_visible_layout" Ta "" Ta "Window layout description, respecting zoomed window panes"
6033 .It Li "window_width" Ta "" Ta "Width of window"
6034 .It Li "window_zoomed_flag" Ta "" Ta "1 if window is zoomed"
6035 .It Li "wrap_flag" Ta "" Ta "Pane wrap flag"
6037 .Sh STYLES
6039 offers various options to specify the colour and attributes of aspects of the
6040 interface, for example
6041 .Ic status-style
6042 for the status line.
6043 In addition, embedded styles may be specified in format options, such as
6044 .Ic status-left ,
6045 by enclosing them in
6046 .Ql #[
6048 .Ql \&] .
6050 A style may be the single term
6051 .Ql default
6052 to specify the default style (which may come from an option, for example
6053 .Ic status-style
6054 in the status line) or a space
6055 or comma separated list of the following:
6056 .Bl -tag -width Ds
6057 .It Ic fg=colour
6058 Set the foreground colour.
6059 The colour is one of:
6060 .Ic black ,
6061 .Ic red ,
6062 .Ic green ,
6063 .Ic yellow ,
6064 .Ic blue ,
6065 .Ic magenta ,
6066 .Ic cyan ,
6067 .Ic white ;
6068 if supported the bright variants
6069 .Ic brightred ,
6070 .Ic brightgreen ,
6071 .Ic brightyellow ;
6072 .Ic colour0
6074 .Ic colour255
6075 from the 256-colour set;
6076 .Ic default
6077 for the default colour;
6078 .Ic terminal
6079 for the terminal default colour; or a hexadecimal RGB string such as
6080 .Ql #ffffff .
6081 .It Ic bg=colour
6082 Set the background colour.
6083 .It Ic us=colour
6084 Set the underscore colour.
6085 .It Ic none
6086 Set no attributes (turn off any active attributes).
6087 .It Xo Ic acs ,
6088 .Ic bright
6090 .Ic bold ) ,
6091 .Ic dim ,
6092 .Ic underscore ,
6093 .Ic blink ,
6094 .Ic reverse ,
6095 .Ic hidden ,
6096 .Ic italics ,
6097 .Ic overline ,
6098 .Ic strikethrough ,
6099 .Ic double-underscore ,
6100 .Ic curly-underscore ,
6101 .Ic dotted-underscore ,
6102 .Ic dashed-underscore
6104 Set an attribute.
6105 Any of the attributes may be prefixed with
6106 .Ql no
6107 to unset.
6108 .Ic acs
6109 is the terminal alternate character set.
6110 .It Xo Ic align=left
6112 .Ic noalign ) ,
6113 .Ic align=centre ,
6114 .Ic align=right
6116 Align text to the left, centre or right of the available space if appropriate.
6117 .It Ic fill=colour
6118 Fill the available space with a background colour if appropriate.
6119 .It Xo Ic list=on ,
6120 .Ic list=focus ,
6121 .Ic list=left-marker ,
6122 .Ic list=right-marker ,
6123 .Ic nolist
6125 Mark the position of the various window list components in the
6126 .Ic status-format
6127 option:
6128 .Ic list=on
6129 marks the start of the list;
6130 .Ic list=focus
6131 is the part of the list that should be kept in focus if the entire list won't
6132 fit in the available space (typically the current window);
6133 .Ic list=left-marker
6135 .Ic list=right-marker
6136 mark the text to be used to mark that text has been trimmed from the left or
6137 right of the list if there is not enough space.
6138 .It Xo Ic push-default ,
6139 .Ic pop-default
6141 Store the current colours and attributes as the default or reset to the previous
6142 default.
6144 .Ic push-default
6145 affects any subsequent use of the
6146 .Ic default
6147 term until a
6148 .Ic pop-default .
6149 Only one default may be pushed (each
6150 .Ic push-default
6151 replaces the previous saved default).
6152 .It Xo Ic range=left ,
6153 .Ic range=right ,
6154 .Ic range=session|X ,
6155 .Ic range=window|X ,
6156 .Ic range=pane|X ,
6157 .Ic range=user|X ,
6158 .Ic norange
6160 Mark a range for mouse events in the
6161 .Ic status-format
6162 option.
6163 When a mouse event occurs in the
6164 .Ic range=left
6166 .Ic range=right
6167 range, the
6168 .Ql StatusLeft
6170 .Ql StatusRight
6171 key bindings are triggered.
6173 .Ic range=session|X ,
6174 .Ic range=window|X
6176 .Ic range=pane|X
6177 are ranges for a session, window or pane.
6178 These trigger the
6179 .Ql Status
6180 mouse key with the target session, window or pane given by the
6181 .Ql X
6182 argument.
6183 .Ql X
6184 is a session ID, window index in the current session or a pane ID.
6185 For these, the
6186 .Ic mouse_status_range
6187 format variable will be set to
6188 .Ql session ,
6189 .Ql window
6191 .Ql pane .
6193 .Ic range=user|X
6194 is a user-defined range; it triggers the
6195 .Ql Status
6196 mouse key.
6197 The argument
6198 .Ql X
6199 will be available in the
6200 .Ic mouse_status_range
6201 format variable.
6202 .Ql X
6203 must be at most 15 bytes in length.
6206 Examples are:
6207 .Bd -literal -offset indent
6208 fg=yellow bold underscore blink
6209 bg=black,fg=default,noreverse
6211 .Sh NAMES AND TITLES
6213 distinguishes between names and titles.
6214 Windows and sessions have names, which may be used to specify them in targets
6215 and are displayed in the status line and various lists: the name is the
6217 identifier for a window or session.
6218 Only panes have titles.
6219 A pane's title is typically set by the program running inside the pane using
6220 an escape sequence (like it would set the
6221 .Xr xterm 1
6222 window title in
6223 .Xr X 7 ) .
6224 Windows themselves do not have titles - a window's title is the title of its
6225 active pane.
6227 itself may set the title of the terminal in which the client is running, see
6229 .Ic set-titles
6230 option.
6232 A session's name is set with the
6233 .Ic new-session
6235 .Ic rename-session
6236 commands.
6237 A window's name is set with one of:
6238 .Bl -enum -width Ds
6240 A command argument (such as
6241 .Fl n
6243 .Ic new-window
6245 .Ic new-session ) .
6247 An escape sequence (if the
6248 .Ic allow-rename
6249 option is turned on):
6250 .Bd -literal -offset indent
6251 $ printf \[aq]\e033kWINDOW_NAME\e033\e\e\[aq]
6254 Automatic renaming, which sets the name to the active command in the window's
6255 active pane.
6256 See the
6257 .Ic automatic-rename
6258 option.
6261 When a pane is first created, its title is the hostname.
6262 A pane's title can be set via the title setting escape sequence, for example:
6263 .Bd -literal -offset indent
6264 $ printf \[aq]\e033]2;My Title\e033\e\e\[aq]
6267 It can also be modified with the
6268 .Ic select-pane
6269 .Fl T
6270 command.
6271 .Sh GLOBAL AND SESSION ENVIRONMENT
6272 When the server is started,
6274 copies the environment into the
6275 .Em global environment ;
6276 in addition, each session has a
6277 .Em session environment .
6278 When a window is created, the session and global environments are merged.
6279 If a variable exists in both, the value from the session environment is used.
6280 The result is the initial environment passed to the new process.
6283 .Ic update-environment
6284 session option may be used to update the session environment from the client
6285 when a new session is created or an old reattached.
6287 also initialises the
6288 .Ev TMUX
6289 variable with some internal information to allow commands to be executed
6290 from inside, and the
6291 .Ev TERM
6292 variable with the correct terminal setting of
6293 .Ql screen .
6295 Variables in both session and global environments may be marked as hidden.
6296 Hidden variables are not passed into the environment of new processes and
6297 instead can only be used by tmux itself (for example in formats, see the
6298 .Sx FORMATS
6299 section).
6301 Commands to alter and view the environment are:
6302 .Bl -tag -width Ds
6303 .Tg setenv
6304 .It Xo Ic set-environment
6305 .Op Fl Fhgru
6306 .Op Fl t Ar target-session
6307 .Ar name Op Ar value
6309 .D1 Pq alias: Ic setenv
6310 Set or unset an environment variable.
6312 .Fl g
6313 is used, the change is made in the global environment; otherwise, it is applied
6314 to the session environment for
6315 .Ar target-session .
6317 .Fl F
6318 is present, then
6319 .Ar value
6320 is expanded as a format.
6322 .Fl u
6323 flag unsets a variable.
6324 .Fl r
6325 indicates the variable is to be removed from the environment before starting a
6326 new process.
6327 .Fl h
6328 marks the variable as hidden.
6329 .Tg showenv
6330 .It Xo Ic show-environment
6331 .Op Fl hgs
6332 .Op Fl t Ar target-session
6333 .Op Ar variable
6335 .D1 Pq alias: Ic showenv
6336 Display the environment for
6337 .Ar target-session
6338 or the global environment with
6339 .Fl g .
6341 .Ar variable
6342 is omitted, all variables are shown.
6343 Variables removed from the environment are prefixed with
6344 .Ql - .
6346 .Fl s
6347 is used, the output is formatted as a set of Bourne shell commands.
6348 .Fl h
6349 shows hidden variables (omitted by default).
6351 .Sh STATUS LINE
6353 includes an optional status line which is displayed in the bottom line of each
6354 terminal.
6356 By default, the status line is enabled and one line in height (it may be
6357 disabled or made multiple lines with the
6358 .Ic status
6359 session option) and contains, from left-to-right: the name of the current
6360 session in square brackets; the window list; the title of the active pane
6361 in double quotes; and the time and date.
6363 Each line of the status line is configured with the
6364 .Ic status-format
6365 option.
6366 The default is made of three parts: configurable left and right sections (which
6367 may contain dynamic content such as the time or output from a shell command,
6368 see the
6369 .Ic status-left ,
6370 .Ic status-left-length ,
6371 .Ic status-right ,
6373 .Ic status-right-length
6374 options below), and a central window list.
6375 By default, the window list shows the index, name and (if any) flag of the
6376 windows present in the current session in ascending numerical order.
6377 It may be customised with the
6378 .Ar window-status-format
6380 .Ar window-status-current-format
6381 options.
6382 The flag is one of the following symbols appended to the window name:
6383 .Bl -column "Symbol" "Meaning" -offset indent
6384 .It Sy "Symbol" Ta Sy "Meaning"
6385 .It Li "*" Ta "Denotes the current window."
6386 .It Li "-" Ta "Marks the last window (previously selected)."
6387 .It Li "#" Ta "Window activity is monitored and activity has been detected."
6388 .It Li "\&!" Ta "Window bells are monitored and a bell has occurred in the window."
6389 .It Li "\[ti]" Ta "The window has been silent for the monitor-silence interval."
6390 .It Li "M" Ta "The window contains the marked pane."
6391 .It Li "Z" Ta "The window's active pane is zoomed."
6394 The # symbol relates to the
6395 .Ic monitor-activity
6396 window option.
6397 The window name is printed in inverted colours if an alert (bell, activity or
6398 silence) is present.
6400 The colour and attributes of the status line may be configured, the entire
6401 status line using the
6402 .Ic status-style
6403 session option and individual windows using the
6404 .Ic window-status-style
6405 window option.
6407 The status line is automatically refreshed at interval if it has changed, the
6408 interval may be controlled with the
6409 .Ic status-interval
6410 session option.
6412 Commands related to the status line are as follows:
6413 .Bl -tag -width Ds
6414 .Tg clearphist
6415 .It Xo Ic clear-prompt-history
6416 .Op Fl T Ar prompt-type
6418 .D1 Pq alias: Ic clearphist
6419 Clear status prompt history for prompt type
6420 .Ar prompt-type .
6422 .Fl T
6423 is omitted, then clear history for all types.
6425 .Ic command-prompt
6426 for possible values for
6427 .Ar prompt-type .
6428 .It Xo Ic command-prompt
6429 .Op Fl 1bFikN
6430 .Op Fl I Ar inputs
6431 .Op Fl p Ar prompts
6432 .Op Fl t Ar target-client
6433 .Op Fl T Ar prompt-type
6434 .Op Ar template
6436 Open the command prompt in a client.
6437 This may be used from inside
6439 to execute commands interactively.
6442 .Ar template
6443 is specified, it is used as the command.
6444 With
6445 .Fl F ,
6446 .Ar template
6447 is expanded as a format.
6449 If present,
6450 .Fl I
6451 is a comma-separated list of the initial text for each prompt.
6453 .Fl p
6454 is given,
6455 .Ar prompts
6456 is a comma-separated list of prompts which are displayed in order; otherwise
6457 a single prompt is displayed, constructed from
6458 .Ar template
6459 if it is present, or
6460 .Ql \&:
6461 if not.
6463 Before the command is executed, the first occurrence of the string
6464 .Ql %%
6465 and all occurrences of
6466 .Ql %1
6467 are replaced by the response to the first prompt, all
6468 .Ql %2
6469 are replaced with the response to the second prompt, and so on for further
6470 prompts.
6471 Up to nine prompt responses may be replaced
6473 .Ql %1
6475 .Ql %9
6476 .Pc .
6477 .Ql %%%
6478 is like
6479 .Ql %%
6480 but any quotation marks are escaped.
6482 .Fl 1
6483 makes the prompt only accept one key press, in this case the resulting input
6484 is a single character.
6485 .Fl k
6486 is like
6487 .Fl 1
6488 but the key press is translated to a key name.
6489 .Fl N
6490 makes the prompt only accept numeric key presses.
6491 .Fl i
6492 executes the command every time the prompt input changes instead of when the
6493 user exits the command prompt.
6495 .Fl T
6496 tells
6498 the prompt type.
6499 This affects what completions are offered when
6500 .Em Tab
6501 is pressed.
6502 Available types are:
6503 .Ql command ,
6504 .Ql search ,
6505 .Ql target
6507 .Ql window-target .
6509 The following keys have a special meaning in the command prompt, depending
6510 on the value of the
6511 .Ic status-keys
6512 option:
6513 .Bl -column "FunctionXXXXXXXXXXXXXXXXXXXXXXXXX" "viXXXX" "emacsX" -offset indent
6514 .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
6515 .It Li "Cancel command prompt" Ta "q" Ta "Escape"
6516 .It Li "Delete from cursor to start of word" Ta "" Ta "C-w"
6517 .It Li "Delete entire command" Ta "d" Ta "C-u"
6518 .It Li "Delete from cursor to end" Ta "D" Ta "C-k"
6519 .It Li "Execute command" Ta "Enter" Ta "Enter"
6520 .It Li "Get next command from history" Ta "" Ta "Down"
6521 .It Li "Get previous command from history" Ta "" Ta "Up"
6522 .It Li "Insert top paste buffer" Ta "p" Ta "C-y"
6523 .It Li "Look for completions" Ta "Tab" Ta "Tab"
6524 .It Li "Move cursor left" Ta "h" Ta "Left"
6525 .It Li "Move cursor right" Ta "l" Ta "Right"
6526 .It Li "Move cursor to end" Ta "$" Ta "C-e"
6527 .It Li "Move cursor to next word" Ta "w" Ta "M-f"
6528 .It Li "Move cursor to previous word" Ta "b" Ta "M-b"
6529 .It Li "Move cursor to start" Ta "0" Ta "C-a"
6530 .It Li "Transpose characters" Ta "" Ta "C-t"
6533 With
6534 .Fl b ,
6535 the prompt is shown in the background and the invoking client does not exit
6536 until it is dismissed.
6537 .Tg confirm
6538 .It Xo Ic confirm-before
6539 .Op Fl by
6540 .Op Fl c Ar confirm-key
6541 .Op Fl p Ar prompt
6542 .Op Fl t Ar target-client
6543 .Ar command
6545 .D1 Pq alias: Ic confirm
6546 Ask for confirmation before executing
6547 .Ar command .
6549 .Fl p
6550 is given,
6551 .Ar prompt
6552 is the prompt to display; otherwise a prompt is constructed from
6553 .Ar command .
6554 It may contain the special character sequences supported by the
6555 .Ic status-left
6556 option.
6557 With
6558 .Fl b ,
6559 the prompt is shown in the background and the invoking client does not exit
6560 until it is dismissed.
6561 .Fl y
6562 changes the default behaviour (if Enter alone is pressed) of the prompt to
6563 run the command.
6564 .Fl c
6565 changes the confirmation key to
6566 .Ar confirm-key ;
6567 the default is
6568 .Ql y .
6569 .Tg menu
6570 .It Xo Ic display-menu
6571 .Op Fl OM
6572 .Op Fl b Ar border-lines
6573 .Op Fl c Ar target-client
6574 .Op Fl C Ar starting-choice
6575 .Op Fl H Ar selected-style
6576 .Op Fl s Ar style
6577 .Op Fl S Ar border-style
6578 .Op Fl t Ar target-pane
6579 .Op Fl T Ar title
6580 .Op Fl x Ar position
6581 .Op Fl y Ar position
6582 .Ar name
6583 .Ar key
6584 .Ar command Op Ar argument ...
6586 .D1 Pq alias: Ic menu
6587 Display a menu on
6588 .Ar target-client .
6589 .Ar target-pane
6590 gives the target for any commands run from the menu.
6592 A menu is passed as a series of arguments: first the menu item name,
6593 second the key shortcut (or empty for none) and third the command
6594 to run when the menu item is chosen.
6595 The name and command are formats, see the
6596 .Sx FORMATS
6598 .Sx STYLES
6599 sections.
6600 If the name begins with a hyphen (-), then the item is disabled (shown dim) and
6601 may not be chosen.
6602 The name may be empty for a separator line, in which case both the key and
6603 command should be omitted.
6605 .Fl b
6606 sets the type of characters used for drawing menu borders.
6608 .Ic popup-border-lines
6609 for possible values for
6610 .Ar border-lines .
6612 .Fl H
6613 sets the style for the selected menu item (see
6614 .Sx STYLES ) .
6616 .Fl s
6617 sets the style for the menu and
6618 .Fl S
6619 sets the style for the menu border (see
6620 .Sx STYLES ) .
6622 .Fl T
6623 is a format for the menu title (see
6624 .Sx FORMATS ) .
6626 .Fl C
6627 sets the menu item selected by default, if the menu is not bound to a mouse key
6628 binding.
6630 .Fl x
6632 .Fl y
6633 give the position of the menu.
6634 Both may be a row or column number, or one of the following special values:
6635 .Bl -column "XXXXX" "XXXX" -offset indent
6636 .It Sy "Value" Ta Sy "Flag" Ta Sy "Meaning"
6637 .It Li "C" Ta "Both" Ta "The centre of the terminal"
6638 .It Li "R" Ta Fl x Ta "The right side of the terminal"
6639 .It Li "P" Ta "Both" Ta "The bottom left of the pane"
6640 .It Li "M" Ta "Both" Ta "The mouse position"
6641 .It Li "W" Ta "Both" Ta "The window position on the status line"
6642 .It Li "S" Ta Fl y Ta "The line above or below the status line"
6645 Or a format, which is expanded including the following additional variables:
6646 .Bl -column "XXXXXXXXXXXXXXXXXXXXXXXXXX" -offset indent
6647 .It Sy "Variable name" Ta Sy "Replaced with"
6648 .It Li "popup_centre_x" Ta "Centered in the client"
6649 .It Li "popup_centre_y" Ta "Centered in the client"
6650 .It Li "popup_height" Ta "Height of menu or popup"
6651 .It Li "popup_mouse_bottom" Ta "Bottom of at the mouse"
6652 .It Li "popup_mouse_centre_x" Ta "Horizontal centre at the mouse"
6653 .It Li "popup_mouse_centre_y" Ta "Vertical centre at the mouse"
6654 .It Li "popup_mouse_top" Ta "Top at the mouse"
6655 .It Li "popup_mouse_x" Ta "Mouse X position"
6656 .It Li "popup_mouse_y" Ta "Mouse Y position"
6657 .It Li "popup_pane_bottom" Ta "Bottom of the pane"
6658 .It Li "popup_pane_left" Ta "Left of the pane"
6659 .It Li "popup_pane_right" Ta "Right of the pane"
6660 .It Li "popup_pane_top" Ta "Top of the pane"
6661 .It Li "popup_status_line_y" Ta "Above or below the status line"
6662 .It Li "popup_width" Ta "Width of menu or popup"
6663 .It Li "popup_window_status_line_x" Ta "At the window position in status line"
6664 .It Li "popup_window_status_line_y" Ta "At the status line showing the window"
6667 Each menu consists of items followed by a key shortcut shown in brackets.
6668 If the menu is too large to fit on the terminal, it is not displayed.
6669 Pressing the key shortcut chooses the corresponding item.
6670 If the mouse is enabled and the menu is opened from a mouse key binding,
6671 releasing the mouse button with an item selected chooses that item and
6672 releasing the mouse button without an item selected closes the menu.
6673 .Fl O
6674 changes this behaviour so that the menu does not close when the mouse button is
6675 released without an item selected the menu is not closed and a mouse button
6676 must be clicked to choose an item.
6678 .Fl M
6679 tells
6681 the menu should handle mouse events; by default only menus opened from mouse
6682 key bindings do so.
6684 The following keys are available in menus:
6685 .Bl -column "Key" "Function" -offset indent
6686 .It Sy "Key" Ta Sy "Function"
6687 .It Li "Enter" Ta "Choose selected item"
6688 .It Li "Up" Ta "Select previous item"
6689 .It Li "Down" Ta "Select next item"
6690 .It Li "q" Ta "Exit menu"
6692 .Tg display
6693 .It Xo Ic display-message
6694 .Op Fl aIlNpv
6695 .Op Fl c Ar target-client
6696 .Op Fl d Ar delay
6697 .Op Fl t Ar target-pane
6698 .Op Ar message
6700 .D1 Pq alias: Ic display
6701 Display a message.
6703 .Fl p
6704 is given, the output is printed to stdout, otherwise it is displayed in the
6705 .Ar target-client
6706 status line for up to
6707 .Ar delay
6708 milliseconds.
6710 .Ar delay
6711 is not given, the
6712 .Ic display-time
6713 option is used; a delay of zero waits for a key press.
6714 .Ql N
6715 ignores key presses and closes only after the delay expires.
6717 .Fl l
6718 is given,
6719 .Ar message
6720 is printed unchanged.
6721 Otherwise, the format of
6722 .Ar message
6723 is described in the
6724 .Sx FORMATS
6725 section; information is taken from
6726 .Ar target-pane
6728 .Fl t
6729 is given, otherwise the active pane.
6731 .Fl v
6732 prints verbose logging as the format is parsed and
6733 .Fl a
6734 lists the format variables and their values.
6736 .Fl I
6737 forwards any input read from stdin to the empty pane given by
6738 .Ar target-pane .
6739 .Tg popup
6740 .It Xo Ic display-popup
6741 .Op Fl BCE
6742 .Op Fl b Ar border-lines
6743 .Op Fl c Ar target-client
6744 .Op Fl d Ar start-directory
6745 .Op Fl e Ar environment
6746 .Op Fl h Ar height
6747 .Op Fl s Ar border-style
6748 .Op Fl S Ar style
6749 .Op Fl t Ar target-pane
6750 .Op Fl T Ar title
6751 .Op Fl w Ar width
6752 .Op Fl x Ar position
6753 .Op Fl y Ar position
6754 .Op Ar shell-command
6756 .D1 Pq alias: Ic popup
6757 Display a popup running
6758 .Ar shell-command
6760 .Ar target-client .
6761 A popup is a rectangular box drawn over the top of any panes.
6762 Panes are not updated while a popup is present.
6764 .Fl E
6765 closes the popup automatically when
6766 .Ar shell-command
6767 exits.
6769 .Fl E
6770 closes the popup only if
6771 .Ar shell-command
6772 exited with success.
6774 .Fl x
6776 .Fl y
6777 give the position of the popup, they have the same meaning as for the
6778 .Ic display-menu
6779 command.
6780 .Fl w
6782 .Fl h
6783 give the width and height - both may be a percentage (followed by
6784 .Ql % ) .
6785 If omitted, half of the terminal size is used.
6787 .Fl B
6788 does not surround the popup by a border.
6790 .Fl b
6791 sets the type of characters used for drawing popup borders.
6792 When
6793 .Fl B
6794 is specified, the
6795 .Fl b
6796 option is ignored.
6798 .Ic popup-border-lines
6799 for possible values for
6800 .Ar border-lines .
6802 .Fl s
6803 sets the style for the popup and
6804 .Fl S
6805 sets the style for the popup border (see
6806 .Sx STYLES ) .
6808 .Fl e
6809 takes the form
6810 .Ql VARIABLE=value
6811 and sets an environment variable for the popup; it may be specified multiple
6812 times.
6814 .Fl T
6815 is a format for the popup title (see
6816 .Sx FORMATS ) .
6819 .Fl C
6820 flag closes any popup on the client.
6821 .Tg showphist
6822 .It Xo Ic show-prompt-history
6823 .Op Fl T Ar prompt-type
6825 .D1 Pq alias: Ic showphist
6826 Display status prompt history for prompt type
6827 .Ar prompt-type .
6829 .Fl T
6830 is omitted, then show history for all types.
6832 .Ic command-prompt
6833 for possible values for
6834 .Ar prompt-type .
6836 .Sh BUFFERS
6838 maintains a set of named
6839 .Em paste buffers .
6840 Each buffer may be either explicitly or automatically named.
6841 Explicitly named buffers are named when created with the
6842 .Ic set-buffer
6844 .Ic load-buffer
6845 commands, or by renaming an automatically named buffer with
6846 .Ic set-buffer
6847 .Fl n .
6848 Automatically named buffers are given a name such as
6849 .Ql buffer0001 ,
6850 .Ql buffer0002
6851 and so on.
6852 When the
6853 .Ic buffer-limit
6854 option is reached, the oldest automatically named buffer is deleted.
6855 Explicitly named buffers are not subject to
6856 .Ic buffer-limit
6857 and may be deleted with the
6858 .Ic delete-buffer
6859 command.
6861 Buffers may be added using
6862 .Ic copy-mode
6863 or the
6864 .Ic set-buffer
6866 .Ic load-buffer
6867 commands, and pasted into a window using the
6868 .Ic paste-buffer
6869 command.
6870 If a buffer command is used and no buffer is specified, the most
6871 recently added automatically named buffer is assumed.
6873 A configurable history buffer is also maintained for each window.
6874 By default, up to 2000 lines are kept; this can be altered with the
6875 .Ic history-limit
6876 option (see the
6877 .Ic set-option
6878 command above).
6880 The buffer commands are as follows:
6881 .Bl -tag -width Ds
6882 .It Xo
6883 .Ic choose-buffer
6884 .Op Fl NryZ
6885 .Op Fl F Ar format
6886 .Op Fl f Ar filter
6887 .Op Fl K Ar key-format
6888 .Op Fl O Ar sort-order
6889 .Op Fl t Ar target-pane
6890 .Op Ar template
6892 Put a pane into buffer mode, where a buffer may be chosen interactively from
6893 a list.
6894 Each buffer is shown on one line.
6895 A shortcut key is shown on the left in brackets allowing for immediate choice,
6896 or the list may be navigated and an item chosen or otherwise manipulated using
6897 the keys below.
6898 .Fl Z
6899 zooms the pane.
6900 .Fl y
6901 disables any confirmation prompts.
6902 The following keys may be used in buffer mode:
6903 .Bl -column "Key" "Function" -offset indent
6904 .It Sy "Key" Ta Sy "Function"
6905 .It Li "Enter" Ta "Paste selected buffer"
6906 .It Li "Up" Ta "Select previous buffer"
6907 .It Li "Down" Ta "Select next buffer"
6908 .It Li "C-s" Ta "Search by name or content"
6909 .It Li "n" Ta "Repeat last search forwards"
6910 .It Li "N" Ta "Repeat last search backwards"
6911 .It Li "t" Ta "Toggle if buffer is tagged"
6912 .It Li "T" Ta "Tag no buffers"
6913 .It Li "C-t" Ta "Tag all buffers"
6914 .It Li "p" Ta "Paste selected buffer"
6915 .It Li "P" Ta "Paste tagged buffers"
6916 .It Li "d" Ta "Delete selected buffer"
6917 .It Li "D" Ta "Delete tagged buffers"
6918 .It Li "e" Ta "Open the buffer in an editor"
6919 .It Li "f" Ta "Enter a format to filter items"
6920 .It Li "O" Ta "Change sort field"
6921 .It Li "r" Ta "Reverse sort order"
6922 .It Li "v" Ta "Toggle preview"
6923 .It Li "q" Ta "Exit mode"
6926 After a buffer is chosen,
6927 .Ql %%
6928 is replaced by the buffer name in
6929 .Ar template
6930 and the result executed as a command.
6932 .Ar template
6933 is not given, "paste-buffer -p -b \[aq]%%\[aq]" is used.
6935 .Fl O
6936 specifies the initial sort field: one of
6937 .Ql time
6938 (creation),
6939 .Ql name
6941 .Ql size .
6942 .Fl r
6943 reverses the sort order.
6944 .Fl f
6945 specifies an initial filter: the filter is a format - if it evaluates to zero,
6946 the item in the list is not shown, otherwise it is shown.
6947 If a filter would lead to an empty list, it is ignored.
6948 .Fl F
6949 specifies the format for each item in the list and
6950 .Fl K
6951 a format for each shortcut key; both are evaluated once for each line.
6952 .Fl N
6953 starts without the preview.
6954 This command works only if at least one client is attached.
6955 .Tg clearhist
6956 .It Xo Ic clear-history
6957 .Op Fl H
6958 .Op Fl t Ar target-pane
6960 .D1 Pq alias: Ic clearhist
6961 Remove and free the history for the specified pane.
6962 .Fl H
6963 also removes all hyperlinks.
6964 .Tg deleteb
6965 .It Ic delete-buffer Op Fl b Ar buffer-name
6966 .D1 Pq alias: Ic deleteb
6967 Delete the buffer named
6968 .Ar buffer-name ,
6969 or the most recently added automatically named buffer if not specified.
6970 .Tg lsb
6971 .It Xo Ic list-buffers
6972 .Op Fl F Ar format
6973 .Op Fl f Ar filter
6975 .D1 Pq alias: Ic lsb
6976 List the global buffers.
6977 .Fl F
6978 specifies the format of each line and
6979 .Fl f
6980 a filter.
6981 Only buffers for which the filter is true are shown.
6982 See the
6983 .Sx FORMATS
6984 section.
6985 .It Xo Ic load-buffer
6986 .Op Fl w
6987 .Op Fl b Ar buffer-name
6988 .Op Fl t Ar target-client
6989 .Ar path
6991 .Tg loadb
6992 .D1 Pq alias: Ic loadb
6993 Load the contents of the specified paste buffer from
6994 .Ar path .
6996 .Fl w
6997 is given, the buffer is also sent to the clipboard for
6998 .Ar target-client
6999 using the
7000 .Xr xterm 1
7001 escape sequence, if possible.
7003 .Ar path
7005 .Ql - ,
7006 the contents are read from stdin.
7007 .Tg pasteb
7008 .It Xo Ic paste-buffer
7009 .Op Fl dpr
7010 .Op Fl b Ar buffer-name
7011 .Op Fl s Ar separator
7012 .Op Fl t Ar target-pane
7014 .D1 Pq alias: Ic pasteb
7015 Insert the contents of a paste buffer into the specified pane.
7016 If not specified, paste into the current one.
7017 With
7018 .Fl d ,
7019 also delete the paste buffer.
7020 When output, any linefeed (LF) characters in the paste buffer are replaced with
7021 a separator, by default carriage return (CR).
7022 A custom separator may be specified using the
7023 .Fl s
7024 flag.
7026 .Fl r
7027 flag means to do no replacement (equivalent to a separator of LF).
7029 .Fl p
7030 is specified, paste bracket control codes are inserted around the
7031 buffer if the application has requested bracketed paste mode.
7032 .Tg saveb
7033 .It Xo Ic save-buffer
7034 .Op Fl a
7035 .Op Fl b Ar buffer-name
7036 .Ar path
7038 .D1 Pq alias: Ic saveb
7039 Save the contents of the specified paste buffer to
7040 .Ar path .
7042 .Fl a
7043 option appends to rather than overwriting the file.
7045 .Ar path
7047 .Ql - ,
7048 the contents are read from stdin.
7049 .It Xo Ic set-buffer
7050 .Op Fl aw
7051 .Op Fl b Ar buffer-name
7052 .Op Fl t Ar target-client
7053 .Tg setb
7054 .Op Fl n Ar new-buffer-name
7055 .Ar data
7057 .D1 Pq alias: Ic setb
7058 Set the contents of the specified buffer to
7059 .Ar data .
7061 .Fl w
7062 is given, the buffer is also sent to the clipboard for
7063 .Ar target-client
7064 using the
7065 .Xr xterm 1
7066 escape sequence, if possible.
7068 .Fl a
7069 option appends to rather than overwriting the buffer.
7071 .Fl n
7072 option renames the buffer to
7073 .Ar new-buffer-name .
7074 .Tg showb
7075 .It Xo Ic show-buffer
7076 .Op Fl b Ar buffer-name
7078 .D1 Pq alias: Ic showb
7079 Display the contents of the specified buffer.
7081 .Sh MISCELLANEOUS
7082 Miscellaneous commands are as follows:
7083 .Bl -tag -width Ds
7084 .It Ic clock-mode Op Fl t Ar target-pane
7085 Display a large clock.
7086 .Tg if
7087 .It Xo Ic if-shell
7088 .Op Fl bF
7089 .Op Fl t Ar target-pane
7090 .Ar shell-command command
7091 .Op Ar command
7093 .D1 Pq alias: Ic if
7094 Execute the first
7095 .Ar command
7097 .Ar shell-command
7098 (run with
7099 .Pa /bin/sh )
7100 returns success or the second
7101 .Ar command
7102 otherwise.
7103 Before being executed,
7104 .Ar shell-command
7105 is expanded using the rules specified in the
7106 .Sx FORMATS
7107 section, including those relevant to
7108 .Ar target-pane .
7109 With
7110 .Fl b ,
7111 .Ar shell-command
7112 is run in the background.
7115 .Fl F
7116 is given,
7117 .Ar shell-command
7118 is not executed but considered success if neither empty nor zero (after formats
7119 are expanded).
7120 .Tg lock
7121 .It Ic lock-server
7122 .D1 Pq alias: Ic lock
7123 Lock each client individually by running the command specified by the
7124 .Ic lock-command
7125 option.
7126 .Tg run
7127 .It Xo Ic run-shell
7128 .Op Fl bC
7129 .Op Fl c Ar start-directory
7130 .Op Fl d Ar delay
7131 .Op Fl t Ar target-pane
7132 .Op Ar shell-command
7134 .D1 Pq alias: Ic run
7135 Execute
7136 .Ar shell-command
7137 using
7138 .Pa /bin/sh
7139 or (with
7140 .Fl C )
7143 command in the background without creating a window.
7144 Before being executed,
7145 .Ar shell-command
7146 is expanded using the rules specified in the
7147 .Sx FORMATS
7148 section.
7149 With
7150 .Fl b ,
7151 the command is run in the background.
7152 .Fl d
7153 waits for
7154 .Ar delay
7155 seconds before starting the command.
7157 .Fl c
7158 is given, the current working directory is set to
7159 .Ar start-directory .
7161 .Fl C
7162 is not given, any output to stdout is displayed in view mode (in the pane
7163 specified by
7164 .Fl t
7165 or the current pane if omitted) after the command finishes.
7166 If the command fails, the exit status is also displayed.
7167 .Tg wait
7168 .It Xo Ic wait-for
7169 .Op Fl L | S | U
7170 .Ar channel
7172 .D1 Pq alias: Ic wait
7173 When used without options, prevents the client from exiting until woken using
7174 .Ic wait-for
7175 .Fl S
7176 with the same channel.
7177 When
7178 .Fl L
7179 is used, the channel is locked and any clients that try to lock the same
7180 channel are made to wait until the channel is unlocked with
7181 .Ic wait-for
7182 .Fl U .
7184 .Sh EXIT MESSAGES
7185 When a
7187 client detaches, it prints a message.
7188 This may be one of:
7189 .Bl -tag -width Ds
7190 .It detached (from session ...)
7191 The client was detached normally.
7192 .It detached and SIGHUP
7193 The client was detached and its parent sent the
7194 .Dv SIGHUP
7195 signal (for example with
7196 .Ic detach-client
7197 .Fl P ) .
7198 .It lost tty
7199 The client's
7200 .Xr tty 4
7202 .Xr pty 4
7203 was unexpectedly destroyed.
7204 .It terminated
7205 The client was killed with
7206 .Dv SIGTERM .
7207 .It too far behind
7208 The client is in control mode and became unable to keep up with the data from
7209 .Nm .
7210 .It exited
7211 The server exited when it had no sessions.
7212 .It server exited
7213 The server exited when it received
7214 .Dv SIGTERM .
7215 .It server exited unexpectedly
7216 The server crashed or otherwise exited without telling the client the reason.
7218 .Sh TERMINFO EXTENSIONS
7220 understands some unofficial extensions to
7221 .Xr terminfo 5 .
7222 It is not normally necessary to set these manually, instead the
7223 .Ic terminal-features
7224 option should be used.
7225 .Bl -tag -width Ds
7226 .It Em \&AX
7227 An existing extension that tells
7229 the terminal supports default colours.
7230 .It Em \&Bidi
7231 Tell
7233 that the terminal supports the VTE bidirectional text extensions.
7234 .It Em \&Cs , Cr
7235 Set the cursor colour.
7236 The first takes a single string argument and is used to set the colour;
7237 the second takes no arguments and restores the default cursor colour.
7238 If set, a sequence such as this may be used
7239 to change the cursor colour from inside
7240 .Nm :
7241 .Bd -literal -offset indent
7242 $ printf \[aq]\e033]12;red\e033\e\e\[aq]
7245 The colour is an
7246 .Xr X 7
7247 colour, see
7248 .Xr XParseColor 3 .
7249 .It Em \&Cmg, \&Clmg, \&Dsmg , \&Enmg
7250 Set, clear, disable or enable DECSLRM margins.
7251 These are set automatically if the terminal reports it is
7252 .Em VT420
7253 compatible.
7254 .It Em \&Dsbp , \&Enbp
7255 Disable and enable bracketed paste.
7256 These are set automatically if the
7257 .Em XT
7258 capability is present.
7259 .It Em \&Dseks , \&Eneks
7260 Disable and enable extended keys.
7261 .It Em \&Dsfcs , \&Enfcs
7262 Disable and enable focus reporting.
7263 These are set automatically if the
7264 .Em XT
7265 capability is present.
7266 .It Em \&Hls
7267 Set or clear a hyperlink annotation.
7268 .It Em \&Nobr
7269 Tell
7271 that the terminal does not use bright colors for bold display.
7272 .It Em \&Rect
7273 Tell
7275 that the terminal supports rectangle operations.
7276 .It Em \&Smol
7277 Enable the overline attribute.
7278 .It Em \&Smulx
7279 Set a styled underscore.
7280 The single parameter is one of: 0 for no underscore, 1 for normal
7281 underscore, 2 for double underscore, 3 for curly underscore, 4 for dotted
7282 underscore and 5 for dashed underscore.
7283 .It Em \&Setulc , \&Setulc1, \&ol
7284 Set the underscore colour or reset to the default.
7285 .Em Setulc
7286 is for RGB colours and
7287 .Em Setulc1
7288 for ANSI or 256 colours.
7290 .Em Setulc
7291 argument is (red * 65536) + (green * 256) + blue where each is between 0
7292 and 255.
7293 .It Em \&Ss , Se
7294 Set or reset the cursor style.
7295 If set, a sequence such as this may be used
7296 to change the cursor to an underline:
7297 .Bd -literal -offset indent
7298 $ printf \[aq]\e033[4 q\[aq]
7302 .Em Se
7303 is not set, \&Ss with argument 0 will be used to reset the cursor style instead.
7304 .It Em \&Swd
7305 Set the opening sequence for the working directory notification.
7306 The sequence is terminated using the standard
7307 .Em fsl
7308 capability.
7309 .It Em \&Sxl
7310 Indicates that the terminal supports SIXEL.
7311 .It Em \&Sync
7312 Start (parameter is 1) or end (parameter is 2) a synchronized update.
7313 .It Em \&Tc
7314 Indicate that the terminal supports the
7315 .Ql direct colour
7316 RGB escape sequence (for example, \ee[38;2;255;255;255m).
7318 If supported, this is used for the initialize colour escape sequence (which
7319 may be enabled by adding the
7320 .Ql initc
7322 .Ql ccc
7323 capabilities to the
7325 .Xr terminfo 5
7326 entry).
7328 This is equivalent to the
7329 .Em RGB
7330 .Xr terminfo 5
7331 capability.
7332 .It Em \&Ms
7333 Store the current buffer in the host terminal's selection (clipboard).
7334 See the
7335 .Em set-clipboard
7336 option above and the
7337 .Xr xterm 1
7338 man page.
7339 .It Em \&XT
7340 This is an existing extension capability that tmux uses to mean that the
7341 terminal supports the
7342 .Xr xterm 1
7343 title set sequences and to automatically set some of the capabilities above.
7345 .Sh CONTROL MODE
7347 offers a textual interface called
7348 .Em control mode .
7349 This allows applications to communicate with
7351 using a simple text-only protocol.
7353 In control mode, a client sends
7355 commands or command sequences terminated by newlines on standard input.
7356 Each command will produce one block of output on standard output.
7357 An output block consists of a
7358 .Em %begin
7359 line followed by the output (which may be empty).
7360 The output block ends with a
7361 .Em %end
7363 .Em %error .
7364 .Em %begin
7365 and matching
7366 .Em %end
7368 .Em %error
7369 have three arguments: an integer time (as seconds from epoch), command number
7370 and flags (currently not used).
7371 For example:
7372 .Bd -literal -offset indent
7373 %begin 1363006971 2 1
7374 0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active)
7375 %end 1363006971 2 1
7379 .Ic refresh-client
7380 .Fl C
7381 command may be used to set the size of a client in control mode.
7383 In control mode,
7385 outputs notifications.
7386 A notification will never occur inside an output block.
7388 The following notifications are defined:
7389 .Bl -tag -width Ds
7390 .It Ic %client-detached Ar client
7391 The client has detached.
7392 .It Ic %client-session-changed Ar client session-id name
7393 The client is now attached to the session with ID
7394 .Ar session-id ,
7395 which is named
7396 .Ar name .
7397 .It Ic %config-error Ar error
7398 An error has happened in a configuration file.
7399 .It Ic %continue Ar pane-id
7400 The pane has been continued after being paused (if the
7401 .Ar pause-after
7402 flag is set, see
7403 .Ic refresh-client
7404 .Fl A ) .
7405 .It Ic %exit Op Ar reason
7408 client is exiting immediately, either because it is not attached to any session
7409 or an error occurred.
7410 If present,
7411 .Ar reason
7412 describes why the client exited.
7413 .It Ic %extended-output Ar pane-id Ar age Ar ... \&  : Ar value
7414 New form of
7415 .Ic %output
7416 sent when the
7417 .Ar pause-after
7418 flag is set.
7419 .Ar age
7420 is the time in milliseconds for which tmux had buffered the output before it
7421 was sent.
7422 Any subsequent arguments up until a single
7423 .Ql \&:
7424 are for future use and should be ignored.
7425 .It Xo Ic %layout-change
7426 .Ar window-id
7427 .Ar window-layout
7428 .Ar window-visible-layout
7429 .Ar window-flags
7431 The layout of a window with ID
7432 .Ar window-id
7433 changed.
7434 The new layout is
7435 .Ar window-layout .
7436 The window's visible layout is
7437 .Ar window-visible-layout
7438 and the window flags are
7439 .Ar window-flags .
7440 .It Ic %message Ar message
7441 A message sent with the
7442 .Ic display-message
7443 command.
7444 .It Ic %output Ar pane-id Ar value
7445 A window pane produced output.
7446 .Ar value
7447 escapes non-printable characters and backslash as octal \\xxx.
7448 .It Ic %pane-mode-changed Ar pane-id
7449 The pane with ID
7450 .Ar pane-id
7451 has changed mode.
7452 .It Ic %paste-buffer-changed Ar name
7453 Paste buffer
7454 .Ar name
7455 has been changed.
7456 .It Ic %paste-buffer-deleted Ar name
7457 Paste buffer
7458 .Ar name
7459 has been deleted.
7460 .It Ic %pause Ar pane-id
7461 The pane has been paused (if the
7462 .Ar pause-after
7463 flag is set).
7464 .It Ic %session-changed Ar session-id Ar name
7465 The client is now attached to the session with ID
7466 .Ar session-id ,
7467 which is named
7468 .Ar name .
7469 .It Ic %session-renamed Ar name
7470 The current session was renamed to
7471 .Ar name .
7472 .It Ic %session-window-changed Ar session-id Ar window-id
7473 The session with ID
7474 .Ar session-id
7475 changed its active window to the window with ID
7476 .Ar window-id .
7477 .It Ic %sessions-changed
7478 A session was created or destroyed.
7479 .It Xo Ic %subscription-changed
7480 .Ar name
7481 .Ar session-id
7482 .Ar window-id
7483 .Ar window-index
7484 .Ar pane-id ... \&  :
7485 .Ar value
7487 The value of the format associated with subscription
7488 .Ar name
7489 has changed to
7490 .Ar value .
7492 .Ic refresh-client
7493 .Fl B .
7494 Any arguments after
7495 .Ar pane-id
7496 up until a single
7497 .Ql \&:
7498 are for future use and should be ignored.
7499 .It Ic %unlinked-window-add Ar window-id
7500 The window with ID
7501 .Ar window-id
7502 was created but is not linked to the current session.
7503 .It Ic %unlinked-window-close Ar window-id
7504 The window with ID
7505 .Ar window-id ,
7506 which is not linked to the current session, was closed.
7507 .It Ic %unlinked-window-renamed Ar window-id
7508 The window with ID
7509 .Ar window-id ,
7510 which is not linked to the current session, was renamed.
7511 .It Ic %window-add Ar window-id
7512 The window with ID
7513 .Ar window-id
7514 was linked to the current session.
7515 .It Ic %window-close Ar window-id
7516 The window with ID
7517 .Ar window-id
7518 closed.
7519 .It Ic %window-pane-changed Ar window-id Ar pane-id
7520 The active pane in the window with ID
7521 .Ar window-id
7522 changed to the pane with ID
7523 .Ar pane-id .
7524 .It Ic %window-renamed Ar window-id Ar name
7525 The window with ID
7526 .Ar window-id
7527 was renamed to
7528 .Ar name .
7530 .Sh ENVIRONMENT
7531 When
7533 is started, it inspects the following environment variables:
7534 .Bl -tag -width LC_CTYPE
7535 .It Ev EDITOR
7536 If the command specified in this variable contains the string
7537 .Ql vi
7539 .Ev VISUAL
7540 is unset, use vi-style key bindings.
7541 Overridden by the
7542 .Ic mode-keys
7544 .Ic status-keys
7545 options.
7546 .It Ev HOME
7547 The user's login directory.
7548 If unset, the
7549 .Xr passwd 5
7550 database is consulted.
7551 .It Ev LC_CTYPE
7552 The character encoding
7553 .Xr locale 1 .
7554 It is used for two separate purposes.
7555 For output to the terminal, UTF-8 is used if the
7556 .Fl u
7557 option is given or if
7558 .Ev LC_CTYPE
7559 contains
7560 .Qq UTF-8
7562 .Qq UTF8 .
7563 Otherwise, only ASCII characters are written and non-ASCII characters
7564 are replaced with underscores
7565 .Pq Ql _ .
7566 For input,
7568 always runs with a UTF-8 locale.
7569 If en_US.UTF-8 is provided by the operating system, it is used and
7570 .Ev LC_CTYPE
7571 is ignored for input.
7572 Otherwise,
7573 .Ev LC_CTYPE
7574 tells
7576 what the UTF-8 locale is called on the current system.
7577 If the locale specified by
7578 .Ev LC_CTYPE
7579 is not available or is not a UTF-8 locale,
7581 exits with an error message.
7582 .It Ev LC_TIME
7583 The date and time format
7584 .Xr locale 1 .
7585 It is used for locale-dependent
7586 .Xr strftime 3
7587 format specifiers.
7588 .It Ev PWD
7589 The current working directory to be set in the global environment.
7590 This may be useful if it contains symbolic links.
7591 If the value of the variable does not match the current working
7592 directory, the variable is ignored and the result of
7593 .Xr getcwd 3
7594 is used instead.
7595 .It Ev SHELL
7596 The absolute path to the default shell for new windows.
7597 See the
7598 .Ic default-shell
7599 option for details.
7600 .It Ev TMUX_TMPDIR
7601 The parent directory of the directory containing the server sockets.
7602 See the
7603 .Fl L
7604 option for details.
7605 .It Ev VISUAL
7606 If the command specified in this variable contains the string
7607 .Ql vi ,
7608 use vi-style key bindings.
7609 Overridden by the
7610 .Ic mode-keys
7612 .Ic status-keys
7613 options.
7615 .Sh FILES
7616 .Bl -tag -width "@SYSCONFDIR@/tmux.confXXX" -compact
7617 .It Pa \[ti]/.tmux.conf
7618 .It Pa $XDG_CONFIG_HOME/tmux/tmux.conf
7619 .It Pa \[ti]/.config/tmux/tmux.conf
7620 Default
7622 configuration file.
7623 .It Pa @SYSCONFDIR@/tmux.conf
7624 System-wide configuration file.
7626 .Sh EXAMPLES
7627 To create a new
7629 session running
7630 .Xr vi 1 :
7632 .Dl $ tmux new-session vi
7634 Most commands have a shorter form, known as an alias.
7635 For new-session, this is
7636 .Ic new :
7638 .Dl $ tmux new vi
7640 Alternatively, the shortest unambiguous form of a command is accepted.
7641 If there are several options, they are listed:
7642 .Bd -literal -offset indent
7643 $ tmux n
7644 ambiguous command: n, could be: new-session, new-window, next-window
7647 Within an active session, a new window may be created by typing
7648 .Ql C-b c
7649 (Ctrl
7650 followed by the
7651 .Ql b
7653 followed by the
7654 .Ql c
7655 key).
7657 Windows may be navigated with:
7658 .Ql C-b 0
7659 (to select window 0),
7660 .Ql C-b 1
7661 (to select window 1), and so on;
7662 .Ql C-b n
7663 to select the next window; and
7664 .Ql C-b p
7665 to select the previous window.
7667 A session may be detached using
7668 .Ql C-b d
7669 (or by an external event such as
7670 .Xr ssh 1
7671 disconnection) and reattached with:
7673 .Dl $ tmux attach-session
7675 Typing
7676 .Ql C-b \&?
7677 lists the current key bindings in the current window; up and down may be used
7678 to navigate the list or
7679 .Ql q
7680 to exit from it.
7682 Commands to be run when the
7684 server is started may be placed in the
7685 .Pa \[ti]/.tmux.conf
7686 configuration file.
7687 Common examples include:
7689 Changing the default prefix key:
7690 .Bd -literal -offset indent
7691 set-option -g prefix C-a
7692 unbind-key C-b
7693 bind-key C-a send-prefix
7696 Turning the status line off, or changing its colour:
7697 .Bd -literal -offset indent
7698 set-option -g status off
7699 set-option -g status-style bg=blue
7702 Setting other options, such as the default command,
7703 or locking after 30 minutes of inactivity:
7704 .Bd -literal -offset indent
7705 set-option -g default-command "exec /bin/ksh"
7706 set-option -g lock-after-time 1800
7709 Creating new key bindings:
7710 .Bd -literal -offset indent
7711 bind-key b set-option status
7712 bind-key / command-prompt "split-window \[aq]exec man %%\[aq]"
7713 bind-key S command-prompt "new-window -n %1 \[aq]ssh %1\[aq]"
7715 .Sh SEE ALSO
7716 .Xr pty 4
7717 .Sh AUTHORS
7718 .An Nicholas Marriott Aq Mt nicholas.marriott@gmail.com