Add window-status-separator option, from Thomas Adam.
[tmux-openbsd.git] / tmux.1
blobe5aa36025e44b40ef41f1e19727d507164ef9150
1 .\" $OpenBSD$
2 .\"
3 .\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
4 .\"
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
8 .\"
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
14 .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
15 .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .\"
17 .Dd $Mdocdate$
18 .Dt TMUX 1
19 .Os
20 .Sh NAME
21 .Nm tmux
22 .Nd terminal multiplexer
23 .Sh SYNOPSIS
24 .Nm tmux
25 .Bk -words
26 .Op Fl 28lquv
27 .Op Fl c Ar shell-command
28 .Op Fl f Ar file
29 .Op Fl L Ar socket-name
30 .Op Fl S Ar socket-path
31 .Op Ar command Op Ar flags
32 .Ek
33 .Sh DESCRIPTION
34 .Nm
35 is a terminal multiplexer:
36 it enables a number of terminals to be created, accessed, and
37 controlled from a single screen.
38 .Nm
39 may be detached from a screen
40 and continue running in the background,
41 then later reattached.
42 .Pp
43 When
44 .Nm
45 is started it creates a new
46 .Em session
47 with a single
48 .Em window
49 and displays it on screen.
50 A status line at the bottom of the screen
51 shows information on the current session
52 and is used to enter interactive commands.
53 .Pp
54 A session is a single collection of
55 .Em pseudo terminals
56 under the management of
57 .Nm .
58 Each session has one or more
59 windows linked to it.
60 A window occupies the entire screen
61 and may be split into rectangular panes,
62 each of which is a separate pseudo terminal
63 (the
64 .Xr pty 4
65 manual page documents the technical details of pseudo terminals).
66 Any number of
67 .Nm
68 instances may connect to the same session,
69 and any number of windows may be present in the same session.
70 Once all sessions are killed,
71 .Nm
72 exits.
73 .Pp
74 Each session is persistent and will survive accidental disconnection
75 (such as
76 .Xr ssh 1
77 connection timeout) or intentional detaching (with the
78 .Ql C-b d
79 key strokes).
80 .Nm
81 may be reattached using:
82 .Pp
83 .Dl $ tmux attach
84 .Pp
86 .Nm ,
87 a session is displayed on screen by a
88 .Em client
89 and all sessions are managed by a single
90 .Em server .
91 The server and each client are separate processes which communicate through a
92 socket in
93 .Pa /tmp .
94 .Pp
95 The options are as follows:
96 .Bl -tag -width "XXXXXXXXXXXX"
97 .It Fl 2
98 Force
99 .Nm
100 to assume the terminal supports 256 colours.
101 .It Fl 8
102 Like
103 .Fl 2 ,
104 but indicates that the terminal supports 88 colours.
105 .It Fl c Ar shell-command
106 Execute
107 .Ar shell-command
108 using the default shell.
109 If necessary, the
111 server will be started to retrieve the
112 .Ic default-shell
113 option.
114 This option is for compatibility with
115 .Xr sh 1
116 when
118 is used as a login shell.
119 .It Fl f Ar file
120 Specify an alternative configuration file.
121 By default,
123 loads the system configuration file from
124 .Pa /etc/tmux.conf ,
125 if present, then looks for a user configuration file at
126 .Pa ~/.tmux.conf .
127 The configuration file is a set of
129 commands which are executed in sequence when the server is first started.
131 If a command in the configuration file fails,
133 will report an error and exit without executing further commands.
134 .It Fl L Ar socket-name
136 stores the server socket in a directory under
137 .Pa /tmp
139 .Ev TMPDIR
140 if set);
141 the default socket is named
142 .Em default .
143 This option allows a different socket name to be specified, allowing several
144 independent
146 servers to be run.
147 Unlike
148 .Fl S
149 a full path is not necessary: the sockets are all created in the same
150 directory.
152 If the socket is accidentally removed, the
153 .Dv SIGUSR1
154 signal may be sent to the
156 server process to recreate it.
157 .It Fl l
158 Behave as a login shell.
159 This flag currently has no effect and is for compatibility with other shells
160 when using tmux as a login shell.
161 .It Fl q
162 Set the
163 .Ic quiet
164 server option to prevent the server sending various informational messages.
165 .It Fl S Ar socket-path
166 Specify a full alternative path to the server socket.
168 .Fl S
169 is specified, the default socket directory is not used and any
170 .Fl L
171 flag is ignored.
172 .It Fl u
174 attempts to guess if the terminal is likely to support UTF-8 by checking the
175 first of the
176 .Ev LC_ALL ,
177 .Ev LC_CTYPE
179 .Ev LANG
180 environment variables to be set for the string "UTF-8".
181 This is not always correct: the
182 .Fl u
183 flag explicitly informs
185 that UTF-8 is supported.
187 If the server is started from a client passed
188 .Fl u
189 or where UTF-8 is detected, the
190 .Ic utf8
192 .Ic status-utf8
193 options are enabled in the global window and session options respectively.
194 .It Fl v
195 Request verbose logging.
196 This option may be specified multiple times for increasing verbosity.
197 Log messages will be saved into
198 .Pa tmux-client-PID.log
200 .Pa tmux-server-PID.log
201 files in the current directory, where
202 .Em PID
203 is the PID of the server or client process.
204 .It Ar command Op Ar flags
205 This specifies one of a set of commands used to control
206 .Nm ,
207 as described in the following sections.
208 If no commands are specified, the
209 .Ic new-session
210 command is assumed.
212 .Sh KEY BINDINGS
214 may be controlled from an attached client by using a key combination of a
215 prefix key,
216 .Ql C-b
217 (Ctrl-b) by default, followed by a command key.
219 The default command key bindings are:
221 .Bl -tag -width "XXXXXXXXXX" -offset indent -compact
222 .It C-b
223 Send the prefix key (C-b) through to the application.
224 .It C-o
225 Rotate the panes in the current window forwards.
226 .It C-z
227 Suspend the
229 client.
230 .It !
231 Break the current pane out of the window.
232 .It \&"
233 Split the current pane into two, top and bottom.
234 .It #
235 List all paste buffers.
236 .It $
237 Rename the current session.
238 .It %
239 Split the current pane into two, left and right.
240 .It &
241 Kill the current window.
242 .It '
243 Prompt for a window index to select.
244 .It ,
245 Rename the current window.
246 .It -
247 Delete the most recently copied buffer of text.
248 .It .
249 Prompt for an index to move the current window.
250 .It 0 to 9
251 Select windows 0 to 9.
252 .It :
253 Enter the
255 command prompt.
256 .It ;
257 Move to the previously active pane.
258 .It =
259 Choose which buffer to paste interactively from a list.
260 .It \&?
261 List all key bindings.
262 .It D
263 Choose a client to detach.
264 .It \&[
265 Enter copy mode to copy text or view the history.
266 .It \&]
267 Paste the most recently copied buffer of text.
268 .It c
269 Create a new window.
270 .It d
271 Detach the current client.
272 .It f
273 Prompt to search for text in open windows.
274 .It i
275 Display some information about the current window.
276 .It l
277 Move to the previously selected window.
278 .It n
279 Change to the next window.
280 .It o
281 Select the next pane in the current window.
282 .It p
283 Change to the previous window.
284 .It q
285 Briefly display pane indexes.
286 .It r
287 Force redraw of the attached client.
288 .It s
289 Select a new session for the attached client interactively.
290 .It L
291 Switch the attached client back to the last session.
292 .It t
293 Show the time.
294 .It w
295 Choose the current window interactively.
296 .It x
297 Kill the current pane.
298 .It {
299 Swap the current pane with the previous pane.
300 .It }
301 Swap the current pane with the next pane.
302 .It ~
303 Show previous messages from
304 .Nm ,
305 if any.
306 .It Page Up
307 Enter copy mode and scroll one page up.
308 .It Up, Down
309 .It Left, Right
310 Change to the pane above, below, to the left, or to the right of the current
311 pane.
312 .It M-1 to M-5
313 Arrange panes in one of the five preset layouts: even-horizontal,
314 even-vertical, main-horizontal, main-vertical, or tiled.
315 .It M-n
316 Move to the next window with a bell or activity marker.
317 .It M-o
318 Rotate the panes in the current window backwards.
319 .It M-p
320 Move to the previous window with a bell or activity marker.
321 .It C-Up, C-Down
322 .It C-Left, C-Right
323 Resize the current pane in steps of one cell.
324 .It M-Up, M-Down
325 .It M-Left, M-Right
326 Resize the current pane in steps of five cells.
329 Key bindings may be changed with the
330 .Ic bind-key
332 .Ic unbind-key
333 commands.
334 .Sh COMMANDS
335 This section contains a list of the commands supported by
336 .Nm .
337 Most commands accept the optional
338 .Fl t
339 argument with one of
340 .Ar target-client ,
341 .Ar target-session
342 .Ar target-window ,
344 .Ar target-pane .
345 These specify the client, session, window or pane which a command should affect.
346 .Ar target-client
347 is the name of the
348 .Xr pty 4
349 file to which the client is connected, for example either of
350 .Pa /dev/ttyp1
352 .Pa ttyp1
353 for the client attached to
354 .Pa /dev/ttyp1 .
355 If no client is specified, the current client is chosen, if possible, or an
356 error is reported.
357 Clients may be listed with the
358 .Ic list-clients
359 command.
361 .Ar target-session
362 is either the name of a session (as listed by the
363 .Ic list-sessions
364 command) or the name of a client with the same syntax as
365 .Ar target-client ,
366 in which case the session attached to the client is used.
367 When looking for the session name,
369 initially searches for an exact match; if none is found, the session names
370 are checked for any for which
371 .Ar target-session
372 is a prefix or for which it matches as an
373 .Xr fnmatch 3
374 pattern.
375 If a single match is found, it is used as the target session; multiple matches
376 produce an error.
377 If a session is omitted, the current session is used if available; if no
378 current session is available, the most recently used is chosen.
380 .Ar target-window
381 specifies a window in the form
382 .Em session Ns \&: Ns Em window .
383 .Em session
384 follows the same rules as for
385 .Ar target-session ,
387 .Em window
388 is looked for in order: as a window index, for example mysession:1;
389 as a window ID, such as @1;
390 as an exact window name, such as mysession:mywindow; then as an
391 .Xr fnmatch 3
392 pattern or the start of a window name, such as mysession:mywin* or
393 mysession:mywin.
394 An empty window name specifies the next unused index if appropriate (for
395 example the
396 .Ic new-window
398 .Ic link-window
399 commands)
400 otherwise the current window in
401 .Em session
402 is chosen.
403 The special character
404 .Ql \&!
405 uses the last (previously current) window, or
406 .Ql +
408 .Ql -
409 are the next window or the previous window by number.
410 When the argument does not contain a colon,
412 first attempts to parse it as window; if that fails, an attempt is made to
413 match a session.
415 .Ar target-pane
416 takes a similar form to
417 .Ar target-window
418 but with the optional addition of a period followed by a pane index, for
419 example: mysession:mywindow.1.
420 If the pane index is omitted, the currently active pane in the specified
421 window is used.
422 If neither a colon nor period appears,
424 first attempts to use the argument as a pane index; if that fails, it is looked
425 up as for
426 .Ar target-window .
428 .Ql +
430 .Ql -
431 indicate the next or previous pane index, respectively.
432 One of the strings
433 .Em top ,
434 .Em bottom ,
435 .Em left ,
436 .Em right ,
437 .Em top-left ,
438 .Em top-right ,
439 .Em bottom-left
441 .Em bottom-right
442 may be used instead of a pane index.
444 The special characters
445 .Ql +
447 .Ql -
448 may be followed by an offset, for example:
449 .Bd -literal -offset indent
450 select-window -t:+2
453 When dealing with a session that doesn't contain sequential window indexes,
454 they will be correctly skipped.
457 also gives each pane created in a server an identifier consisting of a
458 .Ql %
459 and a number, starting from zero.
460 A pane's identifier is unique for the life of the
462 server and is passed to the child process of the pane in the
463 .Ev TMUX_PANE
464 environment variable.
465 It may be used alone to target a pane or the window containing it.
467 .Ar shell-command
468 arguments are
469 .Xr sh 1
470 commands.
471 These must be passed as a single item, which typically means quoting them, for
472 example:
473 .Bd -literal -offset indent
474 new-window 'vi /etc/passwd'
477 .Ar command
478 .Op Ar arguments
479 refers to a
481 command, passed with the command and arguments separately, for example:
482 .Bd -literal -offset indent
483 bind-key F1 set-window-option force-width 81
486 Or if using
487 .Xr sh 1 :
488 .Bd -literal -offset indent
489 $ tmux bind-key F1 set-window-option force-width 81
492 Multiple commands may be specified together as part of a
493 .Em command sequence .
494 Each command should be separated by spaces and a semicolon;
495 commands are executed sequentially from left to right and
496 lines ending with a backslash continue on to the next line.
497 A literal semicolon may be included by escaping it with a backslash (for
498 example, when specifying a command sequence to
499 .Ic bind-key ) .
501 Example
503 commands include:
504 .Bd -literal -offset indent
505 refresh-client -t/dev/ttyp2
507 rename-session -tfirst newname
509 set-window-option -t:0 monitor-activity on
511 new-window ; split-window -d
513 bind-key R source-file ~/.tmux.conf \e; \e
514         display-message "source-file done"
517 Or from
518 .Xr sh 1 :
519 .Bd -literal -offset indent
520 $ tmux kill-window -t :1
522 $ tmux new-window \e; split-window -d
524 $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
526 .Sh CLIENTS AND SESSIONS
529 server manages clients, sessions, windows and panes.
530 Clients are attached to sessions to interact with them, either
531 when they are created with the
532 .Ic new-session
533 command, or later with the
534 .Ic attach-session
535 command.
536 Each session has one or more windows
537 .Em linked
538 into it.
539 Windows may be linked to multiple sessions and are made up of one or
540 more panes,
541 each of which contains a pseudo terminal.
542 Commands for creating, linking and otherwise manipulating windows
543 are covered
544 in the
545 .Sx WINDOWS AND PANES
546 section.
548 The following commands are available to manage clients and sessions:
549 .Bl -tag -width Ds
550 .It Xo Ic attach-session
551 .Op Fl dr
552 .Op Fl t Ar target-session
554 .D1 (alias: Ic attach )
555 If run from outside
556 .Nm ,
557 create a new client in the current terminal and attach it to
558 .Ar target-session .
559 If used from inside, switch the current client.
561 .Fl d
562 is specified, any other clients attached to the session are detached.
563 .Fl r
564 signifies the client is read-only (only keys bound to the
565 .Ic detach-client
567 .Ic switch-client
568 commands have any effect)
570 If no server is started,
571 .Ic attach-session
572 will attempt to start it; this will fail unless sessions are created in the
573 configuration file.
576 .Ar target-session
577 rules for
578 .Ic attach-session
579 are slightly adjusted: if
581 needs to select the most recently used session, it will prefer the most
582 recently used
583 .Em unattached
584 session.
585 .It Xo Ic detach-client
586 .Op Fl P
587 .Op Fl s Ar target-session
588 .Op Fl t Ar target-client
590 .D1 (alias: Ic detach )
591 Detach the current client if bound to a key, the client specified with
592 .Fl t ,
593 or all clients currently attached to the session specified by
594 .Fl s .
596 .Fl P
597 is given, send SIGHUP to the parent process of the client, typically causing it
598 to exit.
599 .It Ic has-session Op Fl t Ar target-session
600 .D1 (alias: Ic has )
601 Report an error and exit with 1 if the specified session does not exist.
602 If it does exist, exit with 0.
603 .It Ic kill-server
604 Kill the
606 server and clients and destroy all sessions.
607 .It Ic kill-session Op Fl t Ar target-session
608 Destroy the given session, closing any windows linked to it and no other
609 sessions, and detaching all clients attached to it.
610 .It Xo Ic list-clients
611 .Op Fl F Ar format
612 .Op Fl t Ar target-session
614 .D1 (alias: Ic lsc )
615 List all clients attached to the server.
616 For the meaning of the
617 .Fl F
618 flag, see the
619 .Sx FORMATS
620 section.
622 .Ar target-session
623 is specified, list only clients connected to that session.
624 .It Ic list-commands
625 .D1 (alias: Ic lscm )
626 List the syntax of all commands supported by
627 .Nm .
628 .It Ic list-sessions Op Fl F Ar format
629 .D1 (alias: Ic ls )
630 List all sessions managed by the server.
631 For the meaning of the
632 .Fl F
633 flag, see the
634 .Sx FORMATS
635 section.
636 .It Ic lock-client Op Fl t Ar target-client
637 .D1 (alias: Ic lockc )
638 Lock
639 .Ar target-client ,
640 see the
641 .Ic lock-server
642 command.
643 .It Ic lock-session Op Fl t Ar target-session
644 .D1 (alias: Ic locks )
645 Lock all clients attached to
646 .Ar target-session .
647 .It Xo Ic new-session
648 .Op Fl d
649 .Op Fl n Ar window-name
650 .Op Fl s Ar session-name
651 .Op Fl t Ar target-session
652 .Op Fl x Ar width
653 .Op Fl y Ar height
654 .Op Ar shell-command
656 .D1 (alias: Ic new )
657 Create a new session with name
658 .Ar session-name .
660 The new session is attached to the current terminal unless
661 .Fl d
662 is given.
663 .Ar window-name
665 .Ar shell-command
666 are the name of and shell command to execute in the initial window.
668 .Fl d
669 is used,
670 .Fl x
672 .Fl y
673 specify the size of the initial window (80 by 24 if not given).
675 If run from a terminal, any
676 .Xr termios 4
677 special characters are saved and used for new windows in the new session.
680 .Fl t
681 is given, the new session is
682 .Em grouped
683 with
684 .Ar target-session .
685 This means they share the same set of windows - all windows from
686 .Ar target-session
687 are linked to the new session and any subsequent new windows or windows being
688 closed are applied to both sessions.
689 The current and previous window and any session options remain independent and
690 either session may be killed without affecting the other.
691 Giving
692 .Fl n
694 .Ar shell-command
695 are invalid if
696 .Fl t
697 is used.
698 .It Xo Ic refresh-client
699 .Op Fl S
700 .Op Fl t Ar target-client
702 .D1 (alias: Ic refresh )
703 Refresh the current client if bound to a key, or a single client if one is given
704 with
705 .Fl t .
707 .Fl S
708 is specified, only update the client's status bar.
709 .It Xo Ic rename-session
710 .Op Fl t Ar target-session
711 .Ar new-name
713 .D1 (alias: Ic rename )
714 Rename the session to
715 .Ar new-name .
716 .It Xo Ic show-messages
717 .Op Fl t Ar target-client
719 .D1 (alias: Ic showmsgs )
720 Any messages displayed on the status line are saved in a per-client message
721 log, up to a maximum of the limit set by the
722 .Ar message-limit
723 session option for the session attached to that client.
724 This command displays the log for
725 .Ar target-client .
726 .It Ic source-file Ar path
727 .D1 (alias: Ic source )
728 Execute commands from
729 .Ar path .
730 .It Ic start-server
731 .D1 (alias: Ic start )
732 Start the
734 server, if not already running, without creating any sessions.
735 .It Xo Ic suspend-client
736 .Op Fl t Ar target-client
738 .D1 (alias: Ic suspendc )
739 Suspend a client by sending
740 .Dv SIGTSTP
741 (tty stop).
742 .It Xo Ic switch-client
743 .Op Fl lnpr
744 .Op Fl c Ar target-client
745 .Op Fl t Ar target-session
747 .D1 (alias: Ic switchc )
748 Switch the current session for client
749 .Ar target-client
751 .Ar target-session .
753 .Fl l ,
754 .Fl n
756 .Fl p
757 is used, the client is moved to the last, next or previous session
758 respectively.
759 .Fl r
760 toggles whether a client is read-only (see the
761 .Ic attach-session
762 command).
764 .Sh WINDOWS AND PANES
767 window may be in one of several modes.
768 The default permits direct access to the terminal attached to the window.
769 The other is copy mode, which permits a section of a window or its
770 history to be copied to a
771 .Em paste buffer
772 for later insertion into another window.
773 This mode is entered with the
774 .Ic copy-mode
775 command, bound to
776 .Ql \&[
777 by default.
778 It is also entered when a command that produces output, such as
779 .Ic list-keys ,
780 is executed from a key binding.
782 The keys available depend on whether emacs or vi mode is selected
783 (see the
784 .Ic mode-keys
785 option).
786 The following keys are supported as appropriate for the mode:
787 .Bl -column "FunctionXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
788 .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
789 .It Li "Back to indentation" Ta "^" Ta "M-m"
790 .It Li "Bottom of history" Ta "G" Ta "M-<"
791 .It Li "Clear selection" Ta "Escape" Ta "C-g"
792 .It Li "Copy selection" Ta "Enter" Ta "M-w"
793 .It Li "Cursor down" Ta "j" Ta "Down"
794 .It Li "Cursor left" Ta "h" Ta "Left"
795 .It Li "Cursor right" Ta "l" Ta "Right"
796 .It Li "Cursor to bottom line" Ta "L" Ta ""
797 .It Li "Cursor to middle line" Ta "M" Ta "M-r"
798 .It Li "Cursor to top line" Ta "H" Ta "M-R"
799 .It Li "Cursor up" Ta "k" Ta "Up"
800 .It Li "Delete entire line" Ta "d" Ta "C-u"
801 .It Li "Delete/Copy to end of line" Ta "D" Ta "C-k"
802 .It Li "End of line" Ta "$" Ta "C-e"
803 .It Li "Go to line" Ta ":" Ta "g"
804 .It Li "Half page down" Ta "C-d" Ta "M-Down"
805 .It Li "Half page up" Ta "C-u" Ta "M-Up"
806 .It Li "Jump forward" Ta "f" Ta "f"
807 .It Li "Jump to forward" Ta "t" Ta ""
808 .It Li "Jump backward" Ta "F" Ta "F"
809 .It Li "Jump to backward" Ta "T" Ta ""
810 .It Li "Jump again" Ta ";" Ta ";"
811 .It Li "Jump again in reverse" Ta "," Ta ","
812 .It Li "Next page" Ta "C-f" Ta "Page down"
813 .It Li "Next space" Ta "W" Ta ""
814 .It Li "Next space, end of word" Ta "E" Ta ""
815 .It Li "Next word" Ta "w" Ta ""
816 .It Li "Next word end" Ta "e" Ta "M-f"
817 .It Li "Paste buffer" Ta "p" Ta "C-y"
818 .It Li "Previous page" Ta "C-b" Ta "Page up"
819 .It Li "Previous word" Ta "b" Ta "M-b"
820 .It Li "Previous space" Ta "B" Ta ""
821 .It Li "Quit mode" Ta "q" Ta "Escape"
822 .It Li "Rectangle toggle" Ta "v" Ta "R"
823 .It Li "Scroll down" Ta "C-Down or C-e" Ta "C-Down"
824 .It Li "Scroll up" Ta "C-Up or C-y" Ta "C-Up"
825 .It Li "Search again" Ta "n" Ta "n"
826 .It Li "Search again in reverse" Ta "N" Ta "N"
827 .It Li "Search backward" Ta "?" Ta "C-r"
828 .It Li "Search forward" Ta "/" Ta "C-s"
829 .It Li "Start of line" Ta "0" Ta "C-a"
830 .It Li "Start selection" Ta "Space" Ta "C-Space"
831 .It Li "Top of history" Ta "g" Ta "M->"
832 .It Li "Transpose chars" Ta "" Ta "C-t"
835 The next and previous word keys use space and the
836 .Ql - ,
837 .Ql _
839 .Ql @
840 characters as word delimiters by default, but this can be adjusted by
841 setting the
842 .Em word-separators
843 session option.
844 Next word moves to the start of the next word, next word end to the end of the
845 next word and previous word to the start of the previous word.
846 The three next and previous space keys work similarly but use a space alone as
847 the word separator.
849 The jump commands enable quick movement within a line.
850 For instance, typing
851 .Ql f
852 followed by
853 .Ql /
854 will move the cursor to the next
855 .Ql /
856 character on the current line.
858 .Ql \&;
859 will then jump to the next occurrence.
861 Commands in copy mode may be prefaced by an optional repeat count.
862 With vi key bindings, a prefix is entered using the number keys; with
863 emacs, the Alt (meta) key and a number begins prefix entry.
864 For example, to move the cursor forward by ten words, use
865 .Ql M-1 0 M-f
866 in emacs mode, and
867 .Ql 10w
868 in vi.
870 When copying the selection, the repeat count indicates the buffer index to
871 replace, if used.
873 Mode key bindings are defined in a set of named tables:
874 .Em vi-edit
876 .Em emacs-edit
877 for keys used when line editing at the command prompt;
878 .Em vi-choice
880 .Em emacs-choice
881 for keys used when choosing from lists (such as produced by the
882 .Ic choose-window
883 command); and
884 .Em vi-copy
886 .Em emacs-copy
887 used in copy mode.
888 The tables may be viewed with the
889 .Ic list-keys
890 command and keys modified or removed with
891 .Ic bind-key
893 .Ic unbind-key .
895 The paste buffer key pastes the first line from the top paste buffer on the
896 stack.
898 The synopsis for the
899 .Ic copy-mode
900 command is:
901 .Bl -tag -width Ds
902 .It Xo Ic copy-mode
903 .Op Fl u
904 .Op Fl t Ar target-pane
906 Enter copy mode.
908 .Fl u
909 option scrolls one page up.
912 Each window displayed by
914 may be split into one or more
915 .Em panes ;
916 each pane takes up a certain area of the display and is a separate terminal.
917 A window may be split into panes using the
918 .Ic split-window
919 command.
920 Windows may be split horizontally (with the
921 .Fl h
922 flag) or vertically.
923 Panes may be resized with the
924 .Ic resize-pane
925 command (bound to
926 .Ql C-up ,
927 .Ql C-down
928 .Ql C-left
930 .Ql C-right
931 by default), the current pane may be changed with the
932 .Ic select-pane
933 command and the
934 .Ic rotate-window
936 .Ic swap-pane
937 commands may be used to swap panes without changing their position.
938 Panes are numbered beginning from zero in the order they are created.
940 A number of preset
941 .Em layouts
942 are available.
943 These may be selected with the
944 .Ic select-layout
945 command or cycled with
946 .Ic next-layout
947 (bound to
948 .Ql Space
949 by default); once a layout is chosen, panes within it may be moved and resized
950 as normal.
952 The following layouts are supported:
953 .Bl -tag -width Ds
954 .It Ic even-horizontal
955 Panes are spread out evenly from left to right across the window.
956 .It Ic even-vertical
957 Panes are spread evenly from top to bottom.
958 .It Ic main-horizontal
959 A large (main) pane is shown at the top of the window and the remaining panes
960 are spread from left to right in the leftover space at the bottom.
961 Use the
962 .Em main-pane-height
963 window option to specify the height of the top pane.
964 .It Ic main-vertical
965 Similar to
966 .Ic main-horizontal
967 but the large pane is placed on the left and the others spread from top to
968 bottom along the right.
969 See the
970 .Em main-pane-width
971 window option.
972 .It Ic tiled
973 Panes are spread out as evenly as possible over the window in both rows and
974 columns.
977 In addition,
978 .Ic select-layout
979 may be used to apply a previously used layout - the
980 .Ic list-windows
981 command displays the layout of each window in a form suitable for use with
982 .Ic select-layout .
983 For example:
984 .Bd -literal -offset indent
985 $ tmux list-windows
986 0: ksh [159x48]
987     layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
988 $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
992 automatically adjusts the size of the layout for the current window size.
993 Note that a layout cannot be applied to a window with more panes than that
994 from which the layout was originally defined.
996 Commands related to windows and panes are as follows:
997 .Bl -tag -width Ds
998 .It Xo Ic break-pane
999 .Op Fl dP
1000 .Op Fl F Ar format
1001 .Op Fl t Ar target-pane
1003 .D1 (alias: Ic breakp )
1004 Break
1005 .Ar target-pane
1006 off from its containing window to make it the only pane in a new window.
1008 .Fl d
1009 is given, the new window does not become the current window.
1011 .Fl P
1012 option prints information about the new window after it has been created.
1013 By default, it uses the format
1014 .Ql #{session_name}:#{window_index}
1015 but a different format may be specified with
1016 .Fl F .
1017 .It Xo Ic capture-pane
1018 .Op Fl b Ar buffer-index
1019 .Op Fl E Ar end-line
1020 .Op Fl S Ar start-line
1021 .Op Fl t Ar target-pane
1023 .D1 (alias: Ic capturep )
1024 Capture the contents of a pane to the specified buffer, or a new buffer if none
1025 is specified.
1027 .Fl S
1029 .Fl E
1030 specify the starting and ending line numbers, zero is the first line of the
1031 visible pane and negative numbers are lines in the history.
1032 The default is to capture only the visible contents of the pane.
1033 .It Xo
1034 .Ic choose-client
1035 .Op Fl t Ar target-window
1036 .Op Ar template
1038 Put a window into client choice mode, allowing a client to be selected
1039 interactively from a list.
1040 After a client is chosen,
1041 .Ql %%
1042 is replaced by the client
1043 .Xr pty 4
1044 path in
1045 .Ar template
1046 and the result executed as a command.
1048 .Ar template
1049 is not given, "detach-client -t '%%'" is used.
1050 This command works only from inside
1051 .Nm .
1052 .It Xo
1053 .Ic choose-session
1054 .Op Fl t Ar target-window
1055 .Op Ar template
1057 Put a window into session choice mode, where a session may be selected
1058 interactively from a list.
1059 When one is chosen,
1060 .Ql %%
1061 is replaced by the session name in
1062 .Ar template
1063 and the result executed as a command.
1065 .Ar template
1066 is not given, "switch-client -t '%%'" is used.
1067 This command works only from inside
1068 .Nm .
1069 .It Xo
1070 .Ic choose-window
1071 .Op Fl t Ar target-window
1072 .Op Ar template
1074 Put a window into window choice mode, where a window may be chosen
1075 interactively from a list.
1076 After a window is selected,
1077 .Ql %%
1078 is replaced by the session name and window index in
1079 .Ar template
1080 and the result executed as a command.
1082 .Ar template
1083 is not given, "select-window -t '%%'" is used.
1084 This command works only from inside
1085 .Nm .
1086 .It Ic display-panes Op Fl t Ar target-client
1087 .D1 (alias: Ic displayp)
1088 Display a visible indicator of each pane shown by
1089 .Ar target-client .
1090 See the
1091 .Ic display-panes-time ,
1092 .Ic display-panes-colour ,
1094 .Ic display-panes-active-colour
1095 session options.
1096 While the indicator is on screen, a pane may be selected with the
1097 .Ql 0
1099 .Ql 9
1100 keys.
1101 .It Xo Ic find-window
1102 .Op Fl CNT
1103 .Op Fl t Ar target-window
1104 .Ar match-string
1106 .D1 (alias: Ic findw )
1107 Search for the
1108 .Xr fnmatch 3
1109 pattern
1110 .Ar match-string
1111 in window names, titles, and visible content (but not history).
1112 The flags control matching behavior:
1113 .Fl C
1114 matches only visible window contents,
1115 .Fl N
1116 matches only the window name and
1117 .Fl T
1118 matches only the window title.
1119 The default is
1120 .Fl CNT .
1121 If only one window is matched, it'll be automatically selected,
1122 otherwise a choice list is shown.
1123 This command only works from inside
1124 .Nm .
1125 .It Xo Ic join-pane
1126 .Op Fl bdhv
1127 .Oo Fl l
1128 .Ar size |
1129 .Fl p Ar percentage Oc
1130 .Op Fl s Ar src-pane
1131 .Op Fl t Ar dst-pane
1133 .D1 (alias: Ic joinp )
1134 Like
1135 .Ic split-window ,
1136 but instead of splitting
1137 .Ar dst-pane
1138 and creating a new pane, split it and move
1139 .Ar src-pane
1140 into the space.
1141 This can be used to reverse
1142 .Ic break-pane .
1144 .Fl b
1145 option causes
1146 .Ar src-pane
1147 to be joined to left of or above
1148 .Ar dst-pane .
1149 .It Xo Ic kill-pane
1150 .Op Fl a
1151 .Op Fl t Ar target-pane
1153 .D1 (alias: Ic killp )
1154 Destroy the given pane.
1155 If no panes remain in the containing window, it is also destroyed.
1157 .Fl a
1158 option kills all but the pane given with
1159 .Fl t .
1160 .It Xo Ic kill-window
1161 .Op Fl a
1162 .Op Fl t Ar target-window
1164 .D1 (alias: Ic killw )
1165 Kill the current window or the window at
1166 .Ar target-window ,
1167 removing it from any sessions to which it is linked.
1169 .Fl a
1170 option kills all but the window given with
1171 .Fl t .
1172 .It Ic last-pane Op Fl t Ar target-window
1173 .D1 (alias: Ic lastp )
1174 Select the last (previously selected) pane.
1175 .It Ic last-window Op Fl t Ar target-session
1176 .D1 (alias: Ic last )
1177 Select the last (previously selected) window.
1178 If no
1179 .Ar target-session
1180 is specified, select the last window of the current session.
1181 .It Xo Ic link-window
1182 .Op Fl dk
1183 .Op Fl s Ar src-window
1184 .Op Fl t Ar dst-window
1186 .D1 (alias: Ic linkw )
1187 Link the window at
1188 .Ar src-window
1189 to the specified
1190 .Ar dst-window .
1192 .Ar dst-window
1193 is specified and no such window exists, the
1194 .Ar src-window
1195 is linked there.
1197 .Fl k
1198 is given and
1199 .Ar dst-window
1200 exists, it is killed, otherwise an error is generated.
1202 .Fl d
1203 is given, the newly linked window is not selected.
1204 .It Xo Ic list-panes
1205 .Op Fl as
1206 .Op Fl F Ar format
1207 .Op Fl t Ar target
1209 .D1 (alias: Ic lsp )
1211 .Fl a
1212 is given,
1213 .Ar target
1214 is ignored and all panes on the server are listed.
1216 .Fl s
1217 is given,
1218 .Ar target
1219 is a session (or the current session).
1220 If neither is given,
1221 .Ar target
1222 is a window (or the current window).
1223 For the meaning of the
1224 .Fl F
1225 flag, see the
1226 .Sx FORMATS
1227 section.
1228 .It Xo Ic list-windows
1229 .Op Fl a
1230 .Op Fl F Ar format
1231 .Op Fl t Ar target-session
1233 .D1 (alias: Ic lsw )
1235 .Fl a
1236 is given, list all windows on the server.
1237 Otherwise, list windows in the current session or in
1238 .Ar target-session .
1239 For the meaning of the
1240 .Fl F
1241 flag, see the
1242 .Sx FORMATS
1243 section.
1244 .It Xo Ic move-pane
1245 .Op Fl bdhv
1246 .Oo Fl l
1247 .Ar size |
1248 .Fl p Ar percentage Oc
1249 .Op Fl s Ar src-pane
1250 .Op Fl t Ar dst-pane
1252 .D1 (alias: Ic movep )
1253 Like
1254 .Ic join-pane ,
1256 .Ar src-pane
1258 .Ar dst-pane
1259 may belong to the same window.
1260 .It Xo Ic move-window
1261 .Op Fl dk
1262 .Op Fl s Ar src-window
1263 .Op Fl t Ar dst-window
1265 .D1 (alias: Ic movew )
1266 This is similar to
1267 .Ic link-window ,
1268 except the window at
1269 .Ar src-window
1270 is moved to
1271 .Ar dst-window .
1272 .It Xo Ic new-window
1273 .Op Fl adkP
1274 .Op Fl c Ar start-directory
1275 .Op Fl n Ar window-name
1276 .Op Fl t Ar target-window
1277 .Op Fl F Ar format
1278 .Op Ar shell-command
1280 .D1 (alias: Ic neww )
1281 Create a new window.
1282 With
1283 .Fl a ,
1284 the new window is inserted at the next index up from the specified
1285 .Ar target-window ,
1286 moving windows up if necessary,
1287 otherwise
1288 .Ar target-window
1289 is the new window location.
1292 .Fl d
1293 is given, the session does not make the new window the current window.
1294 .Ar target-window
1295 represents the window to be created; if the target already exists an error is
1296 shown, unless the
1297 .Fl k
1298 flag is used, in which case it is destroyed.
1299 .Ar shell-command
1300 is the command to execute.
1302 .Ar shell-command
1303 is not specified, the value of the
1304 .Ic default-command
1305 option is used.
1306 .Fl c
1307 specifies the working directory in which the new window is created.
1308 It may have an absolute path or one of the following values (or a subdirectory):
1309 .Bl -column "XXXXXXXXXXXX" "XXXXXXXXXXXXXXXXXXXXXXXX" -offset indent
1310 .It Li "Empty string" Ta "Current pane's directory"
1311 .It Li "~" Ta "User's home directory"
1312 .It Li "-" Ta "Where session was started"
1313 .It Li "." Ta "Where server was started"
1316 When the shell command completes, the window closes.
1317 See the
1318 .Ic remain-on-exit
1319 option to change this behaviour.
1322 .Ev TERM
1323 environment variable must be set to
1324 .Dq screen
1325 for all programs running
1326 .Em inside
1327 .Nm .
1328 New windows will automatically have
1329 .Dq TERM=screen
1330 added to their environment, but care must be taken not to reset this in shell
1331 start-up files.
1334 .Fl P
1335 option prints information about the new window after it has been created.
1336 By default, it uses the format
1337 .Ql #{session_name}:#{window_index}
1338 but a different format may be specified with
1339 .Fl F .
1340 .It Ic next-layout Op Fl t Ar target-window
1341 .D1 (alias: Ic nextl )
1342 Move a window to the next layout and rearrange the panes to fit.
1343 .It Xo Ic next-window
1344 .Op Fl a
1345 .Op Fl t Ar target-session
1347 .D1 (alias: Ic next )
1348 Move to the next window in the session.
1350 .Fl a
1351 is used, move to the next window with a bell, activity or content alert.
1352 .It Xo Ic pipe-pane
1353 .Op Fl o
1354 .Op Fl t Ar target-pane
1355 .Op Ar shell-command
1357 .D1 (alias: Ic pipep )
1358 Pipe any output sent by the program in
1359 .Ar target-pane
1360 to a shell command.
1361 A pane may only be piped to one command at a time, any existing pipe is
1362 closed before
1363 .Ar shell-command
1364 is executed.
1366 .Ar shell-command
1367 string may contain the special character sequences supported by the
1368 .Ic status-left
1369 option.
1370 If no
1371 .Ar shell-command
1372 is given, the current pipe (if any) is closed.
1375 .Fl o
1376 option only opens a new pipe if no previous pipe exists, allowing a pipe to
1377 be toggled with a single key, for example:
1378 .Bd -literal -offset indent
1379 bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1381 .It Xo Ic previous-layout
1382 .Op Fl t Ar target-window
1384 .D1 (alias: Ic prevl )
1385 Move to the previous layout in the session.
1386 .It Xo Ic previous-window
1387 .Op Fl a
1388 .Op Fl t Ar target-session
1390 .D1 (alias: Ic prev )
1391 Move to the previous window in the session.
1392 With
1393 .Fl a ,
1394 move to the previous window with a bell, activity or content alert.
1395 .It Xo Ic rename-window
1396 .Op Fl t Ar target-window
1397 .Ar new-name
1399 .D1 (alias: Ic renamew )
1400 Rename the current window, or the window at
1401 .Ar target-window
1402 if specified, to
1403 .Ar new-name .
1404 .It Xo Ic resize-pane
1405 .Op Fl DLRU
1406 .Op Fl t Ar target-pane
1407 .Op Ar adjustment
1409 .D1 (alias: Ic resizep )
1410 Resize a pane, upward with
1411 .Fl U
1412 (the default), downward with
1413 .Fl D ,
1414 to the left with
1415 .Fl L
1416 and to the right with
1417 .Fl R .
1419 .Ar adjustment
1420 is given in lines or cells (the default is 1).
1421 .It Xo Ic respawn-pane
1422 .Op Fl k
1423 .Op Fl t Ar target-pane
1424 .Op Ar shell-command
1426 .D1 (alias: Ic respawnp )
1427 Reactivate a pane in which the command has exited (see the
1428 .Ic remain-on-exit
1429 window option).
1431 .Ar shell-command
1432 is not given, the command used when the pane was created is executed.
1433 The pane must be already inactive, unless
1434 .Fl k
1435 is given, in which case any existing command is killed.
1436 .It Xo Ic respawn-window
1437 .Op Fl k
1438 .Op Fl t Ar target-window
1439 .Op Ar shell-command
1441 .D1 (alias: Ic respawnw )
1442 Reactivate a window in which the command has exited (see the
1443 .Ic remain-on-exit
1444 window option).
1446 .Ar shell-command
1447 is not given, the command used when the window was created is executed.
1448 The window must be already inactive, unless
1449 .Fl k
1450 is given, in which case any existing command is killed.
1451 .It Xo Ic rotate-window
1452 .Op Fl DU
1453 .Op Fl t Ar target-window
1455 .D1 (alias: Ic rotatew )
1456 Rotate the positions of the panes within a window, either upward (numerically
1457 lower) with
1458 .Fl U
1459 or downward (numerically higher).
1460 .It Xo Ic select-layout
1461 .Op Fl npUu
1462 .Op Fl t Ar target-window
1463 .Op Ar layout-name
1465 .D1 (alias: Ic selectl )
1466 Choose a specific layout for a window.
1468 .Ar layout-name
1469 is not given, the last preset layout used (if any) is reapplied.
1470 .Fl n
1472 .Fl p
1473 are equivalent to the
1474 .Ic next-layout
1476 .Ic previous-layout
1477 commands.
1479 .Fl U
1481 .Fl u
1482 step forward and back through previous layouts, up to the maximum set by the
1483 .Ic layout-history-limit
1484 option.
1485 .It Xo Ic select-pane
1486 .Op Fl lDLRU
1487 .Op Fl t Ar target-pane
1489 .D1 (alias: Ic selectp )
1490 Make pane
1491 .Ar target-pane
1492 the active pane in window
1493 .Ar target-window .
1494 If one of
1495 .Fl D ,
1496 .Fl L ,
1497 .Fl R ,
1499 .Fl U
1500 is used, respectively the pane below, to the left, to the right, or above the
1501 target pane is used.
1502 .Fl l
1503 is the same as using the
1504 .Ic last-pane
1505 command.
1506 .It Xo Ic select-window
1507 .Op Fl lnp
1508 .Op Fl t Ar target-window
1510 .D1 (alias: Ic selectw )
1511 Select the window at
1512 .Ar target-window .
1513 .Fl l ,
1514 .Fl n
1516 .Fl p
1517 are equivalent to the
1518 .Ic last-window ,
1519 .Ic next-window
1521 .Ic previous-window
1522 commands.
1523 .It Xo Ic split-window
1524 .Op Fl dhvP
1525 .Op Fl c Ar start-directory
1526 .Oo Fl l
1527 .Ar size |
1528 .Fl p Ar percentage Oc
1529 .Op Fl t Ar target-pane
1530 .Op Ar shell-command
1531 .Op Fl F Ar format
1533 .D1 (alias: Ic splitw )
1534 Create a new pane by splitting
1535 .Ar target-pane :
1536 .Fl h
1537 does a horizontal split and
1538 .Fl v
1539 a vertical split; if neither is specified,
1540 .Fl v
1541 is assumed.
1543 .Fl l
1545 .Fl p
1546 options specify the size of the new pane in lines (for vertical split) or in
1547 cells (for horizontal split), or as a percentage, respectively.
1548 All other options have the same meaning as for the
1549 .Ic new-window
1550 command.
1551 .It Xo Ic swap-pane
1552 .Op Fl dDU
1553 .Op Fl s Ar src-pane
1554 .Op Fl t Ar dst-pane
1556 .D1 (alias: Ic swapp )
1557 Swap two panes.
1559 .Fl U
1560 is used and no source pane is specified with
1561 .Fl s ,
1562 .Ar dst-pane
1563 is swapped with the previous pane (before it numerically);
1564 .Fl D
1565 swaps with the next pane (after it numerically).
1566 .Fl d
1567 instructs
1569 not to change the active pane.
1570 .It Xo Ic swap-window
1571 .Op Fl d
1572 .Op Fl s Ar src-window
1573 .Op Fl t Ar dst-window
1575 .D1 (alias: Ic swapw )
1576 This is similar to
1577 .Ic link-window ,
1578 except the source and destination windows are swapped.
1579 It is an error if no window exists at
1580 .Ar src-window .
1581 .It Xo Ic unlink-window
1582 .Op Fl k
1583 .Op Fl t Ar target-window
1585 .D1 (alias: Ic unlinkw )
1586 Unlink
1587 .Ar target-window .
1588 Unless
1589 .Fl k
1590 is given, a window may be unlinked only if it is linked to multiple sessions -
1591 windows may not be linked to no sessions;
1593 .Fl k
1594 is specified and the window is linked to only one session, it is unlinked and
1595 destroyed.
1597 .Sh KEY BINDINGS
1599 allows a command to be bound to most keys, with or without a prefix key.
1600 When specifying keys, most represent themselves (for example
1601 .Ql A
1603 .Ql Z ) .
1604 Ctrl keys may be prefixed with
1605 .Ql C-
1607 .Ql ^ ,
1608 and Alt (meta) with
1609 .Ql M- .
1610 In addition, the following special key names are accepted:
1611 .Em Up ,
1612 .Em Down ,
1613 .Em Left ,
1614 .Em Right ,
1615 .Em BSpace ,
1616 .Em BTab ,
1617 .Em DC
1618 (Delete),
1619 .Em End ,
1620 .Em Enter ,
1621 .Em Escape ,
1622 .Em F1
1624 .Em F20 ,
1625 .Em Home ,
1626 .Em IC
1627 (Insert),
1628 .Em NPage/PageDown/PgDn ,
1629 .Em PPage/PageUp/PgUp ,
1630 .Em Space ,
1632 .Em Tab .
1633 Note that to bind the
1634 .Ql \&"
1636 .Ql '
1637 keys, quotation marks are necessary, for example:
1638 .Bd -literal -offset indent
1639 bind-key '"' split-window
1640 bind-key "'" new-window
1643 Commands related to key bindings are as follows:
1644 .Bl -tag -width Ds
1645 .It Xo Ic bind-key
1646 .Op Fl cnr
1647 .Op Fl t Ar key-table
1648 .Ar key Ar command Op Ar arguments
1650 .D1 (alias: Ic bind )
1651 Bind key
1652 .Ar key
1654 .Ar command .
1655 By default (without
1656 .Fl t )
1657 the primary key bindings are modified (those normally activated with the prefix
1658 key); in this case, if
1659 .Fl n
1660 is specified, it is not necessary to use the prefix key,
1661 .Ar command
1662 is bound to
1663 .Ar key
1664 alone.
1666 .Fl r
1667 flag indicates this key may repeat, see the
1668 .Ic repeat-time
1669 option.
1672 .Fl t
1673 is present,
1674 .Ar key
1675 is bound in
1676 .Ar key-table :
1677 the binding for command mode with
1678 .Fl c
1679 or for normal mode without.
1680 To view the default bindings and possible commands, see the
1681 .Ic list-keys
1682 command.
1683 .It Ic list-keys Op Fl t Ar key-table
1684 .D1 (alias: Ic lsk )
1685 List all key bindings.
1686 Without
1687 .Fl t
1688 the primary key bindings - those executed when preceded by the prefix key -
1689 are printed.
1690 Keys bound without the prefix key (see
1691 .Ic bind-key
1692 .Fl n )
1693 are marked with
1694 .Ql (no prefix) .
1696 With
1697 .Fl t ,
1698 the key bindings in
1699 .Ar key-table
1700 are listed; this may be one of:
1701 .Em vi-edit ,
1702 .Em emacs-edit ,
1703 .Em vi-choice ,
1704 .Em emacs-choice ,
1705 .Em vi-copy
1707 .Em emacs-copy .
1708 .It Xo Ic send-keys
1709 .Op Fl lR
1710 .Op Fl t Ar target-pane
1711 .Ar key Ar ...
1713 .D1 (alias: Ic send )
1714 Send a key or keys to a window.
1715 Each argument
1716 .Ar key
1717 is the name of the key (such as
1718 .Ql C-a
1720 .Ql npage
1721 ) to send; if the string is not recognised as a key, it is sent as a series of
1722 characters.
1724 .Fl l
1725 flag disables key name lookup and sends the keys literally.
1726 All arguments are sent sequentially from first to last.
1728 .Fl R
1729 flag causes the terminal state to be reset.
1730 .It Xo Ic send-prefix
1731 .Op Fl 2
1732 .Op Fl t Ar target-pane
1734 Send the prefix key, or with
1735 .Fl 2
1736 the secondary prefix key, to a window as if it was pressed.
1737 .It Xo Ic unbind-key
1738 .Op Fl acn
1739 .Op Fl t Ar key-table
1740 .Ar key
1742 .D1 (alias: Ic unbind )
1743 Unbind the command bound to
1744 .Ar key .
1745 Without
1746 .Fl t
1747 the primary key bindings are modified; in this case, if
1748 .Fl n
1749 is specified, the command bound to
1750 .Ar key
1751 without a prefix (if any) is removed.
1753 .Fl a
1754 is present, all key bindings are removed.
1757 .Fl t
1758 is present,
1759 .Ar key
1761 .Ar key-table
1762 is unbound: the binding for command mode with
1763 .Fl c
1764 or for normal mode without.
1766 .Sh OPTIONS
1767 The appearance and behaviour of
1769 may be modified by changing the value of various options.
1770 There are three types of option:
1771 .Em server options ,
1772 .Em session options
1774 .Em window options .
1778 server has a set of global options which do not apply to any particular
1779 window or session.
1780 These are altered with the
1781 .Ic set-option
1782 .Fl s
1783 command, or displayed with the
1784 .Ic show-options
1785 .Fl s
1786 command.
1788 In addition, each individual session may have a set of session options, and
1789 there is a separate set of global session options.
1790 Sessions which do not have a particular option configured inherit the value
1791 from the global session options.
1792 Session options are set or unset with the
1793 .Ic set-option
1794 command and may be listed with the
1795 .Ic show-options
1796 command.
1797 The available server and session options are listed under the
1798 .Ic set-option
1799 command.
1801 Similarly, a set of window options is attached to each window, and there is
1802 a set of global window options from which any unset options are inherited.
1803 Window options are altered with the
1804 .Ic set-window-option
1805 command and can be listed with the
1806 .Ic show-window-options
1807 command.
1808 All window options are documented with the
1809 .Ic set-window-option
1810 command.
1812 Commands which set options are as follows:
1813 .Bl -tag -width Ds
1814 .It Xo Ic set-option
1815 .Op Fl agqsuw
1816 .Op Fl t Ar target-session | Ar target-window
1817 .Ar option Ar value
1819 .D1 (alias: Ic set )
1820 Set a window option with
1821 .Fl w
1822 (equivalent to the
1823 .Ic set-window-option
1824 command),
1825 a server option with
1826 .Fl s ,
1827 otherwise a session option.
1830 .Fl g
1831 is specified, the global session or window option is set.
1832 With
1833 .Fl a ,
1834 and if the option expects a string,
1835 .Ar value
1836 is appended to the existing setting.
1838 .Fl u
1839 flag unsets an option, so a session inherits the option from the global
1840 options.
1841 It is not possible to unset a global option.
1844 .Fl q
1845 flag suppresses the informational message (as if the
1846 .Ic quiet
1847 server option was set).
1849 Available window options are listed under
1850 .Ic set-window-option .
1852 .Ar value
1853 depends on the option and may be a number, a string, or a flag (on, off, or
1854 omitted to toggle).
1856 Available server options are:
1857 .Bl -tag -width Ds
1858 .It Ic buffer-limit Ar number
1859 Set the number of buffers; as new buffers are added to the top of the stack,
1860 old ones are removed from the bottom if necessary to maintain this maximum
1861 length.
1862 .It Ic escape-time Ar time
1863 Set the time in milliseconds for which
1865 waits after an escape is input to determine if it is part of a function or meta
1866 key sequences.
1867 The default is 500 milliseconds.
1868 .It Xo Ic exit-unattached
1869 .Op Ic on | off
1871 If enabled, the server will exit when there are no attached clients.
1872 .It Xo Ic quiet
1873 .Op Ic on | off
1875 Enable or disable the display of various informational messages (see also the
1876 .Fl q
1877 command line flag).
1878 .It Xo Ic set-clipboard
1879 .Op Ic on | off
1881 Attempt to set the terminal clipboard content using the
1882 \ee]52;...\e007
1883 .Xr xterm 1
1884 escape sequences.
1885 This option is on by default if there is an
1886 .Em \&Ms
1887 entry in the
1888 .Xr terminfo 5
1889 description for the client terminal.
1890 Note that this feature needs to be enabled in
1891 .Xr xterm 1
1892 by setting the resource:
1893 .Bd -literal -offset indent
1894 disallowedWindowOps: 20,21,SetXprop
1897 Or changing this property from the
1898 .Xr xterm 1
1899 interactive menu when required.
1902 Available session options are:
1903 .Bl -tag -width Ds
1904 .It Ic base-index Ar index
1905 Set the base index from which an unused index should be searched when a new
1906 window is created.
1907 The default is zero.
1908 .It Xo Ic bell-action
1909 .Op Ic any | none | current
1911 Set action on window bell.
1912 .Ic any
1913 means a bell in any window linked to a session causes a bell in the current
1914 window of that session,
1915 .Ic none
1916 means all bells are ignored and
1917 .Ic current
1918 means only bell in windows other than the current window are ignored.
1919 .It Xo Ic bell-on-alert
1920 .Op Ic on | off
1922 If on, ring the terminal bell when an activity, content or silence alert
1923 occurs.
1924 .It Ic default-command Ar shell-command
1925 Set the command used for new windows (if not specified when the window is
1926 created) to
1927 .Ar shell-command ,
1928 which may be any
1929 .Xr sh 1
1930 command.
1931 The default is an empty string, which instructs
1933 to create a login shell using the value of the
1934 .Ic default-shell
1935 option.
1936 .It Ic default-path Ar path
1937 Set the default working directory for new panes.
1938 If empty (the default), the working directory is determined from the process
1939 running in the active pane, from the command line environment or from the
1940 working directory where the session was created.
1942 .Ar path
1943 is "$HOME" or "~", the value of the
1944 .Ev HOME
1945 environment variable is used.
1947 .Ar path
1948 is ".", the working directory when
1950 was started is used.
1951 .It Ic default-shell Ar path
1952 Specify the default shell.
1953 This is used as the login shell for new windows when the
1954 .Ic default-command
1955 option is set to empty, and must be the full path of the executable.
1956 When started
1958 tries to set a default value from the first suitable of the
1959 .Ev SHELL
1960 environment variable, the shell returned by
1961 .Xr getpwuid 3 ,
1963 .Pa /bin/sh .
1964 This option should be configured when
1966 is used as a login shell.
1967 .It Ic default-terminal Ar terminal
1968 Set the default terminal for new windows created in this session - the
1969 default value of the
1970 .Ev TERM
1971 environment variable.
1974 to work correctly, this
1975 .Em must
1976 be set to
1977 .Ql screen
1978 or a derivative of it.
1979 .It Xo Ic destroy-unattached
1980 .Op Ic on | off
1982 If enabled and the session is no longer attached to any clients, it is
1983 destroyed.
1984 .It Xo Ic detach-on-destroy
1985 .Op Ic on | off
1987 If on (the default), the client is detached when the session it is attached to
1988 is destroyed.
1989 If off, the client is switched to the most recently active of the remaining
1990 sessions.
1991 .It Ic display-panes-active-colour Ar colour
1992 Set the colour used by the
1993 .Ic display-panes
1994 command to show the indicator for the active pane.
1995 .It Ic display-panes-colour Ar colour
1996 Set the colour used by the
1997 .Ic display-panes
1998 command to show the indicators for inactive panes.
1999 .It Ic display-panes-time Ar time
2000 Set the time in milliseconds for which the indicators shown by the
2001 .Ic display-panes
2002 command appear.
2003 .It Ic display-time Ar time
2004 Set the amount of time for which status line messages and other on-screen
2005 indicators are displayed.
2006 .Ar time
2007 is in milliseconds.
2008 .It Ic history-limit Ar lines
2009 Set the maximum number of lines held in window history.
2010 This setting applies only to new windows - existing window histories are not
2011 resized and retain the limit at the point they were created.
2012 .It Ic lock-after-time Ar number
2013 Lock the session (like the
2014 .Ic lock-session
2015 command) after
2016 .Ar number
2017 seconds of inactivity, or the entire server (all sessions) if the
2018 .Ic lock-server
2019 option is set.
2020 The default is not to lock (set to 0).
2021 .It Ic lock-command Ar shell-command
2022 Command to run when locking each client.
2023 The default is to run
2024 .Xr lock 1
2025 with
2026 .Fl np .
2027 .It Xo Ic lock-server
2028 .Op Ic on | off
2030 If this option is
2031 .Ic on
2032 (the default),
2033 instead of each session locking individually as each has been
2034 idle for
2035 .Ic lock-after-time ,
2036 the entire server will lock after
2037 .Em all
2038 sessions would have locked.
2039 This has no effect as a session option; it must be set as a global option.
2040 .It Ic message-attr Ar attributes
2041 Set status line message attributes, where
2042 .Ar attributes
2043 is either
2044 .Ic none
2045 or a comma-delimited list of one or more of:
2046 .Ic bright
2048 .Ic bold ) ,
2049 .Ic dim ,
2050 .Ic underscore ,
2051 .Ic blink ,
2052 .Ic reverse ,
2053 .Ic hidden ,
2055 .Ic italics .
2056 .It Ic message-bg Ar colour
2057 Set status line message background colour, where
2058 .Ar colour
2059 is one of:
2060 .Ic black ,
2061 .Ic red ,
2062 .Ic green ,
2063 .Ic yellow ,
2064 .Ic blue ,
2065 .Ic magenta ,
2066 .Ic cyan ,
2067 .Ic white ,
2068 aixterm bright variants (if supported:
2069 .Ic brightred ,
2070 .Ic brightgreen ,
2071 and so on),
2072 .Ic colour0
2074 .Ic colour255
2075 from the 256-colour set,
2076 .Ic default ,
2077 or a hexadecimal RGB string such as
2078 .Ql #ffffff ,
2079 which chooses the closest match from the default 256-colour set.
2080 .It Ic message-command-attr Ar attributes
2081 Set status line message attributes when in command mode.
2082 .It Ic message-command-bg Ar colour
2083 Set status line message background colour when in command mode.
2084 .It Ic message-command-fg Ar colour
2085 Set status line message foreground colour when in command mode.
2086 .It Ic message-fg Ar colour
2087 Set status line message foreground colour.
2088 .It Ic message-limit Ar number
2089 Set the number of error or information messages to save in the message log for
2090 each client.
2091 The default is 20.
2092 .It Xo Ic mouse-resize-pane
2093 .Op Ic on | off
2095 If on,
2097 captures the mouse and allows panes to be resized by dragging on their borders.
2098 .It Xo Ic mouse-select-pane
2099 .Op Ic on | off
2101 If on,
2103 captures the mouse and when a window is split into multiple panes the mouse may
2104 be used to select the current pane.
2105 The mouse click is also passed through to the application as normal.
2106 .It Xo Ic mouse-select-window
2107 .Op Ic on | off
2109 If on, clicking the mouse on a window name in the status line will select that
2110 window.
2111 .It Xo Ic mouse-utf8
2112 .Op Ic on | off
2114 If enabled, request mouse input as UTF-8 on UTF-8 terminals.
2115 .It Ic pane-active-border-bg Ar colour
2116 .It Ic pane-active-border-fg Ar colour
2117 Set the pane border colour for the currently active pane.
2118 .It Ic pane-border-bg Ar colour
2119 .It Ic pane-border-fg Ar colour
2120 Set the pane border colour for panes aside from the active pane.
2121 .It Ic prefix Ar key
2122 Set the key accepted as a prefix key.
2123 .It Ic prefix2 Ar key
2124 Set a secondary key accepted as a prefix key.
2125 .It Ic repeat-time Ar time
2126 Allow multiple commands to be entered without pressing the prefix-key again
2127 in the specified
2128 .Ar time
2129 milliseconds (the default is 500).
2130 Whether a key repeats may be set when it is bound using the
2131 .Fl r
2132 flag to
2133 .Ic bind-key .
2134 Repeat is enabled for the default keys bound to the
2135 .Ic resize-pane
2136 command.
2137 .It Xo Ic set-remain-on-exit
2138 .Op Ic on | off
2140 Set the
2141 .Ic remain-on-exit
2142 window option for any windows first created in this session.
2143 When this option is true, windows in which the running program has
2144 exited do not close, instead remaining open but inactivate.
2145 Use the
2146 .Ic respawn-window
2147 command to reactivate such a window, or the
2148 .Ic kill-window
2149 command to destroy it.
2150 .It Xo Ic set-titles
2151 .Op Ic on | off
2153 Attempt to set the client terminal title using the
2154 .Em tsl
2156 .Em fsl
2157 .Xr terminfo 5
2158 entries if they exist.
2160 automatically sets these to the \ee]2;...\e007 sequence if
2161 the terminal appears to be an xterm.
2162 This option is off by default.
2163 Note that elinks
2164 will only attempt to set the window title if the STY environment
2165 variable is set.
2166 .It Ic set-titles-string Ar string
2167 String used to set the window title if
2168 .Ic set-titles
2169 is on.
2170 Character sequences are replaced as for the
2171 .Ic status-left
2172 option.
2173 .It Xo Ic status
2174 .Op Ic on | off
2176 Show or hide the status line.
2177 .It Ic status-attr Ar attributes
2178 Set status line attributes.
2179 .It Ic status-bg Ar colour
2180 Set status line background colour.
2181 .It Ic status-fg Ar colour
2182 Set status line foreground colour.
2183 .It Ic status-interval Ar interval
2184 Update the status bar every
2185 .Ar interval
2186 seconds.
2187 By default, updates will occur every 15 seconds.
2188 A setting of zero disables redrawing at interval.
2189 .It Xo Ic status-justify
2190 .Op Ic left | centre | right
2192 Set the position of the window list component of the status line: left, centre
2193 or right justified.
2194 .It Xo Ic status-keys
2195 .Op Ic vi | emacs
2197 Use vi or emacs-style
2198 key bindings in the status line, for example at the command prompt.
2199 The default is emacs, unless the
2200 .Ev VISUAL
2202 .Ev EDITOR
2203 environment variables are set and contain the string
2204 .Ql vi .
2205 .It Ic status-left Ar string
2206 Display
2207 .Ar string
2208 to the left of the status bar.
2209 .Ar string
2210 will be passed through
2211 .Xr strftime 3
2212 before being used.
2213 By default, the session name is shown.
2214 .Ar string
2215 may contain any of the following special character sequences:
2216 .Bl -column "Character pair" "Replaced with" -offset indent
2217 .It Sy "Character pair" Ta Sy "Replaced with"
2218 .It Li "#(shell-command)" Ta "First line of the command's output"
2219 .It Li "#[attributes]" Ta "Colour or attribute change"
2220 .It Li "#H" Ta "Hostname of local host"
2221 .It Li "#h" Ta "Hostname of local host without the domain name"
2222 .It Li "#F" Ta "Current window flag"
2223 .It Li "#I" Ta "Current window index"
2224 .It Li "#P" Ta "Current pane index"
2225 .It Li "#S" Ta "Session name"
2226 .It Li "#T" Ta "Current pane title"
2227 .It Li "#W" Ta "Current window name"
2228 .It Li "##" Ta "A literal" Ql #
2231 The #(shell-command) form executes
2232 .Ql shell-command
2233 and inserts the first line of its output.
2234 Note that shell commands are only executed once at the interval specified by
2236 .Ic status-interval
2237 option: if the status line is redrawn in the meantime, the previous result is
2238 used.
2239 Shell commands are executed with the
2241 global environment set (see the
2242 .Sx ENVIRONMENT
2243 section).
2245 For details on how the names and titles can be set see the
2246 .Sx "NAMES AND TITLES"
2247 section.
2249 #[attributes] allows a comma-separated list of attributes to be specified,
2250 these may be
2251 .Ql fg=colour
2252 to set the foreground colour,
2253 .Ql bg=colour
2254 to set the background colour, the name of one of the attributes (listed under
2256 .Ic message-attr
2257 option) to turn an attribute on, or an attribute prefixed with
2258 .Ql no
2259 to turn one off, for example
2260 .Ic nobright .
2261 Examples are:
2262 .Bd -literal -offset indent
2263 #(sysctl vm.loadavg)
2264 #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
2267 Where appropriate, special character sequences may be prefixed with a number to
2268 specify the maximum length, for example
2269 .Ql #24T .
2271 By default, UTF-8 in
2272 .Ar string
2273 is not interpreted, to enable UTF-8, use the
2274 .Ic status-utf8
2275 option.
2276 .It Ic status-left-attr Ar attributes
2277 Set the attribute of the left part of the status line.
2278 .It Ic status-left-bg Ar colour
2279 Set the background colour of the left part of the status line.
2280 .It Ic status-left-fg Ar colour
2281 Set the foreground colour of the left part of the status line.
2282 .It Ic status-left-length Ar length
2283 Set the maximum
2284 .Ar length
2285 of the left component of the status bar.
2286 The default is 10.
2287 .It Xo Ic status-position
2288 .Op Ic top | bottom
2290 Set the position of the status line.
2291 .It Ic status-right Ar string
2292 Display
2293 .Ar string
2294 to the right of the status bar.
2295 By default, the current window title in double quotes, the date and the time
2296 are shown.
2297 As with
2298 .Ic status-left ,
2299 .Ar string
2300 will be passed to
2301 .Xr strftime 3 ,
2302 character pairs are replaced, and UTF-8 is dependent on the
2303 .Ic status-utf8
2304 option.
2305 .It Ic status-right-attr Ar attributes
2306 Set the attribute of the right part of the status line.
2307 .It Ic status-right-bg Ar colour
2308 Set the background colour of the right part of the status line.
2309 .It Ic status-right-fg Ar colour
2310 Set the foreground colour of the right part of the status line.
2311 .It Ic status-right-length Ar length
2312 Set the maximum
2313 .Ar length
2314 of the right component of the status bar.
2315 The default is 40.
2316 .It Xo Ic status-utf8
2317 .Op Ic on | off
2319 Instruct
2321 to treat top-bit-set characters in the
2322 .Ic status-left
2324 .Ic status-right
2325 strings as UTF-8; notably, this is important for wide characters.
2326 This option defaults to off.
2327 .It Ic terminal-overrides Ar string
2328 Contains a list of entries which override terminal descriptions read using
2329 .Xr terminfo 5 .
2330 .Ar string
2331 is a comma-separated list of items each a colon-separated string made up of a
2332 terminal type pattern (matched using
2333 .Xr fnmatch 3 )
2334 and a set of
2335 .Em name=value
2336 entries.
2338 For example, to set the
2339 .Ql clear
2340 .Xr terminfo 5
2341 entry to
2342 .Ql \ee[H\ee[2J
2343 for all terminal types and the
2344 .Ql dch1
2345 entry to
2346 .Ql \ee[P
2347 for the
2348 .Ql rxvt
2349 terminal type, the option could be set to the string:
2350 .Bd -literal -offset indent
2351 "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
2354 The terminal entry value is passed through
2355 .Xr strunvis 3
2356 before interpretation.
2357 The default value forcibly corrects the
2358 .Ql colors
2359 entry for terminals which support 88 or 256 colours:
2360 .Bd -literal -offset indent
2361 "*88col*:colors=88,*256col*:colors=256,xterm*:XT"
2363 .It Ic update-environment Ar variables
2364 Set a space-separated string containing a list of environment variables to be
2365 copied into the session environment when a new session is created or an
2366 existing session is attached.
2367 Any variables that do not exist in the source environment are set to be
2368 removed from the session environment (as if
2369 .Fl r
2370 was given to the
2371 .Ic set-environment
2372 command).
2373 The default is
2374 "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID
2375 XAUTHORITY".
2376 .It Xo Ic visual-activity
2377 .Op Ic on | off
2379 If on, display a status line message when activity occurs in a window
2380 for which the
2381 .Ic monitor-activity
2382 window option is enabled.
2383 .It Xo Ic visual-bell
2384 .Op Ic on | off
2386 If this option is on, a message is shown on a bell instead of it being passed
2387 through to the terminal (which normally makes a sound).
2388 Also see the
2389 .Ic bell-action
2390 option.
2391 .It Xo Ic visual-content
2392 .Op Ic on | off
2394 Like
2395 .Ic visual-activity ,
2396 display a message when content is present in a window
2397 for which the
2398 .Ic monitor-content
2399 window option is enabled.
2400 .It Xo Ic visual-silence
2401 .Op Ic on | off
2404 .Ic monitor-silence
2405 is enabled, prints a message after the interval has expired on a given window.
2406 .It Ic word-separators Ar string
2407 Sets the session's conception of what characters are considered word
2408 separators, for the purposes of the next and previous word commands in
2409 copy mode.
2410 The default is
2411 .Ql \ -_@ .
2413 .It Xo Ic set-window-option
2414 .Op Fl agqu
2415 .Op Fl t Ar target-window
2416 .Ar option Ar value
2418 .D1 (alias: Ic setw )
2419 Set a window option.
2421 .Fl a ,
2422 .Fl g ,
2423 .Fl q
2425 .Fl u
2426 flags work similarly to the
2427 .Ic set-option
2428 command.
2430 Supported window options are:
2432 .Bl -tag -width Ds -compact
2433 .It Xo Ic aggressive-resize
2434 .Op Ic on | off
2436 Aggressively resize the chosen window.
2437 This means that
2439 will resize the window to the size of the smallest session for which it is the
2440 current window, rather than the smallest session to which it is attached.
2441 The window may resize when the current window is changed on another sessions;
2442 this option is good for full-screen programs which support
2443 .Dv SIGWINCH
2444 and poor for interactive programs such as shells.
2446 .It Xo Ic allow-rename
2447 .Op Ic on | off
2449 Allow programs to change the window name using a terminal escape
2450 sequence (\\033k...\\033\\\\).
2451 The default is on.
2453 .It Xo Ic alternate-screen
2454 .Op Ic on | off
2456 This option configures whether programs running inside
2458 may use the terminal alternate screen feature, which allows the
2459 .Em smcup
2461 .Em rmcup
2462 .Xr terminfo 5
2463 capabilities.
2464 The alternate screen feature preserves the contents of the window when an
2465 interactive application starts and restores it on exit, so that any output
2466 visible before the application starts reappears unchanged after it exits.
2467 The default is on.
2469 .It Xo Ic automatic-rename
2470 .Op Ic on | off
2472 Control automatic window renaming.
2473 When this setting is enabled,
2475 will attempt - on supported platforms - to rename the window to reflect the
2476 command currently running in it.
2477 This flag is automatically disabled for an individual window when a name
2478 is specified at creation with
2479 .Ic new-window
2481 .Ic new-session ,
2482 or later with
2483 .Ic rename-window ,
2484 or with a terminal escape sequence.
2485 It may be switched off globally with:
2486 .Bd -literal -offset indent
2487 set-window-option -g automatic-rename off
2490 .It Ic c0-change-interval Ar interval
2491 .It Ic c0-change-trigger Ar trigger
2492 These two options configure a simple form of rate limiting for a pane.
2495 sees more than
2496 .Ar trigger
2497 C0 sequences that modify the screen (for example, carriage returns, linefeeds
2498 or backspaces) in one millisecond, it will stop updating the pane immediately and
2499 instead redraw it entirely every
2500 .Ar interval
2501 milliseconds.
2502 This helps to prevent fast output (such as
2503 .Xr yes 1
2504 overwhelming the terminal).
2505 The default is a trigger of 250 and an interval of 100.
2506 A trigger of zero disables the rate limiting.
2508 .It Ic clock-mode-colour Ar colour
2509 Set clock colour.
2511 .It Xo Ic clock-mode-style
2512 .Op Ic 12 | 24
2514 Set clock hour format.
2516 .It Ic force-height Ar height
2517 .It Ic force-width Ar width
2518 Prevent
2520 from resizing a window to greater than
2521 .Ar width
2523 .Ar height .
2524 A value of zero restores the default unlimited setting.
2526 .It Ic layout-history-limit Ar limit
2527 Set the number of previous layouts stored for recovery with
2528 .Ic select-layout
2529 .Fl U
2531 .Fl u .
2533 .It Ic main-pane-height Ar height
2534 .It Ic main-pane-width Ar width
2535 Set the width or height of the main (left or top) pane in the
2536 .Ic main-horizontal
2538 .Ic main-vertical
2539 layouts.
2541 .It Ic mode-attr Ar attributes
2542 Set window modes attributes.
2544 .It Ic mode-bg Ar colour
2545 Set window modes background colour.
2547 .It Ic mode-fg Ar colour
2548 Set window modes foreground colour.
2550 .It Xo Ic mode-keys
2551 .Op Ic vi | emacs
2553 Use vi or emacs-style key bindings in copy and choice modes.
2554 As with the
2555 .Ic status-keys
2556 option, the default is emacs, unless
2557 .Ev VISUAL
2559 .Ev EDITOR
2560 contains
2561 .Ql vi .
2563 .It Xo Ic mode-mouse
2564 .Op Ic on | off | copy-mode
2566 Mouse state in modes.
2567 If on, the mouse may be used to enter copy mode and copy a selection by
2568 dragging, to enter copy mode and scroll with the mouse wheel, or to select an
2569 option in choice mode.
2570 If set to
2571 .Em copy-mode ,
2572 the mouse behaves as set to on, but cannot be used to enter copy
2573 mode.
2575 .It Xo Ic monitor-activity
2576 .Op Ic on | off
2578 Monitor for activity in the window.
2579 Windows with activity are highlighted in the status line.
2581 .It Ic monitor-content Ar match-string
2582 Monitor content in the window.
2583 When
2584 .Xr fnmatch 3
2585 pattern
2586 .Ar match-string
2587 appears in the window, it is highlighted in the status line.
2589 .It Xo Ic monitor-silence
2590 .Op Ic interval
2592 Monitor for silence (no activity) in the window within
2593 .Ic interval
2594 seconds.
2595 Windows that have been silent for the interval are highlighted in the
2596 status line.
2597 An interval of zero disables the monitoring.
2599 .It Ic other-pane-height Ar height
2600 Set the height of the other panes (not the main pane) in the
2601 .Ic main-horizontal
2602 layout.
2603 If this option is set to 0 (the default), it will have no effect.
2604 If both the
2605 .Ic main-pane-height
2607 .Ic other-pane-height
2608 options are set, the main pane will grow taller to make the other panes the
2609 specified height, but will never shrink to do so.
2611 .It Ic other-pane-width Ar width
2612 Like
2613 .Ic other-pane-height ,
2614 but set the width of other panes in the
2615 .Ic main-vertical
2616 layout.
2618 .It Ic pane-base-index Ar index
2619 Like
2620 .Ic base-index ,
2621 but set the starting index for pane numbers.
2623 .It Xo Ic remain-on-exit
2624 .Op Ic on | off
2626 A window with this flag set is not destroyed when the program running in it
2627 exits.
2628 The window may be reactivated with the
2629 .Ic respawn-window
2630 command.
2632 .It Xo Ic synchronize-panes
2633 .Op Ic on | off
2635 Duplicate input to any pane to all other panes in the same window (only
2636 for panes that are not in any special mode).
2638 .It Xo Ic utf8
2639 .Op Ic on | off
2641 Instructs
2643 to expect UTF-8 sequences to appear in this window.
2645 .It Ic window-status-bell-attr Ar attributes
2646 Set status line attributes for windows which have a bell alert.
2648 .It Ic window-status-bell-bg Ar colour
2649 Set status line background colour for windows with a bell alert.
2651 .It Ic window-status-bell-fg Ar colour
2652 Set status line foreground colour for windows with a bell alert.
2654 .It Ic window-status-content-attr Ar attributes
2655 Set status line attributes for windows which have a content alert.
2657 .It Ic window-status-content-bg Ar colour
2658 Set status line background colour for windows with a content alert.
2660 .It Ic window-status-content-fg Ar colour
2661 Set status line foreground colour for windows with a content alert.
2663 .It Ic window-status-activity-attr Ar attributes
2664 Set status line attributes for windows which have an activity (or silence) alert.
2666 .It Ic window-status-activity-bg Ar colour
2667 Set status line background colour for windows with an activity alert.
2669 .It Ic window-status-activity-fg Ar colour
2670 Set status line foreground colour for windows with an activity alert.
2672 .It Ic window-status-attr Ar attributes
2673 Set status line attributes for a single window.
2675 .It Ic window-status-bg Ar colour
2676 Set status line background colour for a single window.
2678 .It Ic window-status-current-attr Ar attributes
2679 Set status line attributes for the currently active window.
2681 .It Ic window-status-current-bg Ar colour
2682 Set status line background colour for the currently active window.
2684 .It Ic window-status-current-fg Ar colour
2685 Set status line foreground colour for the currently active window.
2687 .It Ic window-status-current-format Ar string
2688 Like
2689 .Ar window-status-format ,
2690 but is the format used when the window is the current window.
2692 .It Ic window-status-fg Ar colour
2693 Set status line foreground colour for a single window.
2695 .It Ic window-status-format Ar string
2696 Set the format in which the window is displayed in the status line window list.
2697 See the
2698 .Ar status-left
2699 option for details of special character sequences available.
2700 The default is
2701 .Ql #I:#W#F .
2703 .It Ic window-status-separator Ar string
2704 Sets the separator drawn between windows in the status line.
2705 The default is a single space character.
2707 .It Xo Ic xterm-keys
2708 .Op Ic on | off
2710 If this option is set,
2712 will generate
2713 .Xr xterm 1 -style
2714 function key sequences; these have a number included to indicate modifiers such
2715 as Shift, Alt or Ctrl.
2716 The default is off.
2718 .It Xo Ic wrap-search
2719 .Op Ic on | off
2721 If this option is set, searches will wrap around the end of the pane contents.
2722 The default is on.
2724 .It Xo Ic show-options
2725 .Op Fl gsw
2726 .Op Fl t Ar target-session | Ar target-window
2727 .Op Ar option
2729 .D1 (alias: Ic show )
2730 Show the window options (or a single window option if given) with
2731 .Fl w
2732 (equivalent to
2733 .Ic show-window-options ) ,
2734 the server options with
2735 .Fl s ,
2736 otherwise the session options for
2737 .Ar target session .
2738 Global session or window options are listed if
2739 .Fl g
2740 is used.
2741 .It Xo Ic show-window-options
2742 .Op Fl g
2743 .Op Fl t Ar target-window
2744 .Op Ar option
2746 .D1 (alias: Ic showw )
2747 List the window options or a single option for
2748 .Ar target-window ,
2749 or the global window options if
2750 .Fl g
2751 is used.
2753 .Sh FORMATS
2755 .Ic list-clients ,
2756 .Ic list-sessions ,
2757 .Ic list-windows
2759 .Ic list-panes
2760 commands accept the
2761 .Fl F
2762 flag with a
2763 .Ar format
2764 argument.
2765 This is a string which controls the output format of the command.
2766 Special character sequences are replaced as documented under the
2767 .Ic status-left
2768 option and an additional long form is accepted.
2769 Replacement variables are enclosed in
2770 .Ql #{
2772 .Ql } ,
2773 for example
2774 .Ql #{session_name}
2775 is equivalent to
2776 .Ql #S .
2777 Conditionals are also accepted by prefixing with
2778 .Ql \&?
2779 and separating two alternatives with a comma;
2780 if the specified variable exists and is not zero, the first alternative
2781 is chosen, otherwise the second is used.
2782 For example
2783 .Ql #{?session_attached,attached,not attached}
2784 will include the string
2785 .Ql attached
2786 if the session is attached and the string
2787 .Ql not attached
2788 if it is unattached.
2790 The following variables are available, where appropriate:
2791 .Bl -column "session_created_string" "Replaced with" -offset indent
2792 .It Sy "Variable name" Ta Sy "Replaced with"
2793 .It Li "client_activity" Ta "Integer time client last had activity"
2794 .It Li "client_activity_string" Ta "String time client last had activity"
2795 .It Li "client_created" Ta "Integer time client created"
2796 .It Li "client_created_string" Ta "String time client created"
2797 .It Li "client_cwd" Ta "Working directory of client"
2798 .It Li "client_height" Ta "Height of client"
2799 .It Li "client_readonly" Ta "1 if client is readonly"
2800 .It Li "client_termname" Ta "Terminal name of client"
2801 .It Li "client_tty" Ta "Pseudo terminal of client"
2802 .It Li "client_utf8" Ta "1 if client supports utf8"
2803 .It Li "client_width" Ta "Width of client"
2804 .It Li "host" Ta "Hostname of local host"
2805 .It Li "line" Ta "Line number in the list"
2806 .It Li "pane_active" Ta "1 if active pane"
2807 .It Li "pane_current_path" Ta "Current path if available"
2808 .It Li "pane_dead" Ta "1 if pane is dead"
2809 .It Li "pane_height" Ta "Height of pane"
2810 .It Li "pane_id" Ta "Unique pane ID"
2811 .It Li "pane_pid" Ta "PID of first process in pane"
2812 .It Li "pane_start_command" Ta "Command pane started with"
2813 .It Li "pane_start_path" Ta "Path pane started with"
2814 .It Li "pane_title" Ta "Title of pane"
2815 .It Li "pane_tty" Ta "Pseudo terminal of pane"
2816 .It Li "pane_width" Ta "Width of pane"
2817 .It Li "session_attached" Ta "1 if session attached"
2818 .It Li "session_created" Ta "Integer time session created"
2819 .It Li "session_created_string" Ta "String time session created"
2820 .It Li "session_group" Ta "Number of session group"
2821 .It Li "session_grouped" Ta "1 if session in a group"
2822 .It Li "session_height" Ta "Height of session"
2823 .It Li "session_name" Ta "Name of session"
2824 .It Li "session_width" Ta "Width of session"
2825 .It Li "session_windows" Ta "Number of windows in session"
2826 .It Li "window_active" Ta "1 if window active"
2827 .It Li "window_flags" Ta "Window flags"
2828 .It Li "window_height" Ta "Height of window"
2829 .It Li "window_index" Ta "Index of window"
2830 .It Li "window_layout" Ta "Window layout description"
2831 .It Li "window_name" Ta "Name of window"
2832 .It Li "window_width" Ta "Width of window"
2834 .Sh NAMES AND TITLES
2836 distinguishes between names and titles.
2837 Windows and sessions have names, which may be used to specify them in targets
2838 and are displayed in the status line and various lists: the name is the
2840 identifier for a window or session.
2841 Only panes have titles.
2842 A pane's title is typically set by the program running inside the pane and
2843 is not modified by
2844 .Nm .
2845 It is the same mechanism used to set for example the
2846 .Xr xterm 1
2847 window title in an
2848 .Xr X 7
2849 window manager.
2850 Windows themselves do not have titles - a window's title is the title of its
2851 active pane.
2853 itself may set the title of the terminal in which the client is running, see
2855 .Ic set-titles
2856 option.
2858 A session's name is set with the
2859 .Ic new-session
2861 .Ic rename-session
2862 commands.
2863 A window's name is set with one of:
2864 .Bl -enum -width Ds
2866 A command argument (such as
2867 .Fl n
2869 .Ic new-window
2871 .Ic new-session ) .
2873 An escape sequence:
2874 .Bd -literal -offset indent
2875 $ printf '\e033kWINDOW_NAME\e033\e\e'
2878 Automatic renaming, which sets the name to the active command in the window's
2879 active pane.
2880 See the
2881 .Ic automatic-rename
2882 option.
2885 When a pane is first created, its title is the hostname.
2886 A pane's title can be set via the OSC title setting sequence, for example:
2887 .Bd -literal -offset indent
2888 $ printf '\e033]2;My Title\e033\e\e'
2890 .Sh ENVIRONMENT
2891 When the server is started,
2893 copies the environment into the
2894 .Em global environment ;
2895 in addition, each session has a
2896 .Em session environment .
2897 When a window is created, the session and global environments are merged.
2898 If a variable exists in both, the value from the session environment is used.
2899 The result is the initial environment passed to the new process.
2902 .Ic update-environment
2903 session option may be used to update the session environment from the client
2904 when a new session is created or an old reattached.
2906 also initialises the
2907 .Ev TMUX
2908 variable with some internal information to allow commands to be executed
2909 from inside, and the
2910 .Ev TERM
2911 variable with the correct terminal setting of
2912 .Ql screen .
2914 Commands to alter and view the environment are:
2915 .Bl -tag -width Ds
2916 .It Xo Ic set-environment
2917 .Op Fl gru
2918 .Op Fl t Ar target-session
2919 .Ar name Op Ar value
2921 .D1 (alias: Ic setenv )
2922 Set or unset an environment variable.
2924 .Fl g
2925 is used, the change is made in the global environment; otherwise, it is applied
2926 to the session environment for
2927 .Ar target-session .
2929 .Fl u
2930 flag unsets a variable.
2931 .Fl r
2932 indicates the variable is to be removed from the environment before starting a
2933 new process.
2934 .It Xo Ic show-environment
2935 .Op Fl g
2936 .Op Fl t Ar target-session
2937 .Op Ar variable
2939 .D1 (alias: Ic showenv )
2940 Display the environment for
2941 .Ar target-session
2942 or the global environment with
2943 .Fl g .
2945 .Ar variable
2946 is omitted, all variables are shown.
2947 Variables removed from the environment are prefixed with
2948 .Ql - .
2950 .Sh STATUS LINE
2952 includes an optional status line which is displayed in the bottom line of each
2953 terminal.
2954 By default, the status line is enabled (it may be disabled with the
2955 .Ic status
2956 session option) and contains, from left-to-right: the name of the current
2957 session in square brackets; the window list; the title of the active pane
2958 in double quotes; and the time and date.
2960 The status line is made of three parts: configurable left and right sections
2961 (which may contain dynamic content such as the time or output from a shell
2962 command, see the
2963 .Ic status-left ,
2964 .Ic status-left-length ,
2965 .Ic status-right ,
2967 .Ic status-right-length
2968 options below), and a central window list.
2969 By default, the window list shows the index, name and (if any) flag of the
2970 windows present in the current session in ascending numerical order.
2971 It may be customised with the
2972 .Ar window-status-format
2974 .Ar window-status-current-format
2975 options.
2976 The flag is one of the following symbols appended to the window name:
2977 .Bl -column "Symbol" "Meaning" -offset indent
2978 .It Sy "Symbol" Ta Sy "Meaning"
2979 .It Li "*" Ta "Denotes the current window."
2980 .It Li "-" Ta "Marks the last window (previously selected)."
2981 .It Li "#" Ta "Window is monitored and activity has been detected."
2982 .It Li "!" Ta "A bell has occurred in the window."
2983 .It Li "+" Ta "Window is monitored for content and it has appeared."
2984 .It Li "~" Ta "The window has been silent for the monitor-silence interval."
2987 The # symbol relates to the
2988 .Ic monitor-activity
2989 and + to the
2990 .Ic monitor-content
2991 window options.
2992 The window name is printed in inverted colours if an alert (bell, activity or
2993 content) is present.
2995 The colour and attributes of the status line may be configured, the entire
2996 status line using the
2997 .Ic status-attr ,
2998 .Ic status-fg
3000 .Ic status-bg
3001 session options and individual windows using the
3002 .Ic window-status-attr ,
3003 .Ic window-status-fg
3005 .Ic window-status-bg
3006 window options.
3008 The status line is automatically refreshed at interval if it has changed, the
3009 interval may be controlled with the
3010 .Ic status-interval
3011 session option.
3013 Commands related to the status line are as follows:
3014 .Bl -tag -width Ds
3015 .It Xo Ic command-prompt
3016 .Op Fl I Ar inputs
3017 .Op Fl p Ar prompts
3018 .Op Fl t Ar target-client
3019 .Op Ar template
3021 Open the command prompt in a client.
3022 This may be used from inside
3024 to execute commands interactively.
3027 .Ar template
3028 is specified, it is used as the command.
3029 If present,
3030 .Fl I
3031 is a comma-separated list of the initial text for each prompt.
3033 .Fl p
3034 is given,
3035 .Ar prompts
3036 is a comma-separated list of prompts which are displayed in order; otherwise
3037 a single prompt is displayed, constructed from
3038 .Ar template
3039 if it is present, or
3040 .Ql \&:
3041 if not.
3043 Both
3044 .Ar inputs
3046 .Ar prompts
3047 may contain the special character sequences supported by the
3048 .Ic status-left
3049 option.
3051 Before the command is executed, the first occurrence of the string
3052 .Ql %%
3053 and all occurrences of
3054 .Ql %1
3055 are replaced by the response to the first prompt, the second
3056 .Ql %%
3057 and all
3058 .Ql %2
3059 are replaced with the response to the second prompt, and so on for further
3060 prompts.
3061 Up to nine prompt responses may be replaced
3063 .Ql %1
3065 .Ql %9
3066 .Pc .
3067 .It Xo Ic confirm-before
3068 .Op Fl p Ar prompt
3069 .Op Fl t Ar target-client
3070 .Ar command
3072 .D1 (alias: Ic confirm )
3073 Ask for confirmation before executing
3074 .Ar command .
3076 .Fl p
3077 is given,
3078 .Ar prompt
3079 is the prompt to display; otherwise a prompt is constructed from
3080 .Ar command .
3081 It may contain the special character sequences supported by the
3082 .Ic status-left
3083 option.
3085 This command works only from inside
3086 .Nm .
3087 .It Xo Ic display-message
3088 .Op Fl p
3089 .Op Fl c Ar target-client
3090 .Op Fl t Ar target-pane
3091 .Op Ar message
3093 .D1 (alias: Ic display )
3094 Display a message.
3096 .Fl p
3097 is given, the output is printed to stdout, otherwise it is displayed in the
3098 .Ar target-client
3099 status line.
3100 The format of
3101 .Ar message
3102 is described in the
3103 .Sx FORMATS
3104 section; information is taken from
3105 .Ar target-pane
3107 .Fl t
3108 is given, otherwise the active pane for the session attached to
3109 .Ar target-client .
3111 .Sh BUFFERS
3113 maintains a stack of
3114 .Em paste buffers .
3115 Up to the value of the
3116 .Ic buffer-limit
3117 option are kept; when a new buffer is added, the buffer at the bottom of the
3118 stack is removed.
3119 Buffers may be added using
3120 .Ic copy-mode
3121 or the
3122 .Ic set-buffer
3123 command, and pasted into a window using the
3124 .Ic paste-buffer
3125 command.
3127 A configurable history buffer is also maintained for each window.
3128 By default, up to 2000 lines are kept; this can be altered with the
3129 .Ic history-limit
3130 option (see the
3131 .Ic set-option
3132 command above).
3134 The buffer commands are as follows:
3135 .Bl -tag -width Ds
3136 .It Xo
3137 .Ic choose-buffer
3138 .Op Fl t Ar target-window
3139 .Op Ar template
3141 Put a window into buffer choice mode, where a buffer may be chosen
3142 interactively from a list.
3143 After a buffer is selected,
3144 .Ql %%
3145 is replaced by the buffer index in
3146 .Ar template
3147 and the result executed as a command.
3149 .Ar template
3150 is not given, "paste-buffer -b '%%'" is used.
3151 This command works only from inside
3152 .Nm .
3153 .It Ic clear-history Op Fl t Ar target-pane
3154 .D1 (alias: Ic clearhist )
3155 Remove and free the history for the specified pane.
3156 .It Ic delete-buffer Op Fl b Ar buffer-index
3157 .D1 (alias: Ic deleteb )
3158 Delete the buffer at
3159 .Ar buffer-index ,
3160 or the top buffer if not specified.
3161 .It Ic list-buffers
3162 .D1 (alias: Ic lsb )
3163 List the global buffers.
3164 .It Xo Ic load-buffer
3165 .Op Fl b Ar buffer-index
3166 .Ar path
3168 .D1 (alias: Ic loadb )
3169 Load the contents of the specified paste buffer from
3170 .Ar path .
3171 .It Xo Ic paste-buffer
3172 .Op Fl dpr
3173 .Op Fl b Ar buffer-index
3174 .Op Fl s Ar separator
3175 .Op Fl t Ar target-pane
3177 .D1 (alias: Ic pasteb )
3178 Insert the contents of a paste buffer into the specified pane.
3179 If not specified, paste into the current one.
3180 With
3181 .Fl d ,
3182 also delete the paste buffer from the stack.
3183 When output, any linefeed (LF) characters in the paste buffer are replaced with
3184 a separator, by default carriage return (CR).
3185 A custom separator may be specified using the
3186 .Fl s
3187 flag.
3189 .Fl r
3190 flag means to do no replacement (equivalent to a separator of LF).
3192 .Fl p
3193 is specified, paste bracket control codes are inserted around the
3194 buffer if the application has requested bracketed paste mode.
3195 .It Xo Ic save-buffer
3196 .Op Fl a
3197 .Op Fl b Ar buffer-index
3198 .Ar path
3200 .D1 (alias: Ic saveb )
3201 Save the contents of the specified paste buffer to
3202 .Ar path .
3204 .Fl a
3205 option appends to rather than overwriting the file.
3206 .It Xo Ic set-buffer
3207 .Op Fl b Ar buffer-index
3208 .Ar data
3210 .D1 (alias: Ic setb )
3211 Set the contents of the specified buffer to
3212 .Ar data .
3213 .It Xo Ic show-buffer
3214 .Op Fl b Ar buffer-index
3216 .D1 (alias: Ic showb )
3217 Display the contents of the specified buffer.
3219 .Sh MISCELLANEOUS
3220 Miscellaneous commands are as follows:
3221 .Bl -tag -width Ds
3222 .It Ic clock-mode Op Fl t Ar target-pane
3223 Display a large clock.
3224 .It Ic if-shell Ar shell-command command Op Ar command
3225 .D1 (alias: Ic if )
3226 Execute the first
3227 .Ar command
3229 .Ar shell-command
3230 returns success or the second
3231 .Ar command
3232 otherwise.
3233 .It Ic lock-server
3234 .D1 (alias: Ic lock )
3235 Lock each client individually by running the command specified by the
3236 .Ic lock-command
3237 option.
3238 .It Ic run-shell Ar shell-command
3239 .D1 (alias: Ic run )
3240 Execute
3241 .Ar shell-command
3242 in the background without creating a window.
3243 After it finishes, any output to stdout is displayed in copy mode.
3244 If the command doesn't return success, the exit status is also displayed.
3245 .It Ic server-info
3246 .D1 (alias: Ic info )
3247 Show server information and terminal details.
3249 .Sh TERMINFO EXTENSIONS
3251 understands some extensions to
3252 .Xr terminfo 5 :
3253 .Bl -tag -width Ds
3254 .It Em Cc , Cr
3255 Set the cursor colour.
3256 The first takes a single string argument and is used to set the colour;
3257 the second takes no arguments and restores the default cursor colour.
3258 If set, a sequence such as this may be used
3259 to change the cursor colour from inside
3260 .Nm :
3261 .Bd -literal -offset indent
3262 $ printf '\e033]12;red\e033\e\e'
3264 .It Em Cs , Csr
3265 Change the cursor style.
3266 If set, a sequence such as this may be used
3267 to change the cursor to an underline:
3268 .Bd -literal -offset indent
3269 $ printf '\e033[4 q'
3273 .Em Csr
3274 is set, it will be used to reset the cursor style instead
3276 .Em Cs .
3277 .It Em \&Ms
3278 This sequence can be used by
3280 to store the current buffer in the host terminal's selection (clipboard).
3281 See the
3282 .Em set-clipboard
3283 option above and the
3284 .Xr xterm 1
3285 man page.
3287 .Sh FILES
3288 .Bl -tag -width "/etc/tmux.confXXX" -compact
3289 .It Pa ~/.tmux.conf
3290 Default
3292 configuration file.
3293 .It Pa /etc/tmux.conf
3294 System-wide configuration file.
3296 .Sh EXAMPLES
3297 To create a new
3299 session running
3300 .Xr vi 1 :
3302 .Dl $ tmux new-session vi
3304 Most commands have a shorter form, known as an alias.
3305 For new-session, this is
3306 .Ic new :
3308 .Dl $ tmux new vi
3310 Alternatively, the shortest unambiguous form of a command is accepted.
3311 If there are several options, they are listed:
3312 .Bd -literal -offset indent
3313 $ tmux n
3314 ambiguous command: n, could be: new-session, new-window, next-window
3317 Within an active session, a new window may be created by typing
3318 .Ql C-b c
3319 (Ctrl
3320 followed by the
3321 .Ql b
3323 followed by the
3324 .Ql c
3325 key).
3327 Windows may be navigated with:
3328 .Ql C-b 0
3329 (to select window 0),
3330 .Ql C-b 1
3331 (to select window 1), and so on;
3332 .Ql C-b n
3333 to select the next window; and
3334 .Ql C-b p
3335 to select the previous window.
3337 A session may be detached using
3338 .Ql C-b d
3339 (or by an external event such as
3340 .Xr ssh 1
3341 disconnection) and reattached with:
3343 .Dl $ tmux attach-session
3345 Typing
3346 .Ql C-b \&?
3347 lists the current key bindings in the current window; up and down may be used
3348 to navigate the list or
3349 .Ql q
3350 to exit from it.
3352 Commands to be run when the
3354 server is started may be placed in the
3355 .Pa ~/.tmux.conf
3356 configuration file.
3357 Common examples include:
3359 Changing the default prefix key:
3360 .Bd -literal -offset indent
3361 set-option -g prefix C-a
3362 unbind-key C-b
3363 bind-key C-a send-prefix
3366 Turning the status line off, or changing its colour:
3367 .Bd -literal -offset indent
3368 set-option -g status off
3369 set-option -g status-bg blue
3372 Setting other options, such as the default command,
3373 or locking after 30 minutes of inactivity:
3374 .Bd -literal -offset indent
3375 set-option -g default-command "exec /bin/ksh"
3376 set-option -g lock-after-time 1800
3379 Creating new key bindings:
3380 .Bd -literal -offset indent
3381 bind-key b set-option status
3382 bind-key / command-prompt "split-window 'exec man %%'"
3383 bind-key S command-prompt "new-window -n %1 'ssh %1'"
3385 .Sh SEE ALSO
3386 .Xr pty 4
3387 .Sh AUTHORS
3388 .An Nicholas Marriott Aq nicm@users.sourceforge.net