Annotation of src/usr.bin/tmux/tmux.1, Revision 1.96
1.96 ! nicm 1: .\" $OpenBSD: tmux.1,v 1.95 2009/10/04 11:33:35 jmc Exp $
1.1 nicm 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: .\"
1.94 nicm 17: .Dd $Mdocdate: October 4 2009 $
1.1 nicm 18: .Dt TMUX 1
19: .Os
20: .Sh NAME
21: .Nm tmux
1.6 jmc 22: .Nd terminal multiplexer
1.1 nicm 23: .Sh SYNOPSIS
24: .Nm tmux
25: .Bk -words
1.90 nicm 26: .Op Fl 28dlquv
1.91 nicm 27: .Op Fl c Ar shell-command
1.1 nicm 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
1.59 jmc 35: is a terminal multiplexer:
36: it enables a number of terminals to be created, accessed, and
37: controlled from a single screen.
1.67 jmc 38: .Nm
39: may be detached from a screen
40: and continue running in the background,
41: then later reattached.
1.1 nicm 42: .Pp
1.60 nicm 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
1.64 nicm 74: Each session is persistent and will survive accidental disconnection
1.66 jmc 75: (such as
1.64 nicm 76: .Xr ssh 1
1.67 jmc 77: connection timeout) or intentional detaching (with the
1.64 nicm 78: .Ql C-b d
79: key strokes).
80: .Nm
81: may be reattached using:
82: .Pp
83: .Dl $ tmux attach
1.60 nicm 84: .Pp
1.64 nicm 85: In
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 .
1.65 nicm 94: .Pp
1.1 nicm 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 ,
1.6 jmc 104: but indicates that the terminal supports 88 colours.
1.91 nicm 105: .It Fl c Ar shell-command
106: Execute
107: .Ar shell-command
108: using the default shell.
109: If necessary, the
110: .Nm
111: server will be started to retrieve the
112: .Ic default-shell
113: option.
1.1 nicm 114: .It Fl d
115: Force
116: .Nm
117: to assume the terminal supports default colours.
118: .It Fl f Ar file
119: Specify an alternative configuration file.
120: By default,
121: .Nm
1.26 nicm 122: loads the system configuration file from
123: .Pa /etc/tmux.conf ,
124: if present, then looks for a user configuration file at
1.1 nicm 125: .Pa ~/.tmux.conf .
126: The configuration file is a set of
127: .Nm
128: commands which are executed in sequence when the server is first started.
1.61 nicm 129: .Pp
130: If a command in the configuration file fails,
131: .Nm
132: will report an error and exit without executing further commands.
1.82 nicm 133: .It Fl l
134: Behave as a login shell.
135: This flag currently has no effect and is for compatibility with other shells
136: when using tmux as a login shell.
1.1 nicm 137: .It Fl L Ar socket-name
138: .Nm
139: stores the server socket in a directory under
140: .Pa /tmp ;
141: the default socket is named
142: .Em default .
143: This option allows a different socket name to be specified, allowing several
144: independent
145: .Nm
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.
1.2 nicm 151: .Pp
152: If the socket is accidentally removed, the
1.6 jmc 153: .Dv SIGUSR1
1.2 nicm 154: signal may be sent to the
155: .Nm
156: server process to recreate it.
1.4 sobrado 157: .It Fl q
1.6 jmc 158: Prevent the server sending various informational messages, for example when
1.4 sobrado 159: window flags are altered.
1.1 nicm 160: .It Fl S Ar socket-path
161: Specify a full alternative path to the server socket.
162: If
163: .Fl S
164: is specified, the default socket directory is not used and any
165: .Fl L
166: flag is ignored.
167: .It Fl u
168: .Nm
1.14 nicm 169: attempts to guess if the terminal is likely to support UTF-8 by checking the
170: first of the
171: .Ev LC_ALL ,
172: .Ev LC_CTYPE
173: and
1.2 nicm 174: .Ev LANG
1.14 nicm 175: environment variables to be set for the string "UTF-8".
1.5 nicm 176: This is not always correct: the
1.2 nicm 177: .Fl u
178: flag explicitly informs
179: .Nm
1.6 jmc 180: that UTF-8 is supported.
1.33 nicm 181: .Pp
182: If the server is started from a client passed
183: .Fl u
184: or where UTF-8 is detected, the
185: .Ic utf8
186: and
187: .Ic status-utf8
188: options are enabled in the global window and session options respectively.
1.1 nicm 189: .It Fl v
190: Request verbose logging.
191: This option may be specified multiple times for increasing verbosity.
192: Log messages will be saved into
193: .Pa tmux-client-PID.log
194: and
195: .Pa tmux-server-PID.log
196: files in the current directory, where
197: .Em PID
1.6 jmc 198: is the PID of the server or client process.
1.1 nicm 199: .It Ar command Op Ar flags
200: This specifies one of a set of commands used to control
201: .Nm ,
1.6 jmc 202: as described in the following sections.
1.59 jmc 203: If no commands are specified, the
1.1 nicm 204: .Ic new-session
205: command is assumed.
1.57 jmc 206: .El
1.64 nicm 207: .Sh KEY BINDINGS
208: .Nm
209: may be controlled from an attached client by using a key combination of a
210: prefix key,
211: .Ql C-b
212: (Ctrl-b) by default, followed by a command key.
213: .Pp
214: Some of the default key bindings are:
215: .Pp
1.67 jmc 216: .Bl -tag -width Ds -offset indent -compact
1.64 nicm 217: .It c
1.65 nicm 218: Create a new window.
1.64 nicm 219: .It d
1.65 nicm 220: Detach the current client.
1.64 nicm 221: .It l
1.65 nicm 222: Move to the previously selected window.
1.64 nicm 223: .It n
1.65 nicm 224: Change to the next window.
1.64 nicm 225: .It p
1.65 nicm 226: Change to the previous window.
227: .It &
228: Kill the current window.
229: .It ,
230: Rename the current window.
1.64 nicm 231: .It \&?
1.65 nicm 232: List all key bindings.
1.64 nicm 233: .El
234: .Pp
235: A complete list may be obtained with the
236: .Ic list-keys
237: command (bound to
238: .Ql \&?
239: by default).
240: Key bindings may be changed with the
241: .Ic bind-key
242: and
243: .Ic unbind-key
244: commands.
1.57 jmc 245: .Sh COMMANDS
246: This section contains a list of the commands supported by
247: .Nm .
248: Most commands accept the optional
249: .Fl t
250: argument with one of
251: .Ar target-client ,
252: .Ar target-session
253: .Ar target-window ,
254: or
255: .Ar target-pane .
256: These specify the client, session, window or pane which a command should affect.
257: .Ar target-client
258: is the name of the
259: .Xr pty 4
260: file to which the client is connected, for example either of
261: .Pa /dev/ttyp1
262: or
263: .Pa ttyp1
264: for the client attached to
265: .Pa /dev/ttyp1 .
266: If no client is specified, the current client is chosen, if possible, or an
267: error is reported.
268: Clients may be listed with the
269: .Ic list-clients
270: command.
1.1 nicm 271: .Pp
1.57 jmc 272: .Ar target-session
273: is either the name of a session (as listed by the
274: .Ic list-sessions
275: command) or the name of a client with the same syntax as
276: .Ar target-client ,
277: in which case the session attached to the client is used.
278: When looking for the session name,
279: .Nm
280: initially searches for an exact match; if none is found, the session names
281: are checked for any for which
282: .Ar target-session
283: is a prefix or for which it matches as an
284: .Xr fnmatch 3
285: pattern.
286: If a single match is found, it is used as the target session; multiple matches
287: produce an error.
288: If a session is omitted, the current session is used if available; if no
289: current session is available, the most recently created is chosen.
1.1 nicm 290: .Pp
1.57 jmc 291: .Ar target-window
292: specifies a window in the form
293: .Em session Ns \&: Ns Em window .
294: .Em session
295: follows the same rules as for
296: .Ar target-session ,
297: and
298: .Em window
299: is looked for in order: as a window index, for example mysession:1; as an exact
300: window name, such as mysession:mywindow; then as an
301: .Xr fnmatch 3
302: pattern or the start of a window name, such as mysession:mywin* or
303: mysession:mywin.
304: An empty window name specifies the next unused index if appropriate (for
305: example the
306: .Ic new-window
307: and
308: .Ic link-window
309: commands)
310: otherwise the current window in
311: .Em session
312: is chosen.
313: When the argument does not contain a colon,
314: .Nm
315: first attempts to parse it as window; if that fails, an attempt is made to
316: match a session.
1.1 nicm 317: .Pp
1.57 jmc 318: .Ar target-pane
319: takes a similar form to
320: .Ar target-window
321: but with the optional addition of a period followed by a pane index, for
322: example: mysession:mywindow.1.
323: If the pane index is omitted, the currently active pane in the specified
324: window is used.
325: If neither a colon nor period appears,
1.13 nicm 326: .Nm
1.57 jmc 327: first attempts to use the argument as a pane index; if that fails, it is looked
328: up as for
329: .Ar target-window .
1.15 jmc 330: .Pp
1.57 jmc 331: Multiple commands may be specified together as part of a
332: .Em command sequence .
333: Each command should be separated by spaces and a semicolon;
334: commands are executed sequentially from left to right.
335: A literal semicolon may be included by escaping it with a backslash (for
336: example, when specifying a command sequence to
337: .Ic bind-key ) .
1.13 nicm 338: .Pp
1.57 jmc 339: Examples include:
1.13 nicm 340: .Bd -literal -offset indent
1.57 jmc 341: refresh-client -t/dev/ttyp2
342:
343: rename-session -tfirst newname
344:
345: set-window-option -t:0 monitor-activity on
346:
347: new-window ; split-window -d
1.13 nicm 348: .Ed
1.57 jmc 349: .Sh CLIENTS AND SESSIONS
350: The following commands are available:
351: .Bl -tag -width Ds
352: .It Xo Ic attach-session
353: .Op Fl d
354: .Op Fl t Ar target-session
355: .Xc
356: .D1 (alias: Ic attach )
357: If run from outside
358: .Nm ,
359: create a new client in the current terminal and attach it to
360: .Ar target-session .
361: If used from inside, switch the current client.
362: If
363: .Fl d
364: is specified, any other clients attached to the session are detached.
1.13 nicm 365: .Pp
1.57 jmc 366: If no server is started,
367: .Ic attach-session
368: will attempt to start it; this will fail unless sessions are created in the
369: configuration file.
370: .It Ic detach-client Op Fl t Ar target-client
371: .D1 (alias: Ic detach )
372: Detach the current client if bound to a key, or the specified client with
373: .Fl t .
374: .It Ic has-session Op Fl t Ar target-session
375: .D1 (alias: Ic has )
376: Report an error and exit with 1 if the specified session does not exist.
377: If it does exist, exit with 0.
378: .It Ic kill-server
379: Kill the
1.1 nicm 380: .Nm
1.57 jmc 381: server and clients and destroy all sessions.
382: .It Ic kill-session Op Fl t Ar target-session
383: Destroy the given session, closing any windows linked to it and no other
384: sessions, and detaching all clients attached to it.
385: .It Ic list-clients
386: .D1 (alias: Ic lsc )
387: List all clients attached to the server.
388: .It Ic list-commands
389: .D1 (alias: Ic lscm )
390: List the syntax of all commands supported by
391: .Nm .
392: .It Ic list-sessions
393: .D1 (alias: Ic ls )
394: List all sessions managed by the server.
1.92 nicm 395: .It Xo Ic lock-client
396: .Op Fl t Ar target-client
397: .Xc
398: Lock
399: .Ar target-client ,
400: see the
401: .Ic lock-server
402: command.
403: .It Xo Ic lock-session
404: .Op Fl t Ar target-session
405: .Xc
406: Lock all clients attached to
407: .Ar target-session .
1.57 jmc 408: .It Xo Ic new-session
409: .Op Fl d
410: .Op Fl n Ar window-name
411: .Op Fl s Ar session-name
412: .Op Ar command
413: .Xc
414: .D1 (alias: Ic new )
415: Create a new session with name
416: .Ar session-name .
417: The new session is attached to the current terminal unless
418: .Fl d
419: is given.
420: .Ar window-name
1.1 nicm 421: and
1.57 jmc 422: .Ar command
423: are the name of and command to execute in the initial window.
1.68 nicm 424: .Pp
425: If run from a terminal, any
426: .Xr termios 4
427: special characters are saved and used for new windows in the new session.
1.57 jmc 428: .It Ic refresh-client Op Fl t Ar target-client
429: .D1 (alias: Ic refresh )
430: Refresh the current client if bound to a key, or a single client if one is given
431: with
432: .Fl t .
433: .It Xo Ic rename-session
434: .Op Fl t Ar target-session
435: .Ar new-name
436: .Xc
437: .D1 (alias: Ic rename )
438: Rename the session to
439: .Ar new-name .
440: .It Ic source-file Ar path
441: .D1 (alias: Ic source )
442: Execute commands from
443: .Ar path .
444: .It Ic start-server
445: .D1 (alias: Ic start )
446: Start the
1.1 nicm 447: .Nm
1.57 jmc 448: server, if not already running, without creating any sessions.
449: .It Xo Ic suspend-client
450: .Op Fl c Ar target-client
451: .Xc
452: .D1 (alias: Ic suspendc )
453: Suspend a client by sending
454: .Dv SIGTSTP
455: (tty stop).
456: .It Xo Ic switch-client
457: .Op Fl c Ar target-client
458: .Op Fl t Ar target-session
459: .Xc
460: .D1 (alias: Ic switchc )
461: Switch the current session for client
462: .Ar target-client
463: to
464: .Ar target-session .
465: .El
466: .Sh WINDOWS AND PANES
1.1 nicm 467: A
468: .Nm
469: window may be in one of several modes.
470: The default permits direct access to the terminal attached to the window.
471: The others are:
472: .Bl -tag -width Ds
473: .It Em output mode
474: This is entered when a command which produces output, such as
475: .Ic list-keys ,
476: is executed from a key binding.
477: .It Em scroll mode
478: This is entered with the
479: .Ic scroll-mode
480: command (bound to
481: .Ql =
482: by default) and permits the window history buffer to be inspected.
483: .It Em copy mode
484: This permits a section of a window or its history to be copied to a
485: .Em paste buffer
486: for later insertion into another window.
487: This mode is entered with the
488: .Ic copy-mode
489: command, bound to
490: .Ql [
491: by default.
492: .El
493: .Pp
1.6 jmc 494: The keys available depend on whether emacs or vi mode is selected
495: (see the
1.1 nicm 496: .Ic mode-keys
497: option).
498: The following keys are supported as appropriate for the mode:
499: .Bl -column "FunctionXXXXXXXXXXXX" "viXXXXXX" "emacs" -offset indent
500: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
1.27 nicm 501: .It Li "Back to indentation" Ta "^" Ta "M-m"
1.1 nicm 502: .It Li "Clear selection" Ta "Escape" Ta "C-g"
503: .It Li "Copy selection" Ta "Enter" Ta "M-w"
504: .It Li "Cursor down" Ta "j" Ta "Down"
1.70 nicm 505: .It Li "Cursor left" Ta "h" Ta "Left"
506: .It Li "Cursor right" Ta "l" Ta "Right"
507: .It Li "Cursor up" Ta "k" Ta "Up"
1.71 nicm 508: .It Li "Delete entire line" Ta "d" Ta "C-u"
1.70 nicm 509: .It Li "Delete to end of line" Ta "D" Ta "C-k"
1.1 nicm 510: .It Li "End of line" Ta "$" Ta "C-e"
1.94 nicm 511: .It Li "Goto line" Ta ":" Ta "g"
1.1 nicm 512: .It Li "Next page" Ta "C-f" Ta "Page down"
513: .It Li "Next word" Ta "w" Ta "M-f"
1.70 nicm 514: .It Li "Paste buffer" Ta "p" Ta "C-y"
1.1 nicm 515: .It Li "Previous page" Ta "C-u" Ta "Page up"
516: .It Li "Previous word" Ta "b" Ta "M-b"
517: .It Li "Quit mode" Ta "q" Ta "Escape"
1.96 ! nicm 518: .It Li "Scroll down" Ta "C-Down" Ta "C-Down"
! 519: .It Li "Scroll up" Ta "C-Up" Ta "C-Up"
1.70 nicm 520: .It Li "Search again" Ta "n" Ta "n"
521: .It Li "Search backward" Ta "?" Ta "C-r"
522: .It Li "Search forward" Ta "/" Ta "C-s"
523: .It Li "Start of line" Ta "0" Ta "C-a"
1.1 nicm 524: .It Li "Start selection" Ta "Space" Ta "C-Space"
1.80 nicm 525: .It Li "Transpose chars" Ta "" Ta "C-t"
1.1 nicm 526: .El
527: .Pp
1.48 nicm 528: These key bindings are defined in a set of named tables:
529: .Em vi-edit
530: and
531: .Em emacs-edit
532: for keys used when line editing at the command prompt;
533: .Em vi-choice
534: and
535: .Em emacs-choice
536: for keys used when choosing from lists (such as produced by the
537: .Ic window-choose
538: command) or in output mode; and
539: .Em vi-copy
540: and
541: .Em emacs-copy
542: used in copy and scroll modes.
543: The tables may be viewed with the
544: .Ic list-keys
1.49 nicm 545: command and keys modified or removed with
546: .Ic bind-key
547: and
548: .Ic unbind-key .
1.48 nicm 549: .Pp
1.2 nicm 550: The paste buffer key pastes the first line from the top paste buffer on the
551: stack.
1.57 jmc 552: .Pp
553: The mode commands are as follows:
554: .Bl -tag -width Ds
555: .It Xo Ic copy-mode
556: .Op Fl u
1.72 nicm 557: .Op Fl t Ar target-pane
1.57 jmc 558: .Xc
559: Enter copy mode.
560: The
561: .Fl u
562: option scrolls one page up.
563: .It Xo Ic scroll-mode
564: .Op Fl u
1.72 nicm 565: .Op Fl t Ar target-pane
1.57 jmc 566: .Xc
567: Enter scroll mode.
568: The
569: .Fl u
570: has the same meaning as in the
1.1 nicm 571: .Ic copy-mode
1.18 nicm 572: command.
1.57 jmc 573: .El
1.18 nicm 574: .Pp
1.1 nicm 575: Each window displayed by
576: .Nm
577: may be split into one or more
578: .Em panes ;
579: each pane takes up a certain area of the display and is a separate terminal.
580: A window may be split into panes using the
581: .Ic split-window
582: command.
1.38 nicm 583: Windows may be split horizontally (with the
584: .Fl h
585: flag) or vertically.
586: Panes may be resized with the
587: .Ic resize-pane
1.1 nicm 588: command (bound to
1.38 nicm 589: .Ql C-up ,
590: .Ql C-down
591: .Ql C-left
592: and
593: .Ql C-right
1.1 nicm 594: by default), the current pane may be changed with the
595: .Ic up-pane
596: and
597: .Ic down-pane
598: commands and the
599: .Ic rotate-window
600: and
601: .Ic swap-pane
1.38 nicm 602: commands may be used to swap panes without changing their position.
603: Panes are numbered beginning from zero in the order they are created.
604: .Pp
605: A number of preset
606: .Em layouts
607: are available.
608: These may be selected with the
609: .Ic select-layout
610: command or cycled with
611: .Ic next-layout
612: (bound to
613: .Ql C-space
614: by default); once a layout is chosen, panes within it may be moved and resized as normal.
1.1 nicm 615: .Pp
616: The following layouts are supported:
617: .Bl -tag -width Ds
618: .It Ic even-horizontal
619: Panes are spread out evenly from left to right across the window.
620: .It Ic even-vertical
621: Panes are spread evenly from top to bottom.
1.2 nicm 622: .It Ic main-horizontal
623: A large (main) pane is shown at the top of the window and the remaining panes are
1.6 jmc 624: spread from left to right in the leftover space at the bottom.
1.2 nicm 625: Use the
626: .Em main-pane-height
627: window option to specify the height of the top pane.
1.1 nicm 628: .It Ic main-vertical
1.2 nicm 629: Similar to
630: .Ic main-horizontal
631: but the large pane is placed on the left and the others spread from top to
632: bottom along the right.
633: See the
634: .Em main-pane-width
635: window option.
1.1 nicm 636: .El
1.8 nicm 637: .Pp
1.57 jmc 638: Commands related to windows and panes are as follows:
639: .Bl -tag -width Ds
640: .It Xo Ic break-pane
641: .Op Fl d
642: .Op Fl t Ar target-pane
643: .Xc
644: .D1 (alias: Ic breakp )
645: Break
646: .Ar target-pane
647: off from its containing window to make it the only pane in a new window.
648: If
649: .Fl d
650: is given, the new window does not become the current window.
1.76 nicm 651: .It Xo
652: .Ic choose-client
653: .Op Fl t Ar target-window
654: .Op Ar template
655: .Xc
656: Put a window into client choice mode, allowing a client to be selected
657: interactively from a list.
658: After a client is chosen,
659: .Ql %%
660: is replaced by the client
661: .Xr pty 4
662: path in
663: .Ar template
664: and the result executed as a command.
665: If
666: .Ar template
667: is not given, "detach-client -t '%%'" is used.
1.57 jmc 668: This command works only from inside
669: .Nm .
1.76 nicm 670: .It Xo
671: .Ic choose-session
672: .Op Fl t Ar target-window
673: .Op Ar template
674: .Xc
675: Put a window into session choice mode, where a session may be selected
676: interactively from a list.
677: When one is chosen,
678: .Ql %%
679: is replaced by the session name in
680: .Ar template
681: and the result executed as a command.
682: If
683: .Ar template
684: is not given, "switch-client -t '%%'" is used.
685: This command works only from inside
686: .Nm .
687: .It Xo
688: .Ic choose-window
689: .Op Fl t Ar target-window
690: .Op Ar template
691: .Xc
692: Put a window into window choice mode, where a window may be chosen
693: interactively from a list.
694: After a window is selected,
695: .Ql %%
696: is replaced by the session name and window index in
697: .Ar template
698: and the result executed as a command.
699: If
700: .Ar template
701: is not given, "select-window -t '%%'" is used.
1.57 jmc 702: This command works only from inside
703: .Nm .
1.78 nicm 704: .It Ic display-panes Op Fl t Ar target-client
705: .D1 (alias: Ic displayp)
706: Display a visible indicator of each pane shown by
707: .Ar target-client .
708: See the
709: .Ic display-panes-time
710: and
711: .Ic display-panes-colour
712: session options.
1.84 nicm 713: While the indicator is on screen, a pane may be selected with the
714: .Ql 0
715: to
716: .Ql 9
717: keys.
1.57 jmc 718: .It Ic down-pane Op Fl t Ar target-pane
719: .D1 (alias: Ic downp )
720: Move down a pane.
721: .It Xo Ic find-window
722: .Op Fl t Ar target-window
723: .Ar match-string
724: .Xc
725: .D1 (alias: Ic findw )
726: Search for the
727: .Xr fnmatch 3
728: pattern
729: .Ar match-string
730: in window names, titles, and visible content (but not history).
731: If only one window is matched, it'll be automatically selected, otherwise a
732: choice list is shown.
733: This command only works from inside
1.1 nicm 734: .Nm .
1.57 jmc 735: .It Ic kill-pane Op Fl t Ar target-pane
736: .D1 (alias: Ic killp )
737: Destroy the given pane.
738: If no panes remain in the containing window, it is also destroyed.
739: .It Ic kill-window Op Fl t Ar target-window
740: .D1 (alias: Ic killw )
741: Kill the current window or the window at
742: .Ar target-window ,
1.1 nicm 743: removing it from any sessions to which it is linked.
1.56 jmc 744: .It Ic last-window Op Fl t Ar target-session
1.1 nicm 745: .D1 (alias: Ic last )
746: Select the last (previously selected) window.
747: If no
748: .Ar target-session
749: is specified, select the last window of the current session.
750: .It Xo Ic link-window
751: .Op Fl dk
752: .Op Fl s Ar src-window
753: .Op Fl t Ar dst-window
754: .Xc
755: .D1 (alias: Ic linkw )
756: Link the window at
757: .Ar src-window
758: to the specified
759: .Ar dst-window .
760: If
761: .Ar dst-window
762: is specified and no such window exists, the
763: .Ar src-window
764: is linked there.
765: If
766: .Fl k
767: is given and
768: .Ar dst-window
769: exists, it is killed, otherwise an error is generated.
770: If
771: .Fl d
772: is given, the newly linked window is not selected.
1.56 jmc 773: .It Ic list-windows Op Fl t Ar target-session
1.1 nicm 774: .D1 (alias: Ic lsw )
775: List windows in the current session or in
776: .Ar target-session .
777: .It Xo Ic move-window
778: .Op Fl d
779: .Op Fl s Ar src-window
780: .Op Fl t Ar dst-window
781: .Xc
782: .D1 (alias: Ic movew )
783: This is similar to
784: .Ic link-window ,
785: except the window at
786: .Ar src-window
787: is moved to
788: .Ar dst-window .
789: .It Xo Ic new-window
1.28 nicm 790: .Op Fl dk
1.1 nicm 791: .Op Fl n Ar window-name
792: .Op Fl t Ar target-window
793: .Op Ar command
794: .Xc
795: .D1 (alias: Ic neww )
796: Create a new window.
797: If
798: .Fl d
799: is given, the session does not make the new window the current window.
800: .Ar target-window
1.28 nicm 801: represents the window to be created; if the target already exists an error is
802: shown, unless the
803: .Fl k
804: flag is used, in which case it is destroyed.
1.1 nicm 805: .Ar command
806: is the command to execute.
807: If
808: .Ar command
809: is not specified, the default command is used.
810: .Pp
811: The
812: .Ev TERM
813: environment variable must be set to
814: .Dq screen
815: for all programs running
816: .Em inside
817: .Nm .
818: New windows will automatically have
819: .Dq TERM=screen
820: added to their environment, but care must be taken not to reset this in shell
821: start-up files.
1.56 jmc 822: .It Ic next-layout Op Fl t Ar target-window
1.1 nicm 823: .D1 (alias: Ic nextl )
824: Move a window to the next layout and rearrange the panes to fit.
825: .It Xo Ic next-window
1.9 nicm 826: .Op Fl a
1.1 nicm 827: .Op Fl t Ar target-session
828: .Xc
829: .D1 (alias: Ic next )
830: Move to the next window in the session.
1.9 nicm 831: If
1.12 jmc 832: .Fl a
1.9 nicm 833: is used, move to the next window with a bell, activity or content alert.
1.1 nicm 834: .It Xo Ic previous-window
1.9 nicm 835: .Op Fl a
1.1 nicm 836: .Op Fl t Ar target-session
837: .Xc
838: .D1 (alias: Ic prev )
839: Move to the previous window in the session.
1.9 nicm 840: With
841: .Fl a ,
842: move to the previous window with a bell, activity or content alert.
1.1 nicm 843: .It Xo Ic rename-window
844: .Op Fl t Ar target-window
845: .Ar new-name
846: .Xc
847: .D1 (alias: Ic renamew )
848: Rename the current window, or the window at
849: .Ar target-window
850: if specified, to
851: .Ar new-name .
852: .It Xo Ic resize-pane
1.39 jmc 853: .Op Fl DLRU
1.52 nicm 854: .Op Fl t Ar target-pane
1.1 nicm 855: .Op Ar adjustment
856: .Xc
857: .D1 (alias: Ic resizep )
1.57 jmc 858: Resize a pane, upward with
859: .Fl U
860: (the default), downward with
861: .Fl D ,
862: to the left with
863: .Fl L
864: and to the right with
865: .Fl R .
866: The
867: .Ar adjustment
868: is given in lines or cells (the default is 1).
869: .It Xo Ic respawn-window
870: .Op Fl k
871: .Op Fl t Ar target-window
872: .Op Ar command
873: .Xc
874: .D1 (alias: Ic respawnw )
875: Reactive a window in which the command has exited (see the
876: .Ic remain-on-exit
877: window option).
878: If
879: .Ar command
880: is not given, the command used when the window was created is executed.
881: The window must be already inactive, unless
882: .Fl k
883: is given, in which case any existing command is killed.
884: .It Xo Ic rotate-window
885: .Op Fl DU
886: .Op Fl t Ar target-window
887: .Xc
888: .D1 (alias: Ic rotatew )
889: Rotate the positions of the panes within a window, either upward (numerically
890: lower) with
891: .Fl U
892: or downward (numerically higher).
893: .It Xo Ic select-layout
894: .Op Fl t Ar target-window
895: .Op Ar layout-name
896: .Xc
897: .D1 (alias: selectl )
898: Choose a specific layout for a window.
899: If
900: .Ar layout-name
901: is not given, the last layout used (if any) is reapplied.
902: .It Ic select-pane Op Fl t Ar target-pane
903: .D1 (alias: Ic selectp )
904: Make pane
905: .Ar target-pane
906: the active pane in window
907: .Ar target-window .
908: .It Ic select-window Op Fl t Ar target-window
909: .D1 (alias: Ic selectw )
910: Select the window at
911: .Ar target-window .
912: .It Xo Ic split-window
913: .Op Fl dhv
914: .Oo Fl l
915: .Ar size |
916: .Fl p Ar percentage Oc
917: .Op Fl t Ar target-window
918: .Op Ar command
919: .Xc
920: .D1 (alias: splitw )
921: Creates a new pane by splitting the active pane:
922: .Fl h
923: does a horizontal split and
924: .Fl v
925: a vertical split; if neither is specified,
926: .Fl v
927: is assumed.
928: The
929: .Fl l
930: and
931: .Fl p
932: options specify the size of the new window in lines (for vertical split) or in
933: cells (for horizontal split), or as a percentage, respectively.
934: All other options have the same meaning as in the
935: .Ic new-window
936: command.
937: .It Xo Ic swap-pane
938: .Op Fl dDU
939: .Op Fl s Ar src-pane
940: .Op Fl t Ar dst-pane
941: .Xc
942: .D1 (alias: Ic swapp )
943: Swap two panes.
944: If
945: .Fl U
946: is used and no source pane is specified with
947: .Fl s ,
948: .Ar dst-pane
949: is swapped with the previous pane (before it numerically);
950: .Fl D
951: swaps with the next pane (after it numerically).
952: .It Xo Ic swap-window
953: .Op Fl d
954: .Op Fl s Ar src-window
955: .Op Fl t Ar dst-window
956: .Xc
957: .D1 (alias: Ic swapw )
958: This is similar to
959: .Ic link-window ,
960: except the source and destination windows are swapped.
961: It is an error if no window exists at
962: .Ar src-window .
963: .It Xo Ic unlink-window
1.1 nicm 964: .Op Fl k
965: .Op Fl t Ar target-window
966: .Xc
1.57 jmc 967: .D1 (alias: Ic unlinkw )
968: Unlink
969: .Ar target-window .
970: Unless
971: .Fl k
972: is given, a window may be unlinked only if it is linked to multiple sessions -
973: windows may not be linked to no sessions;
974: if
1.1 nicm 975: .Fl k
1.57 jmc 976: is specified and the window is linked to only one session, it is unlinked and
977: destroyed.
978: .It Ic up-pane Op Fl t Ar target-pane
979: .D1 (alias: Ic upp )
980: Move up a pane.
981: .El
982: .Sh KEY BINDINGS
1.93 nicm 983: .Nm
984: allows a command to be bound to most keys, with or without a prefix key.
985: When specifying keys, most represent themselves (for example
986: .Ql A
987: to
1.95 jmc 988: .Ql Z ) .
1.93 nicm 989: Ctrl keys may be prefixed with
990: .Ql C-
991: or
1.95 jmc 992: .Ql ^ ,
993: and Alt (meta) with
1.93 nicm 994: .Ql M- .
995: In addition, the following special key names are accepted:
996: .Em BSpace ,
997: .Em BTab ,
998: .Em DC
999: (Delete),
1000: .Em End ,
1001: .Em Enter ,
1002: .Em Escape ,
1003: .Em F1
1004: to
1005: .Em F20 ,
1006: .Em Home ,
1007: .Em IC
1008: (Insert),
1009: .Em NPage
1010: (Page Up),
1011: .Em PPage
1012: (Page Down),
1013: .Em Space ,
1014: and
1015: .Em Tab .
1016: Note that to bind the
1017: .Ql \&"
1018: or
1019: .Ql '
1020: keys, quotation marks are necessary, for example:
1021: .Bd -literal -offset indent
1022: bind-key '"' split-window
1023: bind-key "'" select-prompt
1024: .Ed
1025: .Pp
1.57 jmc 1026: Commands related to key bindings are as follows:
1027: .Bl -tag -width Ds
1028: .It Xo Ic bind-key
1029: .Op Fl cnr
1030: .Op Fl t Ar key-table
1031: .Ar key Ar command Op Ar arguments
1.1 nicm 1032: .Xc
1.57 jmc 1033: .D1 (alias: Ic bind )
1034: Bind key
1035: .Ar key
1036: to
1037: .Ar command .
1038: By default (without
1039: .Fl t )
1040: the primary key bindings are modified (those normally activated with the prefix
1041: key); in this case, if
1042: .Fl n
1043: is specified, it is not necessary to use the prefix key,
1044: .Ar command
1045: is bound to
1046: .Ar key
1047: alone.
1.1 nicm 1048: The
1.57 jmc 1049: .Fl r
1050: flag indicates this key may repeat, see the
1051: .Ic repeat-time
1052: option.
1053: .Pp
1054: If
1055: .Fl t
1056: is present,
1057: .Ar key
1058: is bound in
1059: .Ar key-table :
1060: the binding for command mode with
1061: .Fl c
1062: or for normal mode without.
1063: To view the default bindings and possible commands, see the
1064: .Ic list-keys
1065: command.
1066: .It Ic list-keys Op Fl t Ar key-table
1067: .D1 (alias: Ic lsk )
1068: List all key bindings.
1069: Without
1070: .Fl t
1071: the primary key bindings - those executed when preceded by the prefix key -
1072: are printed.
1073: Keys bound without the prefix key (see
1074: .Ic bind-key
1075: .Fl n )
1076: are enclosed in square brackets.
1077: .Pp
1078: With
1079: .Fl t ,
1080: the key bindings in
1081: .Ar key-table
1082: are listed; this may be one of:
1083: .Em vi-edit ,
1084: .Em emacs-edit ,
1085: .Em vi-choice ,
1086: .Em emacs-choice ,
1087: .Em vi-copy
1088: or
1089: .Em emacs-copy .
1090: .It Xo Ic send-keys
1.72 nicm 1091: .Op Fl t Ar target-pane
1.57 jmc 1092: .Ar key Ar ...
1.1 nicm 1093: .Xc
1.57 jmc 1094: .D1 (alias: Ic send )
1095: Send a key or keys to a window.
1096: Each argument
1097: .Ar key
1098: is the name of the key (such as
1099: .Ql C-a
1100: or
1101: .Ql npage
1102: ) to send; if the string is not recognised as a key, it is sent as a series of
1103: characters.
1104: All arguments are sent sequentially from first to last.
1.72 nicm 1105: .It Ic send-prefix Op Fl t Ar target-pane
1.57 jmc 1106: Send the prefix key to a window as if it was pressed.
1.89 nicm 1107: If multiple prefix keys are configured, only the first is sent.
1.57 jmc 1108: .It Xo Ic unbind-key
1109: .Op Fl cn
1110: .Op Fl t Ar key-table
1111: .Ar key
1.2 nicm 1112: .Xc
1.57 jmc 1113: .D1 (alias: Ic unbind )
1114: Unbind the command bound to
1115: .Ar key .
1116: Without
1117: .Fl t
1118: the primary key bindings are modified; in this case, if
1119: .Fl n
1120: is specified, the command bound to
1121: .Ar key
1122: without a prefix (if any) is removed.
1123: .Pp
1.47 nicm 1124: If
1.57 jmc 1125: .Fl t
1126: is present,
1127: .Ar key
1128: in
1129: .Ar key-table
1130: is unbound: the binding for command mode with
1131: .Fl c
1132: or for normal mode without.
1133: .El
1134: .Sh OPTIONS
1135: The appearance and behaviour of
1136: .Nm
1137: may be modified by changing the value of various options.
1138: There are two types of option:
1139: .Em session options
1140: and
1141: .Em window options .
1142: .Pp
1143: Each individual session may have a set of session options, and there is a
1144: separate set of global session options.
1145: Sessions which do not have a particular option configured inherit the value
1146: from the global session options.
1147: Session options are set or unset with the
1148: .Ic set-option
1149: command and may be listed with the
1150: .Ic show-options
1151: command.
1152: The available session options are listed under the
1153: .Ic set-option
1154: command.
1155: .Pp
1156: Similarly, a set of window options is attached to each window, and there is
1157: a set of global window options from which any unset options are inherited.
1158: Window options are altered with the
1159: .Ic set-window-option
1160: command and can be listed with the
1161: .Ic show-window-options
1162: command.
1163: All window options are documented with the
1164: .Ic set-window-option
1165: command.
1166: .Pp
1167: Commands which set options are as follows:
1168: .Bl -tag -width Ds
1.1 nicm 1169: .It Xo Ic set-option
1.58 nicm 1170: .Op Fl agu
1.1 nicm 1171: .Op Fl t Ar target-session
1172: .Ar option Ar value
1173: .Xc
1174: .D1 (alias: Ic set )
1.18 nicm 1175: Set a session option.
1.58 nicm 1176: With
1177: .Fl a ,
1178: and if the option expects a string,
1179: .Ar value
1180: is appended to the existing setting.
1.1 nicm 1181: If
1182: .Fl g
1.18 nicm 1183: is specified, the global session option is set.
1.1 nicm 1184: The
1185: .Fl u
1186: flag unsets an option, so a session inherits the option from the global
1187: options - it is not possible to unset a global option.
1188: .Pp
1.18 nicm 1189: Available session options are:
1.1 nicm 1190: .Bl -tag -width Ds
1.69 nicm 1191: .It Ic base-index Ar index
1192: Set the base index from which an unused index should be searched when a new
1193: window is created.
1194: The default is zero.
1.1 nicm 1195: .It Xo Ic bell-action
1.56 jmc 1196: .Op Ic any | none | current
1.1 nicm 1197: .Xc
1198: Set action on window bell.
1199: .Ic any
1200: means a bell in any window linked to a session causes a bell in the current
1201: window of that session,
1202: .Ic none
1203: means all bells are ignored and
1204: .Ic current
1205: means only bell in windows other than the current window are ignored.
1206: .It Ic buffer-limit Ar number
1207: Set the number of buffers kept for each session; as new buffers are added to
1208: the top of the stack, old ones are removed from the bottom if necessary to
1209: maintain this maximum length.
1210: .It Ic default-command Ar command
1211: Set the command used for new windows (if not specified when the window is
1212: created) to
1.79 nicm 1213: .Ar command ,
1214: which may be any
1215: .Xr sh 1
1216: command.
1.19 nicm 1217: The default is an empty string, which instructs
1218: .Nm
1.79 nicm 1219: to create a login shell using the value of the
1220: .Ic default-shell
1221: option.
1222: .It Ic default-shell Ar path
1223: Specify the default shell.
1224: This is used as the login shell for new windows when the
1225: .Ic default-command
1226: option is set to empty, and must be the full path of the executable.
1227: When started
1228: .Nm
1229: tries to set a default value from the first suitable of the
1.19 nicm 1230: .Ev SHELL
1.79 nicm 1231: environment variable, the shell returned by
1232: .Xr getpwuid 3 ,
1233: or
1234: .Pa /bin/sh .
1235: This option should be configured when
1236: .Nm
1237: is used as a login shell.
1.1 nicm 1238: .It Ic default-path Ar path
1239: Set the default working directory for processes created from keys, or
1240: interactively from the prompt.
1241: The default is the current working directory when the server is started.
1.22 nicm 1242: .It Ic default-terminal Ar terminal
1243: Set the default terminal for new windows created in this session - the
1244: default value of the
1245: .Ev TERM
1246: environment variable.
1247: For
1248: .Nm
1249: to work correctly, this
1250: .Em must
1251: be set to
1252: .Ql screen
1253: or a derivative of it.
1.78 nicm 1254: .It Ic display-panes-colour Ar colour
1255: Set the colour used for the
1256: .Ic display-panes
1257: command.
1258: .It Ic display-panes-time Ar time
1259: Set the time in milliseconds for which the indicators shown by the
1260: .Ic display-panes
1261: command appear.
1.21 nicm 1262: .It Ic display-time Ar time
1.78 nicm 1263: Set the amount of time for which status line messages and other on-screen
1264: indicators are displayed.
1.21 nicm 1265: .Ar time
1266: is in milliseconds.
1.1 nicm 1267: .It Ic history-limit Ar lines
1268: Set the maximum number of lines held in window history.
1269: This setting applies only to new windows - existing window histories are not
1270: resized and retain the limit at the point they were created.
1271: .It Ic lock-after-time Ar number
1.90 nicm 1272: Lock the server (like the
1273: .Ic lock-server
1274: command) after
1.1 nicm 1275: .Ar number
1276: seconds of inactivity.
1277: The default is off (set to 0).
1278: This has no effect as a session option; it must be set as a global option using
1279: .Fl g .
1.90 nicm 1280: .It Ic lock-command Ar command
1281: Command to run when locking each client.
1282: The default is to run
1283: .Xr lock 1
1284: with
1285: .Fl np .
1.1 nicm 1286: .It Ic message-attr Ar attributes
1287: Set status line message attributes, where
1288: .Ar attributes
1289: is either
1290: .Ic default
1291: or a comma-delimited list of one or more of:
1292: .Ic bright
1293: (or
1294: .Ic bold ) ,
1295: .Ic dim ,
1296: .Ic underscore ,
1297: .Ic blink ,
1298: .Ic reverse ,
1299: .Ic hidden ,
1300: or
1301: .Ic italics .
1302: .It Ic message-bg Ar colour
1303: Set status line message background colour, where
1304: .Ar colour
1305: is one of:
1306: .Ic black ,
1307: .Ic red ,
1308: .Ic green ,
1309: .Ic yellow ,
1310: .Ic blue ,
1311: .Ic magenta ,
1312: .Ic cyan ,
1.85 nicm 1313: .Ic white ,
1314: .Ic colour0
1315: to
1316: .Ic colour255
1317: from the 256-colour palette, or
1.1 nicm 1318: .Ic default .
1319: .It Ic message-fg Ar colour
1320: Set status line message foreground colour.
1.89 nicm 1321: .It Ic prefix Ar keys
1322: Set the keys accepted as a prefix key.
1323: .Ar keys
1324: is a comma-separated list of key names, each of which individually behave as
1325: the prefix key.
1.21 nicm 1326: .It Ic repeat-time Ar time
1.1 nicm 1327: Allow multiple commands to be entered without pressing the prefix-key again
1328: in the specified
1.21 nicm 1329: .Ar time
1.1 nicm 1330: milliseconds (the default is 500).
1331: Whether a key repeats may be set when it is bound using the
1332: .Fl r
1333: flag to
1334: .Ic bind-key .
1.52 nicm 1335: Repeat is enabled for the default keys bound to the
1336: .Ic resize-pane
1337: command.
1.1 nicm 1338: .It Xo Ic set-remain-on-exit
1.56 jmc 1339: .Op Ic on | off
1.1 nicm 1340: .Xc
1341: Set the
1342: .Ic remain-on-exit
1343: window option for any windows first created in this session.
1344: .It Xo Ic set-titles
1.56 jmc 1345: .Op Ic on | off
1.1 nicm 1346: .Xc
1.77 stsp 1347: Attempt to set the window title using the \ee]2;...\e007 xterm code if
1.1 nicm 1348: the terminal appears to be an xterm.
1.11 nicm 1349: This option is off by default.
1.6 jmc 1350: Note that elinks
1.1 nicm 1351: will only attempt to set the window title if the STY environment
1352: variable is set.
1.86 nicm 1353: .It Ic set-titles-string Ar string
1354: String used to set the window title if
1355: .Ic set-titles
1356: is on.
1357: Character sequences are replaced as for the
1358: .Ic status-left
1359: option.
1.1 nicm 1360: .It Xo Ic status
1.56 jmc 1361: .Op Ic on | off
1.1 nicm 1362: .Xc
1363: Show or hide the status line.
1364: .It Ic status-attr Ar attributes
1365: Set status line attributes.
1366: .It Ic status-bg Ar colour
1367: Set status line background colour.
1368: .It Ic status-fg Ar colour
1369: Set status line foreground colour.
1370: .It Ic status-interval Ar interval
1371: Update the status bar every
1372: .Ar interval
1373: seconds.
1374: By default, updates will occur every 15 seconds.
1375: A setting of zero disables redrawing at interval.
1.41 nicm 1376: .It Xo Ic status-justify
1.56 jmc 1377: .Op Ic left | centre | right
1.41 nicm 1378: .Xc
1379: Set the position of the window list component of the status line: left, centre
1380: or right justified.
1.1 nicm 1381: .It Xo Ic status-keys
1.56 jmc 1382: .Op Ic vi | emacs
1.1 nicm 1383: .Xc
1.6 jmc 1384: Use vi or emacs-style
1.1 nicm 1385: key bindings in the status line, for example at the command prompt.
1386: Defaults to emacs.
1387: .It Ic status-left Ar string
1388: Display
1389: .Ar string
1390: to the left of the status bar.
1391: .Ar string
1392: will be passed through
1393: .Xr strftime 3
1394: before being used.
1395: By default, the session name is shown.
1396: .Ar string
1.83 nicm 1397: may contain any of the following special character sequences:
1.1 nicm 1398: .Bl -column "Character pair" "Replaced with" -offset indent
1399: .It Sy "Character pair" Ta Sy "Replaced with"
1400: .It Li "#(command)" Ta "First line of command's output"
1.83 nicm 1401: .It Li "#[attributes]" Ta "Colour or attribute change"
1.1 nicm 1402: .It Li "#H" Ta "Hostname of local host"
1.35 nicm 1403: .It Li "#I" Ta "Current window index"
1404: .It Li "#P" Ta "Current pane index"
1.1 nicm 1405: .It Li "#S" Ta "Session name"
1406: .It Li "#T" Ta "Current window title"
1.35 nicm 1407: .It Li "#W" Ta "Current window name"
1.1 nicm 1408: .It Li "##" Ta "A literal" Ql #
1409: .El
1.83 nicm 1410: .Pp
1411: The #(command) form executes
1412: .Ql command
1413: as a shell command and inserts the first line of its output.
1414: #[attributes] allows a comma-separated list of attributes to be specified,
1415: these may be
1416: .Ql fg=colour
1417: to set the foreground colour,
1418: .Ql bg=colour
1419: to set the background colour, or one of the attributes described under the
1420: .Ic message-attr
1421: option.
1422: Examples are:
1423: .Bd -literal -offset indent
1424: #(sysctl vm.loadavg)
1425: #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
1426: .Ed
1.1 nicm 1427: .Pp
1428: Where appropriate, these may be prefixed with a number to specify the maximum
1429: length, for example
1430: .Ql #24T .
1.10 nicm 1431: .Pp
1.12 jmc 1432: By default, UTF-8 in
1.10 nicm 1433: .Ar string
1434: is not interpreted, to enable UTF-8, use the
1435: .Ic status-utf8
1436: option.
1.62 nicm 1437: .It Ic status-left-attr Ar attributes
1.66 jmc 1438: Set the attribute of the left part of the status line.
1.62 nicm 1439: .It Ic status-left-fg Ar colour
1440: Set the foreground colour of the left part of the status line.
1441: .It Ic status-left-bg Ar colour
1442: Set the background colour of the left part of the status line.
1.1 nicm 1443: .It Ic status-left-length Ar length
1444: Set the maximum
1445: .Ar length
1446: of the left component of the status bar.
1447: The default is 10.
1448: .It Ic status-right Ar string
1449: Display
1450: .Ar string
1451: to the right of the status bar.
1452: By default, the date and time will be shown.
1453: As with
1454: .Ic status-left ,
1455: .Ar string
1456: will be passed to
1.10 nicm 1457: .Xr strftime 3 ,
1458: character pairs are replaced, and UTF-8 is dependent on the
1459: .Ic status-utf8
1460: option.
1.62 nicm 1461: .It Ic status-right-attr Ar attributes
1.66 jmc 1462: Set the attribute of the right part of the status line.
1.62 nicm 1463: .It Ic status-right-fg Ar colour
1464: Set the foreground colour of the right part of the status line.
1465: .It Ic status-right-bg Ar colour
1466: Set the background colour of the right part of the status line.
1.1 nicm 1467: .It Ic status-right-length Ar length
1468: Set the maximum
1469: .Ar length
1470: of the right component of the status bar.
1471: The default is 40.
1.10 nicm 1472: .Pp
1473: .It Xo Ic status-utf8
1.56 jmc 1474: .Op Ic on | off
1.10 nicm 1475: .Xc
1476: Instruct
1477: .Nm
1478: to treat top-bit-set characters in the
1479: .Ic status-left
1480: and
1481: .Ic status-right
1482: strings as UTF-8; notably, this is important for wide characters.
1483: This option defaults to off.
1.55 jmc 1484: .It Ic terminal-overrides Ar string
1.54 nicm 1485: Contains a list of entries which override terminal descriptions read using
1486: .Xr terminfo 5 .
1487: .Ar string
1488: is a comma-separated list of items each a colon-separated string made up of a
1489: terminal type pattern (matched using
1490: .Xr fnmatch 3 )
1491: and a set of
1492: .Em name=value
1493: entries.
1494: .Pp
1495: For example, to set the
1496: .Ql clear
1497: .Xr terminfo 5
1498: entry to
1499: .Ql \ee[H\ee[2J
1500: for all terminal types and the
1501: .Ql dch1
1502: entry to
1503: .Ql \ee[P
1.55 jmc 1504: for the
1.54 nicm 1505: .Ql rxvt
1506: terminal type, the option could be set to the string:
1507: .Bd -literal -offset indent
1508: "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
1509: .Ed
1510: .Pp
1511: The terminal entry value is passed through
1512: .Xr strunvis 3
1513: before interpretation.
1514: The default value forcibly corrects the
1515: .Ql colors
1516: entry for terminals which support 88 or 256 colours:
1517: .Bd -literal -offset indent
1518: "*88col*:colors=88,*256col*:colors=256"
1519: .Ed
1.63 nicm 1520: .It Ic update-environment Ar variables
1521: Set a space-separated string containing a list of environment variables to be
1522: copied into the session environment when a new session is created or an
1523: existing session is attached.
1524: Any variables that do not exist in the source environment are set to be
1525: removed from the session environment (as if
1526: .Fl r
1527: was given to the
1528: .Ic set-environment
1529: command).
1530: The default is
1.75 nicm 1531: "DISPLAY WINDOWID SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION".
1.37 nicm 1532: .It Xo Ic visual-activity
1.56 jmc 1533: .Op Ic on | off
1.37 nicm 1534: .Xc
1535: If on, display a status line message when activity occurs in a window
1.39 jmc 1536: for which the
1.37 nicm 1537: .Ic monitor-activity
1538: window option is enabled.
1539: .It Xo Ic visual-bell
1.56 jmc 1540: .Op Ic on | off
1.37 nicm 1541: .Xc
1542: If this option is on, a message is shown on a bell instead of it being passed
1543: through to the terminal (which normally makes a sound).
1544: Also see the
1545: .Ic bell-action
1546: option.
1547: .It Xo Ic visual-content
1.56 jmc 1548: .Op Ic on | off
1.37 nicm 1549: .Xc
1550: Like
1551: .Ic visual-activity ,
1552: display a message when content is present in a window
1.39 jmc 1553: for which the
1.37 nicm 1554: .Ic monitor-content
1555: window option is enabled.
1.1 nicm 1556: .El
1557: .It Xo Ic set-window-option
1.58 nicm 1558: .Op Fl agu
1.1 nicm 1559: .Op Fl t Ar target-window
1560: .Ar option Ar value
1561: .Xc
1562: .D1 (alias: Ic setw )
1.18 nicm 1563: Set a window option.
1.1 nicm 1564: The
1.58 nicm 1565: .Fl a ,
1.1 nicm 1566: .Fl g
1567: and
1568: .Fl u
1569: flags work similarly to the
1570: .Ic set-option
1571: command.
1572: .Pp
1.18 nicm 1573: Supported window options are:
1.56 jmc 1574: .Pp
1575: .Bl -tag -width Ds -compact
1.1 nicm 1576: .It Xo Ic aggressive-resize
1.56 jmc 1577: .Op Ic on | off
1.1 nicm 1578: .Xc
1579: Aggressively resize the chosen window.
1580: This means that
1581: .Nm
1582: will resize the window to the size of the smallest session for which it is the
1583: current window, rather than the smallest session to which it is attached.
1584: The window may resize when the current window is changed on another sessions;
1.6 jmc 1585: this option is good for full-screen programs which support
1586: .Dv SIGWINCH
1587: and poor for interactive programs such as shells.
1.56 jmc 1588: .Pp
1.1 nicm 1589: .It Xo Ic automatic-rename
1.56 jmc 1590: .Op Ic on | off
1.1 nicm 1591: .Xc
1592: Control automatic window renaming.
1593: When this setting is enabled,
1594: .Nm
1595: will attempt - on supported platforms - to rename the window to reflect the
1596: command currently running in it.
1597: This flag is automatically disabled for an individual window when a name
1598: is specified at creation with
1599: .Ic new-window or
1600: .Ic new-session ,
1601: or later with
1602: .Ic rename-window .
1603: It may be switched off globally with:
1604: .Bd -literal -offset indent
1605: set-window-option -g automatic-rename off
1606: .Ed
1.56 jmc 1607: .Pp
1.1 nicm 1608: .It Ic clock-mode-colour Ar colour
1609: Set clock colour.
1.56 jmc 1610: .Pp
1.1 nicm 1611: .It Xo Ic clock-mode-style
1.56 jmc 1612: .Op Ic 12 | 24
1.1 nicm 1613: .Xc
1614: Set clock hour format.
1.56 jmc 1615: .Pp
1.1 nicm 1616: .It Ic force-height Ar height
1617: .It Ic force-width Ar width
1618: Prevent
1619: .Nm
1620: from resizing a window to greater than
1621: .Ar width
1622: or
1623: .Ar height .
1624: A value of zero restores the default unlimited setting.
1.56 jmc 1625: .Pp
1.2 nicm 1626: .It Ic main-pane-width Ar width
1627: .It Ic main-pane-height Ar height
1628: Set the width or height of the main (left or top) pane in the
1629: .Ic main-horizontal
1630: or
1631: .Ic main-vertical
1632: layouts.
1.56 jmc 1633: .Pp
1.1 nicm 1634: .It Ic mode-attr Ar attributes
1635: Set window modes attributes.
1.56 jmc 1636: .Pp
1.1 nicm 1637: .It Ic mode-bg Ar colour
1638: Set window modes background colour.
1.56 jmc 1639: .Pp
1.1 nicm 1640: .It Ic mode-fg Ar colour
1641: Set window modes foreground colour.
1.56 jmc 1642: .Pp
1.1 nicm 1643: .It Xo Ic mode-keys
1.56 jmc 1644: .Op Ic vi | emacs
1.1 nicm 1645: .Xc
1.50 nicm 1646: Use vi or emacs-style key bindings in scroll, copy and choice modes.
1.1 nicm 1647: Key bindings default to emacs.
1.56 jmc 1648: .Pp
1.50 nicm 1649: .It Xo Ic mode-mouse
1.56 jmc 1650: .Op Ic on | off
1.50 nicm 1651: .Xc
1.51 jmc 1652: Mouse state in modes.
1653: If on,
1.50 nicm 1654: .Nm
1655: will respond to mouse clicks by moving the cursor in copy mode or selecting an
1656: option in choice mode.
1.56 jmc 1657: .Pp
1.1 nicm 1658: .It Xo Ic monitor-activity
1.56 jmc 1659: .Op Ic on | off
1.1 nicm 1660: .Xc
1661: Monitor for activity in the window.
1662: Windows with activity are highlighted in the status line.
1.56 jmc 1663: .Pp
1664: .It Ic monitor-content Ar match-string
1.6 jmc 1665: Monitor content in the window.
1666: When
1.16 nicm 1667: .Xr fnmatch 3
1668: pattern
1.1 nicm 1669: .Ar match-string
1670: appears in the window, it is highlighted in the status line.
1.56 jmc 1671: .Pp
1.1 nicm 1672: .It Xo Ic remain-on-exit
1.56 jmc 1673: .Op Ic on | off
1.1 nicm 1674: .Xc
1675: A window with this flag set is not destroyed when the program running in it
1676: exits.
1677: The window may be reactivated with the
1678: .Ic respawn-window
1679: command.
1.56 jmc 1680: .Pp
1.1 nicm 1681: .It Xo Ic utf8
1.56 jmc 1682: .Op Ic on | off
1.1 nicm 1683: .Xc
1684: Instructs
1685: .Nm
1686: to expect UTF-8 sequences to appear in this window.
1.56 jmc 1687: .Pp
1.1 nicm 1688: .It Ic window-status-attr Ar attributes
1689: Set status line attributes for a single window.
1.56 jmc 1690: .Pp
1.1 nicm 1691: .It Ic window-status-bg Ar colour
1692: Set status line background colour for a single window.
1.56 jmc 1693: .Pp
1.1 nicm 1694: .It Ic window-status-fg Ar colour
1695: Set status line foreground colour for a single window.
1.56 jmc 1696: .Pp
1.40 nicm 1697: .It Ic window-status-current-attr Ar attributes
1698: Set status line attributes for the currently active window.
1.56 jmc 1699: .Pp
1.40 nicm 1700: .It Ic window-status-current-bg Ar colour
1701: Set status line background colour for the currently active window.
1.56 jmc 1702: .Pp
1.40 nicm 1703: .It Ic window-status-current-fg Ar colour
1704: Set status line foreground colour for the currently active window.
1.56 jmc 1705: .Pp
1.1 nicm 1706: .It Xo Ic xterm-keys
1.56 jmc 1707: .Op Ic on | off
1.1 nicm 1708: .Xc
1709: If this option is set,
1710: .Nm
1711: will generate
1.57 jmc 1712: .Xr xterm 1 -style
1713: function key sequences; these have a number included to indicate modifiers such
1714: as Shift, Alt or Ctrl.
1715: .El
1716: .It Xo Ic show-options
1717: .Op Fl g
1718: .Op Fl t Ar target-session
1719: .Xc
1720: .D1 (alias: Ic show )
1721: Show the session options for
1722: .Ar target session ,
1723: or the global session options with
1724: .Fl g .
1725: .It Xo Ic show-window-options
1726: .Op Fl g
1727: .Op Fl t Ar target-window
1728: .Xc
1729: .D1 (alias: Ic showw )
1730: List the window options for
1731: .Ar target-window ,
1732: or the global window options if
1733: .Fl g
1734: is used.
1.63 nicm 1735: .El
1736: .Sh ENVIRONMENT
1737: When the server is started,
1738: .Nm
1739: copies the environment into the
1740: .Em global environment ;
1741: in addition, each session has a
1742: .Em session environment .
1743: When a window is created, the session and global environments are merged with
1744: the session environment overriding any variable present in both.
1745: This is the initial environment passed to the new process.
1746: .Pp
1747: The
1748: .Ic update-environment
1749: session option may be used to update the session environment from the client
1750: when a new session is created or an old reattached.
1751: .Nm
1752: also initialises the
1753: .Ev TMUX
1754: variable with some internal information to allow commands to be executed
1755: from inside, and the
1756: .Ev TERM
1757: variable with the correct terminal setting of
1758: .Ql screen .
1759: .Pp
1760: Commands to alter and view the environment are:
1761: .Bl -tag -width Ds
1762: .It Xo Ic set-environment
1763: .Op Fl gru
1764: .Op Fl t Ar target-session
1765: .Ar name Op Ar value
1766: .Xc
1767: Set or unset an environment variable.
1768: If
1769: .Fl g
1770: is used, the change is made in the global environment; otherwise, it is applied
1771: to the session environment for
1772: .Ar target-session .
1773: The
1774: .Fl u
1775: flag unsets a variable.
1776: .Fl r
1777: indicates the variable is to be removed from the environment before starting a
1778: new process.
1779: .It Xo Ic show-environment
1780: .Op Fl g
1781: .Op Fl t Ar target-session
1782: .Xc
1783: Display the environment for
1784: .Ar target-session
1785: or the global environment with
1786: .Fl g .
1787: Variables removed from the environment are prefixed with
1788: .Ql - .
1.57 jmc 1789: .El
1790: .Sh STATUS LINE
1791: .Nm
1792: includes an optional status line which is displayed in the bottom line of each
1793: terminal.
1794: By default, the status line is enabled (it may be disabled with the
1795: .Ic status
1796: session option) and contains, from left-to-right: the name of the current
1797: session in square brackets; the window list; the current window title in double
1798: quotes; and the time and date.
1799: .Pp
1800: The status line is made of three parts: configurable left and right sections
1801: (which may contain dynamic content such as the time or output from a shell
1802: command, see the
1803: .Ic status-left ,
1804: .Ic status-left-length ,
1805: .Ic status-right ,
1806: and
1807: .Ic status-right-length
1808: options below), and a central window list.
1809: The window list shows the index, name and (if any) flag of the windows
1810: present in the current session in ascending numerical order.
1811: The flag is one of the following symbols appended to the window name:
1812: .Bl -column "Symbol" "Meaning" -offset indent
1813: .It Sy "Symbol" Ta Sy "Meaning"
1814: .It Li "*" Ta "Denotes the current window."
1815: .It Li "-" Ta "Marks the last window (previously selected)."
1816: .It Li "#" Ta "Window is monitored and activity has been detected."
1817: .It Li "!" Ta "A bell has occurred in the window."
1818: .It Li "+" Ta "Window is monitored for content and it has appeared."
1819: .El
1820: .Pp
1821: The # symbol relates to the
1822: .Ic monitor-activity
1823: and + to the
1824: .Ic monitor-content
1825: window options.
1826: The window name is printed in inverted colours if an alert (bell, activity or
1827: content) is present.
1828: .Pp
1829: The colour and attributes of the status line may be configured, the entire status line using
1830: the
1831: .Ic status-attr ,
1832: .Ic status-fg
1833: and
1834: .Ic status-bg
1835: session options and individual windows using the
1836: .Ic window-status-attr ,
1837: .Ic window-status-fg
1838: and
1839: .Ic window-status-bg
1840: window options.
1841: .Pp
1842: The status line is automatically refreshed at interval if it has changed, the interval may be
1843: controlled with the
1844: .Ic status-interval
1845: session option.
1846: .Pp
1847: Commands related to the status line are as follows:
1848: .Bl -tag -width Ds
1849: .It Xo Ic command-prompt
1.73 nicm 1850: .Op Fl p Ar prompts
1.57 jmc 1851: .Op Fl t Ar target-client
1852: .Op Ar template
1853: .Xc
1854: Open the command prompt in a client.
1855: This may be used from inside
1856: .Nm
1857: to execute commands interactively.
1858: If
1859: .Ar template
1.73 nicm 1860: is specified, it is used as the command.
1861: If
1862: .Fl p
1863: is given,
1864: .Ar prompts
1865: is a comma-separated list of prompts which are displayed in order; otherwise
1866: a single prompt is displayed, constructed from
1867: .Ar template
1868: if it is present, or
1869: .Ql \&:
1870: if not.
1871: Before the command is executed, the first occurrence of the string
1872: .Ql %%
1.74 jmc 1873: and all occurrences of
1.73 nicm 1874: .Ql %1
1875: are replaced by the response to the first prompt, the second
1876: .Ql %%
1877: and all
1878: .Ql %2
1879: are replaced with the response to the second prompt, and so on for further
1.74 jmc 1880: prompts.
1881: Up to nine prompt responses may be replaced
1882: .Po
1883: .Ql %1
1.73 nicm 1884: to
1.74 jmc 1885: .Ql %9
1886: .Pc .
1.57 jmc 1887: .It Xo Ic confirm-before
1888: .Op Fl t Ar target-client
1889: .Ar command
1890: .Xc
1891: .D1 (alias: Ic confirm )
1892: Ask for confirmation before executing
1893: .Ar command .
1894: This command works only from inside
1895: .Nm .
1896: .It Xo Ic display-message
1897: .Op Fl t Ar target-client
1898: .Op Ar message
1899: .Xc
1900: .D1 (alias: Ic display )
1901: Display a message (see the
1902: .Ic status-left
1903: option below)
1904: in the status line.
1905: .It Ic select-prompt Op Fl t Ar target-client
1906: Open a prompt inside
1907: .Ar target-client
1908: allowing a window index to be entered interactively.
1909: .El
1910: .Sh BUFFERS
1911: .Nm
1912: maintains a stack of
1913: .Em paste buffers
1914: for each session.
1915: Up to the value of the
1916: .Ic buffer-limit
1917: option are kept; when a new buffer is added, the buffer at the bottom of the
1918: stack is removed.
1919: Buffers may be added using
1920: .Ic copy-mode
1921: or the
1922: .Ic set-buffer
1923: command, and pasted into a window using the
1924: .Ic paste-buffer
1925: command.
1926: .Pp
1927: A configurable history buffer is also maintained for each window.
1928: By default, up to 2000 lines are kept; this can be altered with the
1929: .Ic history-limit
1930: option (see the
1931: .Ic set-option
1932: command above).
1933: .Pp
1934: The buffer commands are as follows:
1935: .Bl -tag -width Ds
1936: .It Ic clear-history Op Fl t Ar target-pane
1937: .D1 (alias: Ic clearhist )
1938: Remove and free the history for the specified pane.
1939: .It Xo Ic copy-buffer
1940: .Op Fl a Ar src-index
1941: .Op Fl b Ar dst-index
1942: .Op Fl s Ar src-session
1943: .Op Fl t Ar dst-session
1944: .Xc
1945: .D1 (alias: Ic copyb )
1946: Copy a session paste buffer to another session.
1947: If no sessions are specified, the current one is used instead.
1948: .It Xo Ic delete-buffer
1949: .Op Fl b Ar buffer-index
1950: .Op Fl t Ar target-session
1951: .Xc
1952: .D1 (alias: Ic deleteb )
1953: Delete the buffer at
1954: .Ar buffer-index ,
1955: or the top buffer if not specified.
1956: .It Ic list-buffers Op Fl t Ar target-session
1957: .D1 (alias: Ic lsb )
1958: List the buffers in the given session.
1959: .It Xo Ic load-buffer
1960: .Op Fl b Ar buffer-index
1961: .Op Fl t Ar target-session
1962: .Ar path
1963: .Xc
1964: .D1 (alias: Ic loadb )
1965: Load the contents of the specified paste buffer from
1966: .Ar path .
1967: .It Xo Ic paste-buffer
1968: .Op Fl dr
1969: .Op Fl b Ar buffer-index
1970: .Op Fl t Ar target-window
1971: .Xc
1972: .D1 (alias: Ic pasteb )
1973: Insert the contents of a paste buffer into the current window.
1974: With
1975: .Fl d ,
1976: also delete the paste buffer from the stack.
1977: When output, any linefeed (LF) characters in the paste buffer are replaced with
1978: carriage returns (CR).
1979: This translation may be disabled with the
1980: .Fl r
1981: flag.
1982: .It Xo Ic save-buffer
1983: .Op Fl a
1984: .Op Fl b Ar buffer-index
1985: .Op Fl t Ar target-session
1986: .Ar path
1987: .Xc
1988: .D1 (alias: Ic saveb )
1989: Save the contents of the specified paste buffer to
1990: .Ar path .
1991: The
1992: .Fl a
1993: option appends to rather than overwriting the file.
1994: .It Xo Ic set-buffer
1995: .Op Fl b Ar buffer-index
1996: .Op Fl t Ar target-session
1997: .Ar data
1998: .Xc
1999: .D1 (alias: Ic setb )
2000: Set the contents of the specified buffer to
2001: .Ar data .
1.1 nicm 2002: .It Xo Ic show-buffer
2003: .Op Fl b Ar buffer-index
2004: .Op Fl t Ar target-session
2005: .Xc
2006: .D1 (alias: Ic showb )
2007: Display the contents of the specified buffer.
1.57 jmc 2008: .El
2009: .Sh MISCELLANEOUS
2010: .Pp
2011: Miscellaneous commands are as follows:
2012: .Bl -tag -width Ds
1.72 nicm 2013: .It Ic clock-mode Op Fl t Ar target-pane
1.57 jmc 2014: Display a large clock.
2015: .It Ic if-shell Ar shell-command command
2016: .D1 (alias: Ic if )
2017: Execute
2018: .Ar command
2019: if
2020: .Ar shell-command
2021: returns success.
2022: .It Ic lock-server
2023: .D1 (alias: Ic lock )
1.90 nicm 2024: Lock each client individually by running the command specified by the
2025: .Ic lock-command
2026: option.
1.87 nicm 2027: .It Ic run-shell Ar command
2028: .D1 (alias: Ic run )
2029: Execute
2030: .Ar command
2031: without creating a window.
2032: Any output to stdout is displayed in output mode.
2033: If
1.88 jmc 2034: .Ar command
1.87 nicm 2035: doesn't return success, the exit status is also displayed.
1.57 jmc 2036: .It Ic server-info
2037: .D1 (alias: Ic info )
2038: Show server information and terminal details.
1.1 nicm 2039: .El
2040: .Sh FILES
1.26 nicm 2041: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1 nicm 2042: .It Pa ~/.tmux.conf
1.6 jmc 2043: Default
1.1 nicm 2044: .Nm
1.6 jmc 2045: configuration file.
1.26 nicm 2046: .It Pa /etc/tmux.conf
2047: System-wide configuration file.
1.1 nicm 2048: .El
1.57 jmc 2049: .Sh EXAMPLES
2050: To create a new
2051: .Nm
2052: session running
2053: .Xr vi 1 :
2054: .Pp
2055: .Dl $ tmux new-session vi
2056: .Pp
2057: Most commands have a shorter form, known as an alias.
2058: For new-session, this is
2059: .Ic new :
2060: .Pp
2061: .Dl $ tmux new vi
2062: .Pp
2063: Alternatively, the shortest unambiguous form of a command is accepted.
2064: If there are several options, they are listed:
2065: .Bd -literal -offset indent
2066: $ tmux n
2067: ambiguous command: n, could be: new-session, new-window, next-window
2068: .Ed
2069: .Pp
2070: Within an active session, a new window may be created by typing
2071: .Ql C-b c
2072: (Ctrl
2073: followed by the
2074: .Ql b
2075: key
2076: followed by the
2077: .Ql c
2078: key).
2079: .Pp
2080: Windows may be navigated with:
2081: .Ql C-b 0
2082: (to select window 0),
2083: .Ql C-b 1
2084: (to select window 1), and so on;
2085: .Ql C-b n
2086: to select the next window; and
2087: .Ql C-b p
2088: to select the previous window.
2089: .Pp
2090: A session may be detached using
2091: .Ql C-b d
1.64 nicm 2092: (or by an external event such as
2093: .Xr ssh 1
2094: disconnection) and reattached with:
1.57 jmc 2095: .Pp
2096: .Dl $ tmux attach-session
2097: .Pp
2098: Typing
2099: .Ql C-b \&?
2100: lists the current key bindings in the current window; up and down may be used
2101: to navigate the list or
2102: .Ql q
2103: to exit from it.
2104: .Pp
2105: Commands to be run when the
2106: .Nm
2107: server is started may be placed in the
2108: .Pa ~/.tmux.conf
2109: configuration file.
2110: Common examples include:
2111: .Pp
2112: Changing the default prefix key:
2113: .Bd -literal -offset indent
2114: set-option -g prefix C-a
2115: unbind-key C-b
2116: bind-key C-a send-prefix
2117: .Ed
2118: .Pp
2119: Turning the status line off, or changing its colour:
2120: .Bd -literal -offset indent
2121: set-option -g status off
2122: set-option -g status-bg blue
2123: .Ed
2124: .Pp
2125: Setting other options, such as the default command,
2126: or locking after 30 minutes of inactivity:
2127: .Bd -literal -offset indent
2128: set-option -g default-command "exec /bin/ksh"
2129: set-option -g lock-after-time 1800
2130: .Ed
2131: .Pp
2132: Creating new key bindings:
2133: .Bd -literal -offset indent
2134: bind-key b set-option status
2135: bind-key / command-prompt "split-window 'exec man %%'"
1.73 nicm 2136: bind-key S command-prompt "new-window -n %1 'ssh %1'"
1.57 jmc 2137: .Ed
1.1 nicm 2138: .Sh SEE ALSO
2139: .Xr pty 4
2140: .Sh AUTHORS
2141: .An Nicholas Marriott Aq nicm@users.sourceforge.net