Annotation of src/usr.bin/tmux/tmux.1, Revision 1.396
1.396 ! nicm 1: .\" $OpenBSD: tmux.1,v 1.395 2014/05/14 06:45:35 nicm 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.396 ! nicm 17: .Dd $Mdocdate: May 14 2014 $
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.390 nicm 26: .Op Fl 2lCuv
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.
1.345 nicm 101: .It Fl C
1.369 nicm 102: Start in control mode (see the
103: .Sx CONTROL MODE
104: section).
1.345 nicm 105: Given twice
106: .Xo ( Fl CC ) Xc
107: disables echo.
1.91 nicm 108: .It Fl c Ar shell-command
109: Execute
110: .Ar shell-command
111: using the default shell.
112: If necessary, the
113: .Nm
114: server will be started to retrieve the
115: .Ic default-shell
116: option.
1.153 nicm 117: This option is for compatibility with
118: .Xr sh 1
119: when
120: .Nm
121: is used as a login shell.
1.1 nicm 122: .It Fl f Ar file
123: Specify an alternative configuration file.
124: By default,
125: .Nm
1.26 nicm 126: loads the system configuration file from
127: .Pa /etc/tmux.conf ,
128: if present, then looks for a user configuration file at
1.1 nicm 129: .Pa ~/.tmux.conf .
1.306 nicm 130: .Pp
1.1 nicm 131: The configuration file is a set of
132: .Nm
133: commands which are executed in sequence when the server is first started.
1.306 nicm 134: .Nm
135: loads configuration files once when the server process has started.
136: The
137: .Ic source-file
138: command may be used to load a file later.
1.61 nicm 139: .Pp
140: .Nm
1.306 nicm 141: shows any error messages from commands in configuration files in the first
142: session created, and continues to process the rest of the configuration file.
1.1 nicm 143: .It Fl L Ar socket-name
144: .Nm
145: stores the server socket in a directory under
1.355 nicm 146: .Ev TMUX_TMPDIR ,
147: .Ev TMPDIR
148: if it is unset, or
1.208 nicm 149: .Pa /tmp
1.355 nicm 150: if both are unset.
151: The default socket is named
1.1 nicm 152: .Em default .
153: This option allows a different socket name to be specified, allowing several
154: independent
155: .Nm
156: servers to be run.
157: Unlike
158: .Fl S
159: a full path is not necessary: the sockets are all created in the same
160: directory.
1.2 nicm 161: .Pp
162: If the socket is accidentally removed, the
1.6 jmc 163: .Dv SIGUSR1
1.2 nicm 164: signal may be sent to the
165: .Nm
166: server process to recreate it.
1.166 sobrado 167: .It Fl l
168: Behave as a login shell.
169: This flag currently has no effect and is for compatibility with other shells
170: when using tmux as a login shell.
1.1 nicm 171: .It Fl S Ar socket-path
172: Specify a full alternative path to the server socket.
173: If
174: .Fl S
175: is specified, the default socket directory is not used and any
176: .Fl L
177: flag is ignored.
178: .It Fl u
179: .Nm
1.14 nicm 180: attempts to guess if the terminal is likely to support UTF-8 by checking the
181: first of the
182: .Ev LC_ALL ,
183: .Ev LC_CTYPE
184: and
1.2 nicm 185: .Ev LANG
1.14 nicm 186: environment variables to be set for the string "UTF-8".
1.5 nicm 187: This is not always correct: the
1.2 nicm 188: .Fl u
189: flag explicitly informs
190: .Nm
1.6 jmc 191: that UTF-8 is supported.
1.33 nicm 192: .Pp
193: If the server is started from a client passed
194: .Fl u
195: or where UTF-8 is detected, the
196: .Ic utf8
197: and
198: .Ic status-utf8
199: options are enabled in the global window and session options respectively.
1.1 nicm 200: .It Fl v
201: Request verbose logging.
202: This option may be specified multiple times for increasing verbosity.
203: Log messages will be saved into
204: .Pa tmux-client-PID.log
205: and
206: .Pa tmux-server-PID.log
207: files in the current directory, where
208: .Em PID
1.6 jmc 209: is the PID of the server or client process.
1.1 nicm 210: .It Ar command Op Ar flags
211: This specifies one of a set of commands used to control
212: .Nm ,
1.6 jmc 213: as described in the following sections.
1.59 jmc 214: If no commands are specified, the
1.1 nicm 215: .Ic new-session
216: command is assumed.
1.57 jmc 217: .El
1.64 nicm 218: .Sh KEY BINDINGS
219: .Nm
220: may be controlled from an attached client by using a key combination of a
221: prefix key,
222: .Ql C-b
223: (Ctrl-b) by default, followed by a command key.
224: .Pp
1.172 nicm 225: The default command key bindings are:
1.64 nicm 226: .Pp
1.171 nicm 227: .Bl -tag -width "XXXXXXXXXX" -offset indent -compact
228: .It C-b
229: Send the prefix key (C-b) through to the application.
230: .It C-o
231: Rotate the panes in the current window forwards.
232: .It C-z
233: Suspend the
234: .Nm
235: client.
236: .It !
237: Break the current pane out of the window.
238: .It \&"
239: Split the current pane into two, top and bottom.
240: .It #
241: List all paste buffers.
1.236 nicm 242: .It $
243: Rename the current session.
1.171 nicm 244: .It %
245: Split the current pane into two, left and right.
246: .It &
247: Kill the current window.
248: .It '
249: Prompt for a window index to select.
250: .It ,
251: Rename the current window.
252: .It -
253: Delete the most recently copied buffer of text.
254: .It .
255: Prompt for an index to move the current window.
256: .It 0 to 9
257: Select windows 0 to 9.
258: .It :
259: Enter the
260: .Nm
261: command prompt.
1.187 nicm 262: .It ;
263: Move to the previously active pane.
1.178 nicm 264: .It =
265: Choose which buffer to paste interactively from a list.
1.171 nicm 266: .It \&?
267: List all key bindings.
268: .It D
269: Choose a client to detach.
1.182 jmc 270: .It \&[
1.171 nicm 271: Enter copy mode to copy text or view the history.
1.182 jmc 272: .It \&]
1.171 nicm 273: Paste the most recently copied buffer of text.
1.64 nicm 274: .It c
1.65 nicm 275: Create a new window.
1.64 nicm 276: .It d
1.65 nicm 277: Detach the current client.
1.171 nicm 278: .It f
279: Prompt to search for text in open windows.
280: .It i
281: Display some information about the current window.
1.64 nicm 282: .It l
1.65 nicm 283: Move to the previously selected window.
1.64 nicm 284: .It n
1.65 nicm 285: Change to the next window.
1.171 nicm 286: .It o
287: Select the next pane in the current window.
1.64 nicm 288: .It p
1.65 nicm 289: Change to the previous window.
1.171 nicm 290: .It q
291: Briefly display pane indexes.
292: .It r
293: Force redraw of the attached client.
294: .It s
295: Select a new session for the attached client interactively.
1.194 nicm 296: .It L
297: Switch the attached client back to the last session.
1.171 nicm 298: .It t
299: Show the time.
300: .It w
301: Choose the current window interactively.
302: .It x
303: Kill the current pane.
304: .It {
305: Swap the current pane with the previous pane.
306: .It }
307: Swap the current pane with the next pane.
308: .It ~
309: Show previous messages from
310: .Nm ,
311: if any.
312: .It Page Up
313: Enter copy mode and scroll one page up.
314: .It Up, Down
315: .It Left, Right
316: Change to the pane above, below, to the left, or to the right of the current
317: pane.
318: .It M-1 to M-5
319: Arrange panes in one of the five preset layouts: even-horizontal,
320: even-vertical, main-horizontal, main-vertical, or tiled.
321: .It M-n
322: Move to the next window with a bell or activity marker.
323: .It M-o
324: Rotate the panes in the current window backwards.
325: .It M-p
326: Move to the previous window with a bell or activity marker.
327: .It C-Up, C-Down
328: .It C-Left, C-Right
329: Resize the current pane in steps of one cell.
330: .It M-Up, M-Down
331: .It M-Left, M-Right
332: Resize the current pane in steps of five cells.
1.64 nicm 333: .El
334: .Pp
335: Key bindings may be changed with the
336: .Ic bind-key
337: and
338: .Ic unbind-key
339: commands.
1.57 jmc 340: .Sh COMMANDS
341: This section contains a list of the commands supported by
342: .Nm .
343: Most commands accept the optional
344: .Fl t
345: argument with one of
346: .Ar target-client ,
347: .Ar target-session
348: .Ar target-window ,
349: or
350: .Ar target-pane .
351: These specify the client, session, window or pane which a command should affect.
352: .Ar target-client
353: is the name of the
354: .Xr pty 4
355: file to which the client is connected, for example either of
356: .Pa /dev/ttyp1
357: or
358: .Pa ttyp1
359: for the client attached to
360: .Pa /dev/ttyp1 .
361: If no client is specified, the current client is chosen, if possible, or an
362: error is reported.
363: Clients may be listed with the
364: .Ic list-clients
365: command.
1.1 nicm 366: .Pp
1.57 jmc 367: .Ar target-session
1.344 nicm 368: is the session id prefixed with a $, the name of a session (as listed by the
1.57 jmc 369: .Ic list-sessions
1.344 nicm 370: command), or the name of a client with the same syntax as
1.57 jmc 371: .Ar target-client ,
372: in which case the session attached to the client is used.
373: When looking for the session name,
374: .Nm
375: initially searches for an exact match; if none is found, the session names
376: are checked for any for which
377: .Ar target-session
378: is a prefix or for which it matches as an
379: .Xr fnmatch 3
380: pattern.
381: If a single match is found, it is used as the target session; multiple matches
382: produce an error.
383: If a session is omitted, the current session is used if available; if no
1.117 nicm 384: current session is available, the most recently used is chosen.
1.1 nicm 385: .Pp
1.57 jmc 386: .Ar target-window
387: specifies a window in the form
388: .Em session Ns \&: Ns Em window .
389: .Em session
390: follows the same rules as for
391: .Ar target-session ,
392: and
393: .Em window
1.270 nicm 394: is looked for in order: as a window index, for example mysession:1;
1.271 jmc 395: as a window ID, such as @1;
1.270 nicm 396: as an exact window name, such as mysession:mywindow; then as an
1.57 jmc 397: .Xr fnmatch 3
398: pattern or the start of a window name, such as mysession:mywin* or
399: mysession:mywin.
400: An empty window name specifies the next unused index if appropriate (for
401: example the
402: .Ic new-window
403: and
404: .Ic link-window
405: commands)
406: otherwise the current window in
407: .Em session
408: is chosen.
1.140 nicm 409: The special character
410: .Ql \&!
1.311 nicm 411: uses the last (previously current) window,
412: .Ql ^
413: selects the highest numbered window,
414: .Ql $
415: selects the lowest numbered window, and
1.140 nicm 416: .Ql +
417: and
418: .Ql -
1.311 nicm 419: select the next window or the previous window by number.
1.57 jmc 420: When the argument does not contain a colon,
421: .Nm
422: first attempts to parse it as window; if that fails, an attempt is made to
423: match a session.
1.1 nicm 424: .Pp
1.57 jmc 425: .Ar target-pane
426: takes a similar form to
427: .Ar target-window
428: but with the optional addition of a period followed by a pane index, for
429: example: mysession:mywindow.1.
430: If the pane index is omitted, the currently active pane in the specified
431: window is used.
432: If neither a colon nor period appears,
1.13 nicm 433: .Nm
1.57 jmc 434: first attempts to use the argument as a pane index; if that fails, it is looked
435: up as for
436: .Ar target-window .
1.156 nicm 437: A
438: .Ql +
439: or
440: .Ql -
441: indicate the next or previous pane index, respectively.
1.132 nicm 442: One of the strings
443: .Em top ,
444: .Em bottom ,
445: .Em left ,
446: .Em right ,
447: .Em top-left ,
448: .Em top-right ,
1.216 nicm 449: .Em bottom-left
450: or
1.132 nicm 451: .Em bottom-right
452: may be used instead of a pane index.
1.177 nicm 453: .Pp
454: The special characters
455: .Ql +
456: and
457: .Ql -
458: may be followed by an offset, for example:
459: .Bd -literal -offset indent
460: select-window -t:+2
461: .Ed
462: .Pp
463: When dealing with a session that doesn't contain sequential window indexes,
464: they will be correctly skipped.
1.212 nicm 465: .Pp
466: .Nm
467: also gives each pane created in a server an identifier consisting of a
468: .Ql %
469: and a number, starting from zero.
470: A pane's identifier is unique for the life of the
471: .Nm
472: server and is passed to the child process of the pane in the
473: .Ev TMUX_PANE
474: environment variable.
475: It may be used alone to target a pane or the window containing it.
1.15 jmc 476: .Pp
1.153 nicm 477: .Ar shell-command
478: arguments are
479: .Xr sh 1
480: commands.
1.394 nicm 481: This may be a single argument passed to the shell, for example:
1.153 nicm 482: .Bd -literal -offset indent
483: new-window 'vi /etc/passwd'
484: .Ed
1.394 nicm 485: .Pp
486: Will run:
487: .Bd -literal -offset indent
488: /bin/sh -c 'vi /etc/passwd'
489: .Ed
490: .Pp
491: Additionally, the
492: .Ic new-window ,
493: .Ic new-session ,
494: .Ic split-window ,
495: .Ic respawn-window
496: and
497: .Ic respawn-pane
498: commands allow
499: .Ar shell-command
500: to be given as multiple arguments and executed directly (without
501: .Ql sh -c ) .
502: This can avoid issues with shell quoting.
503: For example:
504: .Bd -literal -offset indent
505: $ tmux new-window vi /etc/passwd
506: .Ed
507: .Pp
508: Will run
509: .Xr vi 1
510: directly without invoking the shell.
1.153 nicm 511: .Pp
512: .Ar command
513: .Op Ar arguments
514: refers to a
515: .Nm
516: command, passed with the command and arguments separately, for example:
517: .Bd -literal -offset indent
518: bind-key F1 set-window-option force-width 81
519: .Ed
520: .Pp
521: Or if using
522: .Xr sh 1 :
523: .Bd -literal -offset indent
524: $ tmux bind-key F1 set-window-option force-width 81
525: .Ed
526: .Pp
1.57 jmc 527: Multiple commands may be specified together as part of a
528: .Em command sequence .
529: Each command should be separated by spaces and a semicolon;
1.244 nicm 530: commands are executed sequentially from left to right and
1.293 nicm 531: lines ending with a backslash continue on to the next line,
532: except when escaped by another backslash.
1.57 jmc 533: A literal semicolon may be included by escaping it with a backslash (for
534: example, when specifying a command sequence to
535: .Ic bind-key ) .
1.13 nicm 536: .Pp
1.153 nicm 537: Example
538: .Nm
539: commands include:
1.13 nicm 540: .Bd -literal -offset indent
1.57 jmc 541: refresh-client -t/dev/ttyp2
542:
543: rename-session -tfirst newname
544:
545: set-window-option -t:0 monitor-activity on
546:
547: new-window ; split-window -d
1.244 nicm 548:
549: bind-key R source-file ~/.tmux.conf \e; \e
550: display-message "source-file done"
1.13 nicm 551: .Ed
1.153 nicm 552: .Pp
553: Or from
554: .Xr sh 1 :
555: .Bd -literal -offset indent
556: $ tmux kill-window -t :1
557:
1.159 jmc 558: $ tmux new-window \e; split-window -d
1.153 nicm 559:
1.159 jmc 560: $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
1.153 nicm 561: .Ed
1.57 jmc 562: .Sh CLIENTS AND SESSIONS
1.153 nicm 563: The
564: .Nm
565: server manages clients, sessions, windows and panes.
566: Clients are attached to sessions to interact with them, either
567: when they are created with the
568: .Ic new-session
569: command, or later with the
570: .Ic attach-session
571: command.
1.188 nicm 572: Each session has one or more windows
1.153 nicm 573: .Em linked
574: into it.
575: Windows may be linked to multiple sessions and are made up of one or
576: more panes,
577: each of which contains a pseudo terminal.
578: Commands for creating, linking and otherwise manipulating windows
579: are covered
580: in the
581: .Sx WINDOWS AND PANES
582: section.
583: .Pp
584: The following commands are available to manage clients and sessions:
1.57 jmc 585: .Bl -tag -width Ds
586: .It Xo Ic attach-session
1.148 nicm 587: .Op Fl dr
1.372 nicm 588: .Op Fl c Ar working-directory
1.57 jmc 589: .Op Fl t Ar target-session
590: .Xc
591: .D1 (alias: Ic attach )
592: If run from outside
593: .Nm ,
594: create a new client in the current terminal and attach it to
595: .Ar target-session .
596: If used from inside, switch the current client.
597: If
598: .Fl d
599: is specified, any other clients attached to the session are detached.
1.148 nicm 600: .Fl r
601: signifies the client is read-only (only keys bound to the
602: .Ic detach-client
1.242 nicm 603: or
604: .Ic switch-client
605: commands have any effect)
1.13 nicm 606: .Pp
1.57 jmc 607: If no server is started,
608: .Ic attach-session
609: will attempt to start it; this will fail unless sessions are created in the
610: configuration file.
1.217 nicm 611: .Pp
612: The
613: .Ar target-session
614: rules for
615: .Ic attach-session
616: are slightly adjusted: if
617: .Nm
618: needs to select the most recently used session, it will prefer the most
619: recently used
620: .Em unattached
621: session.
1.372 nicm 622: .Pp
623: .Fl c
624: will set the session working directory (used for new windows) to
625: .Ar working-directory .
1.211 nicm 626: .It Xo Ic detach-client
627: .Op Fl P
1.296 nicm 628: .Op Fl a
1.219 nicm 629: .Op Fl s Ar target-session
1.211 nicm 630: .Op Fl t Ar target-client
631: .Xc
1.57 jmc 632: .D1 (alias: Ic detach )
1.218 nicm 633: Detach the current client if bound to a key, the client specified with
634: .Fl t ,
1.258 jmc 635: or all clients currently attached to the session specified by
1.218 nicm 636: .Fl s .
1.296 nicm 637: The
638: .Fl a
639: option kills all but the client given with
640: .Fl t .
1.211 nicm 641: If
642: .Fl P
643: is given, send SIGHUP to the parent process of the client, typically causing it
644: to exit.
1.57 jmc 645: .It Ic has-session Op Fl t Ar target-session
646: .D1 (alias: Ic has )
647: Report an error and exit with 1 if the specified session does not exist.
648: If it does exist, exit with 0.
649: .It Ic kill-server
650: Kill the
1.1 nicm 651: .Nm
1.57 jmc 652: server and clients and destroy all sessions.
1.369 nicm 653: .It Xo Ic kill-session
1.297 nicm 654: .Op Fl a
655: .Op Fl t Ar target-session
1.369 nicm 656: .Xc
1.57 jmc 657: Destroy the given session, closing any windows linked to it and no other
658: sessions, and detaching all clients attached to it.
1.297 nicm 659: If
660: .Fl a
661: is given, all sessions but the specified one is killed.
1.250 nicm 662: .It Xo Ic list-clients
663: .Op Fl F Ar format
664: .Op Fl t Ar target-session
665: .Xc
1.57 jmc 666: .D1 (alias: Ic lsc )
1.221 jmc 667: List all clients attached to the server.
1.250 nicm 668: For the meaning of the
669: .Fl F
670: flag, see the
1.252 jmc 671: .Sx FORMATS
672: section.
1.221 jmc 673: If
1.220 nicm 674: .Ar target-session
675: is specified, list only clients connected to that session.
1.57 jmc 676: .It Ic list-commands
677: .D1 (alias: Ic lscm )
678: List the syntax of all commands supported by
679: .Nm .
1.247 nicm 680: .It Ic list-sessions Op Fl F Ar format
1.57 jmc 681: .D1 (alias: Ic ls )
682: List all sessions managed by the server.
1.247 nicm 683: For the meaning of the
684: .Fl F
685: flag, see the
686: .Sx FORMATS
687: section.
1.175 nicm 688: .It Ic lock-client Op Fl t Ar target-client
689: .D1 (alias: Ic lockc )
1.92 nicm 690: Lock
691: .Ar target-client ,
692: see the
693: .Ic lock-server
694: command.
1.175 nicm 695: .It Ic lock-session Op Fl t Ar target-session
696: .D1 (alias: Ic locks )
1.92 nicm 697: Lock all clients attached to
698: .Ar target-session .
1.57 jmc 699: .It Xo Ic new-session
1.351 nicm 700: .Op Fl AdDP
1.371 nicm 701: .Op Fl c Ar start-directory
1.351 nicm 702: .Op Fl F Ar format
1.57 jmc 703: .Op Fl n Ar window-name
704: .Op Fl s Ar session-name
1.101 nicm 705: .Op Fl t Ar target-session
1.210 nicm 706: .Op Fl x Ar width
707: .Op Fl y Ar height
1.153 nicm 708: .Op Ar shell-command
1.57 jmc 709: .Xc
710: .D1 (alias: Ic new )
711: Create a new session with name
712: .Ar session-name .
1.153 nicm 713: .Pp
1.57 jmc 714: The new session is attached to the current terminal unless
715: .Fl d
716: is given.
717: .Ar window-name
1.1 nicm 718: and
1.153 nicm 719: .Ar shell-command
720: are the name of and shell command to execute in the initial window.
1.210 nicm 721: If
722: .Fl d
723: is used,
724: .Fl x
725: and
726: .Fl y
727: specify the size of the initial window (80 by 24 if not given).
1.68 nicm 728: .Pp
729: If run from a terminal, any
730: .Xr termios 4
731: special characters are saved and used for new windows in the new session.
1.338 nicm 732: .Pp
733: The
734: .Fl A
735: flag makes
736: .Ic new-session
737: behave like
738: .Ic attach-session
739: if
740: .Ar session-name
741: already exists; in the case,
742: .Fl D
743: behaves like
744: .Fl d
745: to
746: .Ic attach-session .
1.101 nicm 747: .Pp
748: If
749: .Fl t
750: is given, the new session is
751: .Em grouped
752: with
753: .Ar target-session .
754: This means they share the same set of windows - all windows from
755: .Ar target-session
756: are linked to the new session and any subsequent new windows or windows being
757: closed are applied to both sessions.
758: The current and previous window and any session options remain independent and
759: either session may be killed without affecting the other.
760: Giving
761: .Fl n
762: or
1.153 nicm 763: .Ar shell-command
1.101 nicm 764: are invalid if
765: .Fl t
766: is used.
1.351 nicm 767: .Pp
768: The
769: .Fl P
770: option prints information about the new session after it has been created.
771: By default, it uses the format
772: .Ql #{session_name}:
773: but a different format may be specified with
774: .Fl F .
1.248 nicm 775: .It Xo Ic refresh-client
776: .Op Fl S
777: .Op Fl t Ar target-client
778: .Xc
1.57 jmc 779: .D1 (alias: Ic refresh )
780: Refresh the current client if bound to a key, or a single client if one is given
781: with
782: .Fl t .
1.248 nicm 783: If
784: .Fl S
785: is specified, only update the client's status bar.
1.57 jmc 786: .It Xo Ic rename-session
787: .Op Fl t Ar target-session
788: .Ar new-name
789: .Xc
790: .D1 (alias: Ic rename )
791: Rename the session to
792: .Ar new-name .
1.121 nicm 793: .It Xo Ic show-messages
1.377 nicm 794: .Op Fl IJT
1.120 nicm 795: .Op Fl t Ar target-client
796: .Xc
797: .D1 (alias: Ic showmsgs )
1.377 nicm 798: Show client messages or server information.
1.120 nicm 799: Any messages displayed on the status line are saved in a per-client message
800: log, up to a maximum of the limit set by the
801: .Ar message-limit
1.384 nicm 802: server option.
1.377 nicm 803: With
804: .Fl t ,
805: display the log for
1.120 nicm 806: .Ar target-client .
1.379 jmc 807: .Fl I ,
1.377 nicm 808: .Fl J
809: and
810: .Fl T
811: show debugging information about the running server, jobs and terminals.
1.57 jmc 812: .It Ic source-file Ar path
813: .D1 (alias: Ic source )
814: Execute commands from
815: .Ar path .
816: .It Ic start-server
817: .D1 (alias: Ic start )
818: Start the
1.1 nicm 819: .Nm
1.57 jmc 820: server, if not already running, without creating any sessions.
821: .It Xo Ic suspend-client
1.202 nicm 822: .Op Fl t Ar target-client
1.57 jmc 823: .Xc
824: .D1 (alias: Ic suspendc )
825: Suspend a client by sending
826: .Dv SIGTSTP
827: (tty stop).
828: .It Xo Ic switch-client
1.242 nicm 829: .Op Fl lnpr
1.57 jmc 830: .Op Fl c Ar target-client
831: .Op Fl t Ar target-session
832: .Xc
833: .D1 (alias: Ic switchc )
834: Switch the current session for client
835: .Ar target-client
836: to
837: .Ar target-session .
1.183 nicm 838: If
1.197 jmc 839: .Fl l ,
1.183 nicm 840: .Fl n
841: or
842: .Fl p
1.194 nicm 843: is used, the client is moved to the last, next or previous session
844: respectively.
1.242 nicm 845: .Fl r
846: toggles whether a client is read-only (see the
847: .Ic attach-session
848: command).
1.57 jmc 849: .El
850: .Sh WINDOWS AND PANES
1.1 nicm 851: A
852: .Nm
853: window may be in one of several modes.
854: The default permits direct access to the terminal attached to the window.
1.164 nicm 855: The other is copy mode, which permits a section of a window or its
856: history to be copied to a
1.1 nicm 857: .Em paste buffer
858: for later insertion into another window.
859: This mode is entered with the
860: .Ic copy-mode
861: command, bound to
1.113 nicm 862: .Ql \&[
1.1 nicm 863: by default.
1.164 nicm 864: It is also entered when a command that produces output, such as
865: .Ic list-keys ,
866: is executed from a key binding.
1.1 nicm 867: .Pp
1.6 jmc 868: The keys available depend on whether emacs or vi mode is selected
869: (see the
1.1 nicm 870: .Ic mode-keys
871: option).
872: The following keys are supported as appropriate for the mode:
1.157 nicm 873: .Bl -column "FunctionXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
1.1 nicm 874: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
1.383 nicm 875: .It Li "Append selection" Ta "A" Ta ""
1.27 nicm 876: .It Li "Back to indentation" Ta "^" Ta "M-m"
1.393 nicm 877: .It Li "Copy to named buffer" Ta \&" Ta ""
1.142 nicm 878: .It Li "Bottom of history" Ta "G" Ta "M-<"
1.1 nicm 879: .It Li "Clear selection" Ta "Escape" Ta "C-g"
880: .It Li "Copy selection" Ta "Enter" Ta "M-w"
881: .It Li "Cursor down" Ta "j" Ta "Down"
1.70 nicm 882: .It Li "Cursor left" Ta "h" Ta "Left"
883: .It Li "Cursor right" Ta "l" Ta "Right"
1.116 nicm 884: .It Li "Cursor to bottom line" Ta "L" Ta ""
885: .It Li "Cursor to middle line" Ta "M" Ta "M-r"
886: .It Li "Cursor to top line" Ta "H" Ta "M-R"
1.70 nicm 887: .It Li "Cursor up" Ta "k" Ta "Up"
1.71 nicm 888: .It Li "Delete entire line" Ta "d" Ta "C-u"
1.227 nicm 889: .It Li "Delete/Copy to end of line" Ta "D" Ta "C-k"
1.1 nicm 890: .It Li "End of line" Ta "$" Ta "C-e"
1.142 nicm 891: .It Li "Go to line" Ta ":" Ta "g"
1.116 nicm 892: .It Li "Half page down" Ta "C-d" Ta "M-Down"
893: .It Li "Half page up" Ta "C-u" Ta "M-Up"
1.157 nicm 894: .It Li "Jump forward" Ta "f" Ta "f"
1.256 nicm 895: .It Li "Jump to forward" Ta "t" Ta ""
1.157 nicm 896: .It Li "Jump backward" Ta "F" Ta "F"
1.256 nicm 897: .It Li "Jump to backward" Ta "T" Ta ""
1.157 nicm 898: .It Li "Jump again" Ta ";" Ta ";"
899: .It Li "Jump again in reverse" Ta "," Ta ","
1.1 nicm 900: .It Li "Next page" Ta "C-f" Ta "Page down"
1.146 nicm 901: .It Li "Next space" Ta "W" Ta ""
902: .It Li "Next space, end of word" Ta "E" Ta ""
1.143 nicm 903: .It Li "Next word" Ta "w" Ta ""
904: .It Li "Next word end" Ta "e" Ta "M-f"
1.375 nicm 905: .It Li "Other end of selection" Ta "o" Ta ""
1.70 nicm 906: .It Li "Paste buffer" Ta "p" Ta "C-y"
1.116 nicm 907: .It Li "Previous page" Ta "C-b" Ta "Page up"
1.1 nicm 908: .It Li "Previous word" Ta "b" Ta "M-b"
1.146 nicm 909: .It Li "Previous space" Ta "B" Ta ""
1.1 nicm 910: .It Li "Quit mode" Ta "q" Ta "Escape"
1.147 nicm 911: .It Li "Rectangle toggle" Ta "v" Ta "R"
1.141 nicm 912: .It Li "Scroll down" Ta "C-Down or C-e" Ta "C-Down"
913: .It Li "Scroll up" Ta "C-Up or C-y" Ta "C-Up"
1.70 nicm 914: .It Li "Search again" Ta "n" Ta "n"
1.152 nicm 915: .It Li "Search again in reverse" Ta "N" Ta "N"
1.70 nicm 916: .It Li "Search backward" Ta "?" Ta "C-r"
917: .It Li "Search forward" Ta "/" Ta "C-s"
918: .It Li "Start of line" Ta "0" Ta "C-a"
1.1 nicm 919: .It Li "Start selection" Ta "Space" Ta "C-Space"
1.142 nicm 920: .It Li "Top of history" Ta "g" Ta "M->"
1.327 nicm 921: .It Li "Transpose characters" Ta "" Ta "C-t"
1.1 nicm 922: .El
1.146 nicm 923: .Pp
924: The next and previous word keys use space and the
925: .Ql - ,
1.154 nicm 926: .Ql _
1.146 nicm 927: and
928: .Ql @
1.154 nicm 929: characters as word delimiters by default, but this can be adjusted by
930: setting the
931: .Em word-separators
1.255 nicm 932: session option.
1.146 nicm 933: Next word moves to the start of the next word, next word end to the end of the
934: next word and previous word to the start of the previous word.
935: The three next and previous space keys work similarly but use a space alone as
936: the word separator.
1.157 nicm 937: .Pp
938: The jump commands enable quick movement within a line.
939: For instance, typing
940: .Ql f
941: followed by
942: .Ql /
943: will move the cursor to the next
944: .Ql /
945: character on the current line.
946: A
947: .Ql \&;
948: will then jump to the next occurrence.
1.1 nicm 949: .Pp
1.155 nicm 950: Commands in copy mode may be prefaced by an optional repeat count.
951: With vi key bindings, a prefix is entered using the number keys; with
952: emacs, the Alt (meta) key and a number begins prefix entry.
953: For example, to move the cursor forward by ten words, use
954: .Ql M-1 0 M-f
955: in emacs mode, and
956: .Ql 10w
957: in vi.
958: .Pp
959: Mode key bindings are defined in a set of named tables:
1.48 nicm 960: .Em vi-edit
961: and
962: .Em emacs-edit
963: for keys used when line editing at the command prompt;
964: .Em vi-choice
965: and
966: .Em emacs-choice
967: for keys used when choosing from lists (such as produced by the
1.144 nicm 968: .Ic choose-window
1.164 nicm 969: command); and
1.48 nicm 970: .Em vi-copy
971: and
972: .Em emacs-copy
1.97 nicm 973: used in copy mode.
1.48 nicm 974: The tables may be viewed with the
975: .Ic list-keys
1.49 nicm 976: command and keys modified or removed with
977: .Ic bind-key
978: and
979: .Ic unbind-key .
1.330 nicm 980: One command accepts an argument,
1.327 nicm 981: .Ic copy-pipe ,
982: which copies the selection and pipes it to a command.
983: For example the following will bind
984: .Ql C-q
985: to copy the selection into
986: .Pa /tmp
987: as well as the paste buffer:
988: .Bd -literal -offset indent
989: bind-key -temacs-copy C-q copy-pipe "cat >/tmp/out"
990: .Ed
1.48 nicm 991: .Pp
1.2 nicm 992: The paste buffer key pastes the first line from the top paste buffer on the
993: stack.
1.57 jmc 994: .Pp
1.164 nicm 995: The synopsis for the
996: .Ic copy-mode
997: command is:
1.57 jmc 998: .Bl -tag -width Ds
999: .It Xo Ic copy-mode
1000: .Op Fl u
1.72 nicm 1001: .Op Fl t Ar target-pane
1.57 jmc 1002: .Xc
1003: Enter copy mode.
1004: The
1005: .Fl u
1006: option scrolls one page up.
1007: .El
1.18 nicm 1008: .Pp
1.1 nicm 1009: Each window displayed by
1010: .Nm
1011: may be split into one or more
1012: .Em panes ;
1013: each pane takes up a certain area of the display and is a separate terminal.
1014: A window may be split into panes using the
1015: .Ic split-window
1016: command.
1.38 nicm 1017: Windows may be split horizontally (with the
1018: .Fl h
1019: flag) or vertically.
1020: Panes may be resized with the
1021: .Ic resize-pane
1.1 nicm 1022: command (bound to
1.38 nicm 1023: .Ql C-up ,
1024: .Ql C-down
1025: .Ql C-left
1026: and
1027: .Ql C-right
1.1 nicm 1028: by default), the current pane may be changed with the
1.156 nicm 1029: .Ic select-pane
1030: command and the
1.1 nicm 1031: .Ic rotate-window
1032: and
1033: .Ic swap-pane
1.38 nicm 1034: commands may be used to swap panes without changing their position.
1035: Panes are numbered beginning from zero in the order they are created.
1036: .Pp
1037: A number of preset
1038: .Em layouts
1039: are available.
1040: These may be selected with the
1041: .Ic select-layout
1042: command or cycled with
1043: .Ic next-layout
1044: (bound to
1.149 nicm 1045: .Ql Space
1.131 nicm 1046: by default); once a layout is chosen, panes within it may be moved and resized
1047: as normal.
1.1 nicm 1048: .Pp
1049: The following layouts are supported:
1050: .Bl -tag -width Ds
1051: .It Ic even-horizontal
1052: Panes are spread out evenly from left to right across the window.
1053: .It Ic even-vertical
1054: Panes are spread evenly from top to bottom.
1.2 nicm 1055: .It Ic main-horizontal
1.131 nicm 1056: A large (main) pane is shown at the top of the window and the remaining panes
1057: are spread from left to right in the leftover space at the bottom.
1.2 nicm 1058: Use the
1059: .Em main-pane-height
1060: window option to specify the height of the top pane.
1.1 nicm 1061: .It Ic main-vertical
1.2 nicm 1062: Similar to
1063: .Ic main-horizontal
1064: but the large pane is placed on the left and the others spread from top to
1065: bottom along the right.
1066: See the
1067: .Em main-pane-width
1068: window option.
1.165 nicm 1069: .It Ic tiled
1070: Panes are spread out as evenly as possible over the window in both rows and
1071: columns.
1.1 nicm 1072: .El
1.8 nicm 1073: .Pp
1.181 nicm 1074: In addition,
1075: .Ic select-layout
1076: may be used to apply a previously used layout - the
1077: .Ic list-windows
1078: command displays the layout of each window in a form suitable for use with
1079: .Ic select-layout .
1080: For example:
1081: .Bd -literal -offset indent
1082: $ tmux list-windows
1083: 0: ksh [159x48]
1084: layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
1085: $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
1086: .Ed
1.196 nicm 1087: .Pp
1.181 nicm 1088: .Nm
1089: automatically adjusts the size of the layout for the current window size.
1090: Note that a layout cannot be applied to a window with more panes than that
1091: from which the layout was originally defined.
1092: .Pp
1.57 jmc 1093: Commands related to windows and panes are as follows:
1094: .Bl -tag -width Ds
1095: .It Xo Ic break-pane
1.280 nicm 1096: .Op Fl dP
1097: .Op Fl F Ar format
1.57 jmc 1098: .Op Fl t Ar target-pane
1099: .Xc
1100: .D1 (alias: Ic breakp )
1101: Break
1102: .Ar target-pane
1103: off from its containing window to make it the only pane in a new window.
1104: If
1105: .Fl d
1106: is given, the new window does not become the current window.
1.280 nicm 1107: The
1108: .Fl P
1109: option prints information about the new window after it has been created.
1110: By default, it uses the format
1111: .Ql #{session_name}:#{window_index}
1112: but a different format may be specified with
1113: .Fl F .
1.128 nicm 1114: .It Xo Ic capture-pane
1.346 nicm 1115: .Op Fl aepPq
1.392 nicm 1116: .Op Fl b Ar buffer-name
1.213 nicm 1117: .Op Fl E Ar end-line
1118: .Op Fl S Ar start-line
1.128 nicm 1119: .Op Fl t Ar target-pane
1120: .Xc
1121: .D1 (alias: Ic capturep )
1.322 nicm 1122: Capture the contents of a pane.
1123: If
1124: .Fl p
1.325 nicm 1125: is given, the output goes to stdout, otherwise to the buffer specified with
1.322 nicm 1126: .Fl b
1127: or a new buffer if omitted.
1.339 nicm 1128: If
1129: .Fl a
1130: is given, the alternate screen is used, and the history is not accessible.
1.340 nicm 1131: If no alternate screen exists, an error will be returned unless
1132: .Fl q
1133: is given.
1.326 nicm 1134: If
1135: .Fl e
1.328 nicm 1136: is given, the output includes escape sequences for text and background
1137: attributes.
1138: .Fl C
1.330 nicm 1139: also escapes non-printable characters as octal \exxx.
1.328 nicm 1140: .Fl J
1.341 nicm 1141: joins wrapped lines and preserves trailing spaces at each line's end.
1.346 nicm 1142: .Fl P
1143: captures only any output that the pane has received that is the beginning of an
1144: as-yet incomplete escape sequence.
1.213 nicm 1145: .Pp
1146: .Fl S
1147: and
1148: .Fl E
1149: specify the starting and ending line numbers, zero is the first line of the
1150: visible pane and negative numbers are lines in the history.
1151: The default is to capture only the visible contents of the pane.
1.76 nicm 1152: .It Xo
1153: .Ic choose-client
1.294 nicm 1154: .Op Fl F Ar format
1.76 nicm 1155: .Op Fl t Ar target-window
1156: .Op Ar template
1157: .Xc
1158: Put a window into client choice mode, allowing a client to be selected
1159: interactively from a list.
1160: After a client is chosen,
1161: .Ql %%
1162: is replaced by the client
1163: .Xr pty 4
1164: path in
1165: .Ar template
1166: and the result executed as a command.
1167: If
1168: .Ar template
1169: is not given, "detach-client -t '%%'" is used.
1.294 nicm 1170: For the meaning of the
1171: .Fl F
1172: flag, see the
1173: .Sx FORMATS
1174: section.
1.314 nicm 1175: This command works only if at least one client is attached.
1.76 nicm 1176: .It Xo
1177: .Ic choose-session
1.294 nicm 1178: .Op Fl F Ar format
1.76 nicm 1179: .Op Fl t Ar target-window
1180: .Op Ar template
1181: .Xc
1182: Put a window into session choice mode, where a session may be selected
1183: interactively from a list.
1184: When one is chosen,
1185: .Ql %%
1186: is replaced by the session name in
1187: .Ar template
1188: and the result executed as a command.
1189: If
1190: .Ar template
1191: is not given, "switch-client -t '%%'" is used.
1.294 nicm 1192: For the meaning of the
1193: .Fl F
1194: flag, see the
1195: .Sx FORMATS
1196: section.
1.314 nicm 1197: This command works only if at least one client is attached.
1.298 nicm 1198: .It Xo
1199: .Ic choose-tree
1.319 nicm 1200: .Op Fl suw
1.298 nicm 1201: .Op Fl b Ar session-template
1202: .Op Fl c Ar window-template
1203: .Op Fl S Ar format
1204: .Op Fl W Ar format
1205: .Op Fl t Ar target-window
1206: .Xc
1207: Put a window into tree choice mode, where either sessions or windows may be
1208: selected interactively from a list.
1209: By default, windows belonging to a session are indented to show their
1210: relationship to a session.
1211: .Pp
1212: Note that the
1213: .Ic choose-window
1214: and
1215: .Ic choose-session
1216: commands are wrappers around
1217: .Ic choose-tree .
1218: .Pp
1219: If
1220: .Fl s
1221: is given, will show sessions.
1222: If
1223: .Fl w
1224: is given, will show windows.
1.320 nicm 1225: .Pp
1226: By default, the tree is collapsed and sessions must be expanded to windows
1227: with the right arrow key.
1228: The
1.309 nicm 1229: .Fl u
1.321 jmc 1230: option will start with all sessions expanded instead.
1.320 nicm 1231: .Pp
1.298 nicm 1232: If
1233: .Fl b
1234: is given, will override the default session command.
1235: Note that
1236: .Ql %%
1.320 nicm 1237: can be used and will be replaced with the session name.
1.298 nicm 1238: The default option if not specified is "switch-client -t '%%'".
1239: If
1240: .Fl c
1241: is given, will override the default window command.
1.320 nicm 1242: Like
1243: .Fl b ,
1.298 nicm 1244: .Ql %%
1.320 nicm 1245: can be used and will be replaced with the session name and window index.
1246: When a window is chosen from the list, the session command is run before the
1247: window command.
1248: .Pp
1.298 nicm 1249: If
1250: .Fl S
1251: is given will display the specified format instead of the default session
1252: format.
1253: If
1254: .Fl W
1255: is given will display the specified format instead of the default window
1256: format.
1257: For the meaning of the
1258: .Fl s
1259: and
1260: .Fl w
1261: options, see the
1262: .Sx FORMATS
1263: section.
1.320 nicm 1264: .Pp
1.314 nicm 1265: This command works only if at least one client is attached.
1.76 nicm 1266: .It Xo
1267: .Ic choose-window
1.294 nicm 1268: .Op Fl F Ar format
1.76 nicm 1269: .Op Fl t Ar target-window
1270: .Op Ar template
1271: .Xc
1272: Put a window into window choice mode, where a window may be chosen
1273: interactively from a list.
1274: After a window is selected,
1275: .Ql %%
1276: is replaced by the session name and window index in
1277: .Ar template
1278: and the result executed as a command.
1279: If
1280: .Ar template
1281: is not given, "select-window -t '%%'" is used.
1.294 nicm 1282: For the meaning of the
1283: .Fl F
1284: flag, see the
1285: .Sx FORMATS
1286: section.
1.314 nicm 1287: This command works only if at least one client is attached.
1.78 nicm 1288: .It Ic display-panes Op Fl t Ar target-client
1289: .D1 (alias: Ic displayp)
1290: Display a visible indicator of each pane shown by
1291: .Ar target-client .
1292: See the
1.145 nicm 1293: .Ic display-panes-time ,
1294: .Ic display-panes-colour ,
1.78 nicm 1295: and
1.145 nicm 1296: .Ic display-panes-active-colour
1.78 nicm 1297: session options.
1.84 nicm 1298: While the indicator is on screen, a pane may be selected with the
1299: .Ql 0
1300: to
1301: .Ql 9
1302: keys.
1.57 jmc 1303: .It Xo Ic find-window
1.285 nicm 1304: .Op Fl CNT
1.294 nicm 1305: .Op Fl F Ar format
1.57 jmc 1306: .Op Fl t Ar target-window
1307: .Ar match-string
1308: .Xc
1309: .D1 (alias: Ic findw )
1310: Search for the
1311: .Xr fnmatch 3
1312: pattern
1313: .Ar match-string
1314: in window names, titles, and visible content (but not history).
1.285 nicm 1315: The flags control matching behavior:
1316: .Fl C
1317: matches only visible window contents,
1318: .Fl N
1319: matches only the window name and
1320: .Fl T
1321: matches only the window title.
1322: The default is
1323: .Fl CNT .
1324: If only one window is matched, it'll be automatically selected,
1325: otherwise a choice list is shown.
1.294 nicm 1326: For the meaning of the
1327: .Fl F
1328: flag, see the
1329: .Sx FORMATS
1330: section.
1.314 nicm 1331: This command works only if at least one client is attached.
1.137 nicm 1332: .It Xo Ic join-pane
1.277 nicm 1333: .Op Fl bdhv
1.137 nicm 1334: .Oo Fl l
1335: .Ar size |
1336: .Fl p Ar percentage Oc
1337: .Op Fl s Ar src-pane
1338: .Op Fl t Ar dst-pane
1339: .Xc
1340: .D1 (alias: Ic joinp )
1341: Like
1342: .Ic split-window ,
1343: but instead of splitting
1344: .Ar dst-pane
1345: and creating a new pane, split it and move
1346: .Ar src-pane
1347: into the space.
1348: This can be used to reverse
1349: .Ic break-pane .
1.277 nicm 1350: The
1351: .Fl b
1352: option causes
1353: .Ar src-pane
1354: to be joined to left of or above
1355: .Ar dst-pane .
1.112 nicm 1356: .It Xo Ic kill-pane
1357: .Op Fl a
1358: .Op Fl t Ar target-pane
1359: .Xc
1.57 jmc 1360: .D1 (alias: Ic killp )
1361: Destroy the given pane.
1362: If no panes remain in the containing window, it is also destroyed.
1.112 nicm 1363: The
1364: .Fl a
1365: option kills all but the pane given with
1366: .Fl t .
1.289 nicm 1367: .It Xo Ic kill-window
1368: .Op Fl a
1369: .Op Fl t Ar target-window
1370: .Xc
1.57 jmc 1371: .D1 (alias: Ic killw )
1372: Kill the current window or the window at
1373: .Ar target-window ,
1.1 nicm 1374: removing it from any sessions to which it is linked.
1.289 nicm 1375: The
1376: .Fl a
1377: option kills all but the window given with
1378: .Fl t .
1.187 nicm 1379: .It Ic last-pane Op Fl t Ar target-window
1380: .D1 (alias: Ic lastp )
1381: Select the last (previously selected) pane.
1.56 jmc 1382: .It Ic last-window Op Fl t Ar target-session
1.1 nicm 1383: .D1 (alias: Ic last )
1384: Select the last (previously selected) window.
1385: If no
1386: .Ar target-session
1387: is specified, select the last window of the current session.
1388: .It Xo Ic link-window
1389: .Op Fl dk
1390: .Op Fl s Ar src-window
1391: .Op Fl t Ar dst-window
1392: .Xc
1393: .D1 (alias: Ic linkw )
1394: Link the window at
1395: .Ar src-window
1396: to the specified
1397: .Ar dst-window .
1398: If
1399: .Ar dst-window
1400: is specified and no such window exists, the
1401: .Ar src-window
1402: is linked there.
1403: If
1404: .Fl k
1405: is given and
1406: .Ar dst-window
1407: exists, it is killed, otherwise an error is generated.
1408: If
1409: .Fl d
1410: is given, the newly linked window is not selected.
1.214 nicm 1411: .It Xo Ic list-panes
1412: .Op Fl as
1.245 nicm 1413: .Op Fl F Ar format
1.214 nicm 1414: .Op Fl t Ar target
1415: .Xc
1.104 nicm 1416: .D1 (alias: Ic lsp )
1.214 nicm 1417: If
1418: .Fl a
1419: is given,
1420: .Ar target
1421: is ignored and all panes on the server are listed.
1422: If
1423: .Fl s
1424: is given,
1425: .Ar target
1426: is a session (or the current session).
1427: If neither is given,
1428: .Ar target
1429: is a window (or the current window).
1.247 nicm 1430: For the meaning of the
1431: .Fl F
1432: flag, see the
1433: .Sx FORMATS
1434: section.
1.214 nicm 1435: .It Xo Ic list-windows
1436: .Op Fl a
1.245 nicm 1437: .Op Fl F Ar format
1.214 nicm 1438: .Op Fl t Ar target-session
1439: .Xc
1.1 nicm 1440: .D1 (alias: Ic lsw )
1.214 nicm 1441: If
1442: .Fl a
1443: is given, list all windows on the server.
1444: Otherwise, list windows in the current session or in
1.1 nicm 1445: .Ar target-session .
1.245 nicm 1446: For the meaning of the
1447: .Fl F
1448: flag, see the
1449: .Sx FORMATS
1450: section.
1.277 nicm 1451: .It Xo Ic move-pane
1452: .Op Fl bdhv
1453: .Oo Fl l
1454: .Ar size |
1455: .Fl p Ar percentage Oc
1456: .Op Fl s Ar src-pane
1457: .Op Fl t Ar dst-pane
1458: .Xc
1459: .D1 (alias: Ic movep )
1460: Like
1461: .Ic join-pane ,
1462: but
1463: .Ar src-pane
1464: and
1465: .Ar dst-pane
1466: may belong to the same window.
1.1 nicm 1467: .It Xo Ic move-window
1.291 nicm 1468: .Op Fl rdk
1.1 nicm 1469: .Op Fl s Ar src-window
1470: .Op Fl t Ar dst-window
1471: .Xc
1472: .D1 (alias: Ic movew )
1473: This is similar to
1474: .Ic link-window ,
1475: except the window at
1476: .Ar src-window
1477: is moved to
1478: .Ar dst-window .
1.291 nicm 1479: With
1480: .Fl r ,
1481: all windows in the session are renumbered in sequential order, respecting
1482: the
1483: .Ic base-index
1484: option.
1.1 nicm 1485: .It Xo Ic new-window
1.201 nicm 1486: .Op Fl adkP
1.272 nicm 1487: .Op Fl c Ar start-directory
1.351 nicm 1488: .Op Fl F Ar format
1.1 nicm 1489: .Op Fl n Ar window-name
1490: .Op Fl t Ar target-window
1.153 nicm 1491: .Op Ar shell-command
1.1 nicm 1492: .Xc
1493: .D1 (alias: Ic neww )
1494: Create a new window.
1.160 nicm 1495: With
1496: .Fl a ,
1497: the new window is inserted at the next index up from the specified
1498: .Ar target-window ,
1499: moving windows up if necessary,
1500: otherwise
1501: .Ar target-window
1502: is the new window location.
1503: .Pp
1.1 nicm 1504: If
1505: .Fl d
1506: is given, the session does not make the new window the current window.
1507: .Ar target-window
1.28 nicm 1508: represents the window to be created; if the target already exists an error is
1509: shown, unless the
1510: .Fl k
1511: flag is used, in which case it is destroyed.
1.153 nicm 1512: .Ar shell-command
1.1 nicm 1513: is the command to execute.
1514: If
1.153 nicm 1515: .Ar shell-command
1516: is not specified, the value of the
1517: .Ic default-command
1518: option is used.
1.272 nicm 1519: .Fl c
1520: specifies the working directory in which the new window is created.
1.153 nicm 1521: .Pp
1522: When the shell command completes, the window closes.
1523: See the
1524: .Ic remain-on-exit
1525: option to change this behaviour.
1.1 nicm 1526: .Pp
1527: The
1528: .Ev TERM
1529: environment variable must be set to
1530: .Dq screen
1531: for all programs running
1532: .Em inside
1533: .Nm .
1534: New windows will automatically have
1535: .Dq TERM=screen
1536: added to their environment, but care must be taken not to reset this in shell
1537: start-up files.
1.201 nicm 1538: .Pp
1539: The
1540: .Fl P
1.279 nicm 1541: option prints information about the new window after it has been created.
1542: By default, it uses the format
1543: .Ql #{session_name}:#{window_index}
1544: but a different format may be specified with
1545: .Fl F .
1.56 jmc 1546: .It Ic next-layout Op Fl t Ar target-window
1.1 nicm 1547: .D1 (alias: Ic nextl )
1548: Move a window to the next layout and rearrange the panes to fit.
1549: .It Xo Ic next-window
1.9 nicm 1550: .Op Fl a
1.1 nicm 1551: .Op Fl t Ar target-session
1552: .Xc
1553: .D1 (alias: Ic next )
1554: Move to the next window in the session.
1.9 nicm 1555: If
1.12 jmc 1556: .Fl a
1.295 nicm 1557: is used, move to the next window with an alert.
1.107 nicm 1558: .It Xo Ic pipe-pane
1559: .Op Fl o
1560: .Op Fl t Ar target-pane
1.153 nicm 1561: .Op Ar shell-command
1.107 nicm 1562: .Xc
1563: .D1 (alias: Ic pipep )
1564: Pipe any output sent by the program in
1565: .Ar target-pane
1566: to a shell command.
1567: A pane may only be piped to one command at a time, any existing pipe is
1568: closed before
1.153 nicm 1569: .Ar shell-command
1.107 nicm 1570: is executed.
1.174 nicm 1571: The
1572: .Ar shell-command
1573: string may contain the special character sequences supported by the
1574: .Ic status-left
1.231 nicm 1575: option.
1.107 nicm 1576: If no
1.153 nicm 1577: .Ar shell-command
1.107 nicm 1578: is given, the current pipe (if any) is closed.
1579: .Pp
1580: The
1581: .Fl o
1582: option only opens a new pipe if no previous pipe exists, allowing a pipe to
1583: be toggled with a single key, for example:
1584: .Bd -literal -offset indent
1.174 nicm 1585: bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1.107 nicm 1586: .Ed
1.176 nicm 1587: .It Xo Ic previous-layout
1588: .Op Fl t Ar target-window
1589: .Xc
1590: .D1 (alias: Ic prevl )
1591: Move to the previous layout in the session.
1.1 nicm 1592: .It Xo Ic previous-window
1.9 nicm 1593: .Op Fl a
1.1 nicm 1594: .Op Fl t Ar target-session
1595: .Xc
1596: .D1 (alias: Ic prev )
1597: Move to the previous window in the session.
1.9 nicm 1598: With
1599: .Fl a ,
1.295 nicm 1600: move to the previous window with an alert.
1.1 nicm 1601: .It Xo Ic rename-window
1602: .Op Fl t Ar target-window
1603: .Ar new-name
1604: .Xc
1605: .D1 (alias: Ic renamew )
1606: Rename the current window, or the window at
1607: .Ar target-window
1608: if specified, to
1609: .Ar new-name .
1610: .It Xo Ic resize-pane
1.337 nicm 1611: .Op Fl DLRUZ
1.52 nicm 1612: .Op Fl t Ar target-pane
1.324 nicm 1613: .Op Fl x Ar width
1614: .Op Fl y Ar height
1.1 nicm 1615: .Op Ar adjustment
1616: .Xc
1617: .D1 (alias: Ic resizep )
1.324 nicm 1618: Resize a pane, up, down, left or right by
1619: .Ar adjustment
1620: with
1621: .Fl U ,
1.57 jmc 1622: .Fl D ,
1623: .Fl L
1.324 nicm 1624: or
1625: .Fl R ,
1626: or
1627: to an absolute size
1628: with
1629: .Fl x
1630: or
1631: .Fl y .
1.57 jmc 1632: The
1633: .Ar adjustment
1634: is given in lines or cells (the default is 1).
1.337 nicm 1635: .Pp
1636: With
1637: .Fl Z ,
1.349 nicm 1638: the active pane is toggled between zoomed (occupying the whole of the window)
1639: and unzoomed (its normal position in the layout).
1.234 nicm 1640: .It Xo Ic respawn-pane
1641: .Op Fl k
1642: .Op Fl t Ar target-pane
1643: .Op Ar shell-command
1644: .Xc
1645: .D1 (alias: Ic respawnp )
1646: Reactivate a pane in which the command has exited (see the
1647: .Ic remain-on-exit
1648: window option).
1649: If
1650: .Ar shell-command
1651: is not given, the command used when the pane was created is executed.
1652: The pane must be already inactive, unless
1653: .Fl k
1654: is given, in which case any existing command is killed.
1.57 jmc 1655: .It Xo Ic respawn-window
1656: .Op Fl k
1657: .Op Fl t Ar target-window
1.153 nicm 1658: .Op Ar shell-command
1.57 jmc 1659: .Xc
1660: .D1 (alias: Ic respawnw )
1.153 nicm 1661: Reactivate a window in which the command has exited (see the
1.57 jmc 1662: .Ic remain-on-exit
1663: window option).
1664: If
1.153 nicm 1665: .Ar shell-command
1.57 jmc 1666: is not given, the command used when the window was created is executed.
1667: The window must be already inactive, unless
1668: .Fl k
1669: is given, in which case any existing command is killed.
1670: .It Xo Ic rotate-window
1671: .Op Fl DU
1672: .Op Fl t Ar target-window
1673: .Xc
1674: .D1 (alias: Ic rotatew )
1675: Rotate the positions of the panes within a window, either upward (numerically
1676: lower) with
1677: .Fl U
1678: or downward (numerically higher).
1679: .It Xo Ic select-layout
1.313 nicm 1680: .Op Fl np
1.57 jmc 1681: .Op Fl t Ar target-window
1682: .Op Ar layout-name
1683: .Xc
1.176 nicm 1684: .D1 (alias: Ic selectl )
1.57 jmc 1685: Choose a specific layout for a window.
1686: If
1687: .Ar layout-name
1.181 nicm 1688: is not given, the last preset layout used (if any) is reapplied.
1.204 nicm 1689: .Fl n
1690: and
1691: .Fl p
1692: are equivalent to the
1693: .Ic next-layout
1694: and
1695: .Ic previous-layout
1696: commands.
1.156 nicm 1697: .It Xo Ic select-pane
1.204 nicm 1698: .Op Fl lDLRU
1.156 nicm 1699: .Op Fl t Ar target-pane
1700: .Xc
1.57 jmc 1701: .D1 (alias: Ic selectp )
1702: Make pane
1703: .Ar target-pane
1704: the active pane in window
1705: .Ar target-window .
1.156 nicm 1706: If one of
1707: .Fl D ,
1708: .Fl L ,
1709: .Fl R ,
1710: or
1711: .Fl U
1712: is used, respectively the pane below, to the left, to the right, or above the
1713: target pane is used.
1.204 nicm 1714: .Fl l
1715: is the same as using the
1716: .Ic last-pane
1717: command.
1718: .It Xo Ic select-window
1.310 nicm 1719: .Op Fl lnpT
1.204 nicm 1720: .Op Fl t Ar target-window
1721: .Xc
1.57 jmc 1722: .D1 (alias: Ic selectw )
1723: Select the window at
1724: .Ar target-window .
1.204 nicm 1725: .Fl l ,
1726: .Fl n
1727: and
1728: .Fl p
1729: are equivalent to the
1730: .Ic last-window ,
1731: .Ic next-window
1732: and
1733: .Ic previous-window
1734: commands.
1.310 nicm 1735: If
1736: .Fl T
1737: is given and the selected window is already the current window,
1738: the command behaves like
1739: .Ic last-window .
1.57 jmc 1740: .It Xo Ic split-window
1.201 nicm 1741: .Op Fl dhvP
1.272 nicm 1742: .Op Fl c Ar start-directory
1.57 jmc 1743: .Oo Fl l
1744: .Ar size |
1745: .Fl p Ar percentage Oc
1.136 nicm 1746: .Op Fl t Ar target-pane
1.153 nicm 1747: .Op Ar shell-command
1.279 nicm 1748: .Op Fl F Ar format
1.57 jmc 1749: .Xc
1.176 nicm 1750: .D1 (alias: Ic splitw )
1.136 nicm 1751: Create a new pane by splitting
1752: .Ar target-pane :
1.57 jmc 1753: .Fl h
1754: does a horizontal split and
1755: .Fl v
1756: a vertical split; if neither is specified,
1757: .Fl v
1758: is assumed.
1759: The
1760: .Fl l
1761: and
1762: .Fl p
1.136 nicm 1763: options specify the size of the new pane in lines (for vertical split) or in
1.57 jmc 1764: cells (for horizontal split), or as a percentage, respectively.
1.136 nicm 1765: All other options have the same meaning as for the
1.57 jmc 1766: .Ic new-window
1767: command.
1768: .It Xo Ic swap-pane
1769: .Op Fl dDU
1770: .Op Fl s Ar src-pane
1771: .Op Fl t Ar dst-pane
1772: .Xc
1773: .D1 (alias: Ic swapp )
1774: Swap two panes.
1775: If
1776: .Fl U
1777: is used and no source pane is specified with
1778: .Fl s ,
1779: .Ar dst-pane
1780: is swapped with the previous pane (before it numerically);
1781: .Fl D
1782: swaps with the next pane (after it numerically).
1.138 nicm 1783: .Fl d
1784: instructs
1785: .Nm
1786: not to change the active pane.
1.57 jmc 1787: .It Xo Ic swap-window
1788: .Op Fl d
1789: .Op Fl s Ar src-window
1790: .Op Fl t Ar dst-window
1791: .Xc
1792: .D1 (alias: Ic swapw )
1793: This is similar to
1794: .Ic link-window ,
1795: except the source and destination windows are swapped.
1796: It is an error if no window exists at
1797: .Ar src-window .
1798: .It Xo Ic unlink-window
1.1 nicm 1799: .Op Fl k
1800: .Op Fl t Ar target-window
1801: .Xc
1.57 jmc 1802: .D1 (alias: Ic unlinkw )
1803: Unlink
1804: .Ar target-window .
1805: Unless
1806: .Fl k
1807: is given, a window may be unlinked only if it is linked to multiple sessions -
1808: windows may not be linked to no sessions;
1809: if
1.1 nicm 1810: .Fl k
1.57 jmc 1811: is specified and the window is linked to only one session, it is unlinked and
1812: destroyed.
1813: .El
1814: .Sh KEY BINDINGS
1.93 nicm 1815: .Nm
1816: allows a command to be bound to most keys, with or without a prefix key.
1817: When specifying keys, most represent themselves (for example
1818: .Ql A
1819: to
1.95 jmc 1820: .Ql Z ) .
1.93 nicm 1821: Ctrl keys may be prefixed with
1822: .Ql C-
1823: or
1.95 jmc 1824: .Ql ^ ,
1825: and Alt (meta) with
1.93 nicm 1826: .Ql M- .
1827: In addition, the following special key names are accepted:
1.126 nicm 1828: .Em Up ,
1829: .Em Down ,
1830: .Em Left ,
1831: .Em Right ,
1.93 nicm 1832: .Em BSpace ,
1833: .Em BTab ,
1834: .Em DC
1835: (Delete),
1836: .Em End ,
1837: .Em Enter ,
1838: .Em Escape ,
1839: .Em F1
1840: to
1841: .Em F20 ,
1842: .Em Home ,
1843: .Em IC
1844: (Insert),
1.254 nicm 1845: .Em NPage/PageDown/PgDn ,
1846: .Em PPage/PageUp/PgUp ,
1.93 nicm 1847: .Em Space ,
1848: and
1849: .Em Tab .
1850: Note that to bind the
1851: .Ql \&"
1852: or
1853: .Ql '
1854: keys, quotation marks are necessary, for example:
1855: .Bd -literal -offset indent
1856: bind-key '"' split-window
1.167 nicm 1857: bind-key "'" new-window
1.93 nicm 1858: .Ed
1859: .Pp
1.57 jmc 1860: Commands related to key bindings are as follows:
1861: .Bl -tag -width Ds
1862: .It Xo Ic bind-key
1863: .Op Fl cnr
1.395 nicm 1864: .Op Fl t Ar mode-table
1.57 jmc 1865: .Ar key Ar command Op Ar arguments
1.1 nicm 1866: .Xc
1.57 jmc 1867: .D1 (alias: Ic bind )
1868: Bind key
1869: .Ar key
1870: to
1871: .Ar command .
1872: By default (without
1873: .Fl t )
1874: the primary key bindings are modified (those normally activated with the prefix
1875: key); in this case, if
1876: .Fl n
1877: is specified, it is not necessary to use the prefix key,
1878: .Ar command
1879: is bound to
1880: .Ar key
1881: alone.
1.1 nicm 1882: The
1.57 jmc 1883: .Fl r
1884: flag indicates this key may repeat, see the
1885: .Ic repeat-time
1886: option.
1887: .Pp
1888: If
1889: .Fl t
1890: is present,
1891: .Ar key
1892: is bound in
1.395 nicm 1893: .Ar mode-table :
1.57 jmc 1894: the binding for command mode with
1895: .Fl c
1896: or for normal mode without.
1897: To view the default bindings and possible commands, see the
1898: .Ic list-keys
1899: command.
1900: .It Ic list-keys Op Fl t Ar key-table
1901: .D1 (alias: Ic lsk )
1902: List all key bindings.
1903: Without
1904: .Fl t
1905: the primary key bindings - those executed when preceded by the prefix key -
1906: are printed.
1907: .Pp
1908: With
1909: .Fl t ,
1910: the key bindings in
1911: .Ar key-table
1912: are listed; this may be one of:
1913: .Em vi-edit ,
1914: .Em emacs-edit ,
1915: .Em vi-choice ,
1916: .Em emacs-choice ,
1917: .Em vi-copy
1918: or
1919: .Em emacs-copy .
1920: .It Xo Ic send-keys
1.273 nicm 1921: .Op Fl lR
1.72 nicm 1922: .Op Fl t Ar target-pane
1.57 jmc 1923: .Ar key Ar ...
1.1 nicm 1924: .Xc
1.57 jmc 1925: .D1 (alias: Ic send )
1926: Send a key or keys to a window.
1927: Each argument
1928: .Ar key
1929: is the name of the key (such as
1930: .Ql C-a
1931: or
1932: .Ql npage
1933: ) to send; if the string is not recognised as a key, it is sent as a series of
1934: characters.
1.273 nicm 1935: The
1936: .Fl l
1937: flag disables key name lookup and sends the keys literally.
1.57 jmc 1938: All arguments are sent sequentially from first to last.
1.265 nicm 1939: The
1940: .Fl R
1941: flag causes the terminal state to be reset.
1.267 nicm 1942: .It Xo Ic send-prefix
1943: .Op Fl 2
1944: .Op Fl t Ar target-pane
1945: .Xc
1946: Send the prefix key, or with
1947: .Fl 2
1948: the secondary prefix key, to a window as if it was pressed.
1.57 jmc 1949: .It Xo Ic unbind-key
1.189 nicm 1950: .Op Fl acn
1.395 nicm 1951: .Op Fl t Ar mode-table
1.57 jmc 1952: .Ar key
1.2 nicm 1953: .Xc
1.57 jmc 1954: .D1 (alias: Ic unbind )
1955: Unbind the command bound to
1956: .Ar key .
1957: Without
1958: .Fl t
1959: the primary key bindings are modified; in this case, if
1960: .Fl n
1961: is specified, the command bound to
1962: .Ar key
1963: without a prefix (if any) is removed.
1.189 nicm 1964: If
1965: .Fl a
1966: is present, all key bindings are removed.
1.57 jmc 1967: .Pp
1.47 nicm 1968: If
1.57 jmc 1969: .Fl t
1970: is present,
1971: .Ar key
1972: in
1.395 nicm 1973: .Ar mode-table
1.57 jmc 1974: is unbound: the binding for command mode with
1975: .Fl c
1976: or for normal mode without.
1977: .El
1978: .Sh OPTIONS
1979: The appearance and behaviour of
1980: .Nm
1981: may be modified by changing the value of various options.
1.133 nicm 1982: There are three types of option:
1983: .Em server options ,
1.57 jmc 1984: .Em session options
1985: and
1986: .Em window options .
1987: .Pp
1.133 nicm 1988: The
1989: .Nm
1990: server has a set of global options which do not apply to any particular
1991: window or session.
1992: These are altered with the
1993: .Ic set-option
1994: .Fl s
1995: command, or displayed with the
1996: .Ic show-options
1997: .Fl s
1998: command.
1999: .Pp
2000: In addition, each individual session may have a set of session options, and
2001: there is a separate set of global session options.
1.57 jmc 2002: Sessions which do not have a particular option configured inherit the value
2003: from the global session options.
2004: Session options are set or unset with the
2005: .Ic set-option
2006: command and may be listed with the
2007: .Ic show-options
2008: command.
1.133 nicm 2009: The available server and session options are listed under the
1.57 jmc 2010: .Ic set-option
2011: command.
2012: .Pp
2013: Similarly, a set of window options is attached to each window, and there is
2014: a set of global window options from which any unset options are inherited.
2015: Window options are altered with the
2016: .Ic set-window-option
2017: command and can be listed with the
2018: .Ic show-window-options
2019: command.
2020: All window options are documented with the
2021: .Ic set-window-option
2022: command.
1.318 nicm 2023: .Pp
2024: .Nm
2025: also supports user options which are prefixed with a
2026: .Ql \&@ .
1.321 jmc 2027: User options may have any name, so long as they are prefixed with
2028: .Ql \&@ ,
1.318 nicm 2029: and be set to any string.
2030: For example
2031: .Bd -literal -offset indent
2032: $ tmux setw -q @foo "abc123"
2033: $ tmux showw -v @foo
2034: abc123
2035: .Ed
1.57 jmc 2036: .Pp
2037: Commands which set options are as follows:
2038: .Bl -tag -width Ds
1.1 nicm 2039: .It Xo Ic set-option
1.336 nicm 2040: .Op Fl agoqsuw
1.129 nicm 2041: .Op Fl t Ar target-session | Ar target-window
1.1 nicm 2042: .Ar option Ar value
2043: .Xc
2044: .D1 (alias: Ic set )
1.133 nicm 2045: Set a window option with
2046: .Fl w
2047: (equivalent to the
2048: .Ic set-window-option
2049: command),
2050: a server option with
2051: .Fl s ,
2052: otherwise a session option.
2053: .Pp
2054: If
2055: .Fl g
2056: is specified, the global session or window option is set.
1.1 nicm 2057: The
2058: .Fl u
2059: flag unsets an option, so a session inherits the option from the global
1.133 nicm 2060: options.
2061: It is not possible to unset a global option.
1.336 nicm 2062: .Pp
2063: The
2064: .Fl o
2065: flag prevents setting an option that is already set.
1.1 nicm 2066: .Pp
1.281 nicm 2067: The
2068: .Fl q
1.389 nicm 2069: flag suppresses errors about unknown options.
1.281 nicm 2070: .Pp
1.378 nicm 2071: With
2072: .Fl a ,
2073: and if the option expects a string or a style,
2074: .Ar value
2075: is appended to the existing setting.
2076: For example:
2077: .Bd -literal -offset indent
2078: set -g status-left "foo"
2079: set -ag status-left "bar"
2080: .Ed
2081: .Pp
2082: Will result in
2083: .Ql foobar .
2084: And:
2085: .Bd -literal -offset indent
2086: set -g status-style "bg=red"
2087: set -ag status-style "fg=blue"
2088: .Ed
2089: .Pp
2090: Will result in a red background
2091: .Em and
2092: blue foreground.
2093: Without
2094: .Fl a ,
2095: the result would be the default background and a blue foreground.
2096: .Pp
1.133 nicm 2097: Available window options are listed under
2098: .Ic set-window-option .
1.274 nicm 2099: .Pp
2100: .Ar value
2101: depends on the option and may be a number, a string, or a flag (on, off, or
2102: omitted to toggle).
1.133 nicm 2103: .Pp
2104: Available server options are:
2105: .Bl -tag -width Ds
1.198 nicm 2106: .It Ic buffer-limit Ar number
2107: Set the number of buffers; as new buffers are added to the top of the stack,
2108: old ones are removed from the bottom if necessary to maintain this maximum
2109: length.
1.239 nicm 2110: .It Ic escape-time Ar time
2111: Set the time in milliseconds for which
2112: .Nm
2113: waits after an escape is input to determine if it is part of a function or meta
2114: key sequences.
2115: The default is 500 milliseconds.
2116: .It Xo Ic exit-unattached
2117: .Op Ic on | off
2118: .Xc
2119: If enabled, the server will exit when there are no attached clients.
1.362 nicm 2120: .It Xo Ic focus-events
2121: .Op Ic on | off
2122: .Xc
2123: When enabled, focus events are requested from the terminal if supported and
2124: passed through to applications running in
2125: .Nm .
2126: Attached clients should be detached and attached again after changing this
2127: option.
1.384 nicm 2128: .It Ic message-limit Ar number
2129: Set the number of error or information messages to save in the message log for
2130: each client.
2131: The default is 100.
1.228 nicm 2132: .It Xo Ic set-clipboard
2133: .Op Ic on | off
2134: .Xc
2135: Attempt to set the terminal clipboard content using the
2136: \ee]52;...\e007
2137: .Xr xterm 1
2138: escape sequences.
2139: This option is on by default if there is an
2140: .Em \&Ms
2141: entry in the
2142: .Xr terminfo 5
2143: description for the client terminal.
2144: Note that this feature needs to be enabled in
2145: .Xr xterm 1
2146: by setting the resource:
2147: .Bd -literal -offset indent
2148: disallowedWindowOps: 20,21,SetXprop
2149: .Ed
2150: .Pp
2151: Or changing this property from the
2152: .Xr xterm 1
2153: interactive menu when required.
1.381 nicm 2154: .It Ic terminal-overrides Ar string
2155: Contains a list of entries which override terminal descriptions read using
2156: .Xr terminfo 5 .
2157: .Ar string
2158: is a comma-separated list of items each a colon-separated string made up of a
2159: terminal type pattern (matched using
2160: .Xr fnmatch 3 )
2161: and a set of
2162: .Em name=value
2163: entries.
2164: .Pp
2165: For example, to set the
2166: .Ql clear
2167: .Xr terminfo 5
2168: entry to
2169: .Ql \ee[H\ee[2J
2170: for all terminal types and the
2171: .Ql dch1
2172: entry to
2173: .Ql \ee[P
2174: for the
2175: .Ql rxvt
2176: terminal type, the option could be set to the string:
2177: .Bd -literal -offset indent
2178: "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
2179: .Ed
2180: .Pp
2181: The terminal entry value is passed through
2182: .Xr strunvis 3
2183: before interpretation.
2184: The default value forcibly corrects the
2185: .Ql colors
2186: entry for terminals which support 256 colours:
2187: .Bd -literal -offset indent
2188: "*256col*:colors=256,xterm*:XT"
2189: .Ed
1.133 nicm 2190: .El
1.129 nicm 2191: .Pp
1.18 nicm 2192: Available session options are:
1.1 nicm 2193: .Bl -tag -width Ds
1.312 nicm 2194: .It Ic assume-paste-time Ar milliseconds
2195: If keys are entered faster than one in
2196: .Ar milliseconds ,
2197: they are assumed to have been pasted rather than typed and
2198: .Nm
2199: key bindings are not processed.
2200: The default is one millisecond and zero disables.
1.69 nicm 2201: .It Ic base-index Ar index
2202: Set the base index from which an unused index should be searched when a new
2203: window is created.
2204: The default is zero.
1.1 nicm 2205: .It Xo Ic bell-action
1.56 jmc 2206: .Op Ic any | none | current
1.1 nicm 2207: .Xc
2208: Set action on window bell.
2209: .Ic any
2210: means a bell in any window linked to a session causes a bell in the current
2211: window of that session,
2212: .Ic none
2213: means all bells are ignored and
2214: .Ic current
1.305 nicm 2215: means only bells in windows other than the current window are ignored.
1.237 nicm 2216: .It Xo Ic bell-on-alert
2217: .Op Ic on | off
2218: .Xc
1.295 nicm 2219: If on, ring the terminal bell when an alert
1.237 nicm 2220: occurs.
1.153 nicm 2221: .It Ic default-command Ar shell-command
1.1 nicm 2222: Set the command used for new windows (if not specified when the window is
2223: created) to
1.153 nicm 2224: .Ar shell-command ,
1.79 nicm 2225: which may be any
2226: .Xr sh 1
2227: command.
1.19 nicm 2228: The default is an empty string, which instructs
2229: .Nm
1.79 nicm 2230: to create a login shell using the value of the
2231: .Ic default-shell
2232: option.
2233: .It Ic default-shell Ar path
2234: Specify the default shell.
2235: This is used as the login shell for new windows when the
2236: .Ic default-command
2237: option is set to empty, and must be the full path of the executable.
2238: When started
2239: .Nm
2240: tries to set a default value from the first suitable of the
1.19 nicm 2241: .Ev SHELL
1.79 nicm 2242: environment variable, the shell returned by
2243: .Xr getpwuid 3 ,
2244: or
2245: .Pa /bin/sh .
2246: This option should be configured when
2247: .Nm
2248: is used as a login shell.
1.22 nicm 2249: .It Ic default-terminal Ar terminal
2250: Set the default terminal for new windows created in this session - the
2251: default value of the
2252: .Ev TERM
2253: environment variable.
2254: For
2255: .Nm
2256: to work correctly, this
2257: .Em must
2258: be set to
2259: .Ql screen
2260: or a derivative of it.
1.206 nicm 2261: .It Xo Ic destroy-unattached
2262: .Op Ic on | off
2263: .Xc
1.185 nicm 2264: If enabled and the session is no longer attached to any clients, it is
2265: destroyed.
1.206 nicm 2266: .It Xo Ic detach-on-destroy
2267: .Op Ic on | off
2268: .Xc
1.184 nicm 2269: If on (the default), the client is detached when the session it is attached to
2270: is destroyed.
2271: If off, the client is switched to the most recently active of the remaining
2272: sessions.
1.145 nicm 2273: .It Ic display-panes-active-colour Ar colour
2274: Set the colour used by the
2275: .Ic display-panes
2276: command to show the indicator for the active pane.
1.78 nicm 2277: .It Ic display-panes-colour Ar colour
1.145 nicm 2278: Set the colour used by the
1.78 nicm 2279: .Ic display-panes
1.145 nicm 2280: command to show the indicators for inactive panes.
1.78 nicm 2281: .It Ic display-panes-time Ar time
2282: Set the time in milliseconds for which the indicators shown by the
2283: .Ic display-panes
2284: command appear.
1.21 nicm 2285: .It Ic display-time Ar time
1.78 nicm 2286: Set the amount of time for which status line messages and other on-screen
2287: indicators are displayed.
1.21 nicm 2288: .Ar time
2289: is in milliseconds.
1.1 nicm 2290: .It Ic history-limit Ar lines
2291: Set the maximum number of lines held in window history.
2292: This setting applies only to new windows - existing window histories are not
2293: resized and retain the limit at the point they were created.
2294: .It Ic lock-after-time Ar number
1.100 nicm 2295: Lock the session (like the
2296: .Ic lock-session
1.90 nicm 2297: command) after
1.1 nicm 2298: .Ar number
1.100 nicm 2299: seconds of inactivity, or the entire server (all sessions) if the
2300: .Ic lock-server
2301: option is set.
2302: The default is not to lock (set to 0).
1.153 nicm 2303: .It Ic lock-command Ar shell-command
1.90 nicm 2304: Command to run when locking each client.
2305: The default is to run
2306: .Xr lock 1
2307: with
2308: .Fl np .
1.100 nicm 2309: .It Xo Ic lock-server
2310: .Op Ic on | off
2311: .Xc
2312: If this option is
1.102 nicm 2313: .Ic on
1.100 nicm 2314: (the default),
2315: instead of each session locking individually as each has been
2316: idle for
1.108 jmc 2317: .Ic lock-after-time ,
2318: the entire server will lock after
1.100 nicm 2319: .Em all
2320: sessions would have locked.
2321: This has no effect as a session option; it must be set as a global option.
1.378 nicm 2322: .It Ic message-command-style Ar style
2323: Set status line message command style, where
2324: .Ar style
2325: is a comma-separated list of characteristics to be specified.
2326: .Pp
2327: These may be
2328: .Ql bg=colour
2329: to set the background colour,
2330: .Ql fg=colour
2331: to set the foreground colour, and a list of attributes as specified below.
2332: .Pp
2333: The colour is one of:
1.1 nicm 2334: .Ic black ,
2335: .Ic red ,
2336: .Ic green ,
2337: .Ic yellow ,
2338: .Ic blue ,
2339: .Ic magenta ,
2340: .Ic cyan ,
1.85 nicm 2341: .Ic white ,
1.266 nicm 2342: aixterm bright variants (if supported:
2343: .Ic brightred ,
2344: .Ic brightgreen ,
2345: and so on),
1.85 nicm 2346: .Ic colour0
2347: to
2348: .Ic colour255
1.205 nicm 2349: from the 256-colour set,
2350: .Ic default ,
2351: or a hexadecimal RGB string such as
2352: .Ql #ffffff ,
2353: which chooses the closest match from the default 256-colour set.
1.378 nicm 2354: .Pp
2355: The attributes is either
2356: .Ic none
2357: or a comma-delimited list of one or more of:
2358: .Ic bright
2359: (or
2360: .Ic bold ) ,
2361: .Ic dim ,
2362: .Ic underscore ,
2363: .Ic blink ,
2364: .Ic reverse ,
2365: .Ic hidden ,
2366: or
2367: .Ic italics ,
2368: to turn an attribute on, or an attribute prefixed with
2369: .Ql no
2370: to turn one off.
2371: .Pp
2372: Examples are:
2373: .Bd -literal -offset indent
2374: fg=yellow,bold,underscore,blink
2375: bg=black,fg=default,noreverse
2376: .Ed
2377: .Pp
2378: With the
2379: .Fl a
2380: flag to the
2381: .Ic set-option
2382: command the new style is added otherwise the existing style is replaced.
2383: .It Ic message-style Ar style
2384: Set status line message style.
2385: For how to specify
2386: .Ar style ,
2387: see the
2388: .Ic message-command-style
2389: option.
1.226 nicm 2390: .It Xo Ic mouse-resize-pane
2391: .Op Ic on | off
2392: .Xc
2393: If on,
2394: .Nm
2395: captures the mouse and allows panes to be resized by dragging on their borders.
1.102 nicm 2396: .It Xo Ic mouse-select-pane
2397: .Op Ic on | off
2398: .Xc
2399: If on,
2400: .Nm
2401: captures the mouse and when a window is split into multiple panes the mouse may
2402: be used to select the current pane.
2403: The mouse click is also passed through to the application as normal.
1.222 nicm 2404: .It Xo Ic mouse-select-window
2405: .Op Ic on | off
2406: .Xc
2407: If on, clicking the mouse on a window name in the status line will select that
2408: window.
1.239 nicm 2409: .It Xo Ic mouse-utf8
2410: .Op Ic on | off
2411: .Xc
2412: If enabled, request mouse input as UTF-8 on UTF-8 terminals.
1.378 nicm 2413: .It Ic pane-active-border-style Ar style
2414: Set the pane border style for the currently active pane.
2415: For how to specify
2416: .Ar style ,
2417: see the
2418: .Ic message-command-style
2419: option.
2420: Attributes are ignored.
2421: .It Ic pane-border-style Ar style
2422: Set the pane border style for paneas aside from the active pane.
2423: For how to specify
2424: .Ar style ,
2425: see the
2426: .Ic message-command-style
2427: option.
2428: Attributes are ignored.
1.267 nicm 2429: .It Ic prefix Ar key
2430: Set the key accepted as a prefix key.
2431: .It Ic prefix2 Ar key
2432: Set a secondary key accepted as a prefix key.
1.291 nicm 2433: .It Xo Ic renumber-windows
2434: .Op Ic on | off
2435: .Xc
2436: If on, when a window is closed in a session, automatically renumber the other
2437: windows in numerical order.
2438: This respects the
2439: .Ic base-index
2440: option if it has been set.
2441: If off, do not renumber the windows.
1.21 nicm 2442: .It Ic repeat-time Ar time
1.1 nicm 2443: Allow multiple commands to be entered without pressing the prefix-key again
2444: in the specified
1.21 nicm 2445: .Ar time
1.1 nicm 2446: milliseconds (the default is 500).
2447: Whether a key repeats may be set when it is bound using the
2448: .Fl r
2449: flag to
2450: .Ic bind-key .
1.52 nicm 2451: Repeat is enabled for the default keys bound to the
2452: .Ic resize-pane
2453: command.
1.1 nicm 2454: .It Xo Ic set-remain-on-exit
1.56 jmc 2455: .Op Ic on | off
1.1 nicm 2456: .Xc
2457: Set the
2458: .Ic remain-on-exit
2459: window option for any windows first created in this session.
1.153 nicm 2460: When this option is true, windows in which the running program has
2461: exited do not close, instead remaining open but inactivate.
2462: Use the
2463: .Ic respawn-window
2464: command to reactivate such a window, or the
2465: .Ic kill-window
2466: command to destroy it.
1.1 nicm 2467: .It Xo Ic set-titles
1.56 jmc 2468: .Op Ic on | off
1.1 nicm 2469: .Xc
1.261 nicm 2470: Attempt to set the client terminal title using the
2471: .Em tsl
2472: and
2473: .Em fsl
2474: .Xr terminfo 5
2475: entries if they exist.
2476: .Nm
2477: automatically sets these to the \ee]2;...\e007 sequence if
1.1 nicm 2478: the terminal appears to be an xterm.
1.11 nicm 2479: This option is off by default.
1.6 jmc 2480: Note that elinks
1.1 nicm 2481: will only attempt to set the window title if the STY environment
2482: variable is set.
1.86 nicm 2483: .It Ic set-titles-string Ar string
2484: String used to set the window title if
2485: .Ic set-titles
2486: is on.
2487: Character sequences are replaced as for the
2488: .Ic status-left
2489: option.
1.1 nicm 2490: .It Xo Ic status
1.56 jmc 2491: .Op Ic on | off
1.1 nicm 2492: .Xc
2493: Show or hide the status line.
2494: .It Ic status-interval Ar interval
2495: Update the status bar every
2496: .Ar interval
2497: seconds.
2498: By default, updates will occur every 15 seconds.
2499: A setting of zero disables redrawing at interval.
1.41 nicm 2500: .It Xo Ic status-justify
1.56 jmc 2501: .Op Ic left | centre | right
1.41 nicm 2502: .Xc
2503: Set the position of the window list component of the status line: left, centre
2504: or right justified.
1.1 nicm 2505: .It Xo Ic status-keys
1.56 jmc 2506: .Op Ic vi | emacs
1.1 nicm 2507: .Xc
1.6 jmc 2508: Use vi or emacs-style
1.1 nicm 2509: key bindings in the status line, for example at the command prompt.
1.191 nicm 2510: The default is emacs, unless the
2511: .Ev VISUAL
2512: or
2513: .Ev EDITOR
2514: environment variables are set and contain the string
2515: .Ql vi .
1.1 nicm 2516: .It Ic status-left Ar string
2517: Display
2518: .Ar string
1.359 nicm 2519: (by default the session name) to the left of the status bar.
1.1 nicm 2520: .Ar string
2521: will be passed through
2522: .Xr strftime 3
1.359 nicm 2523: and formats (see
1.379 jmc 2524: .Sx FORMATS )
1.359 nicm 2525: will be expanded.
2526: It may also contain any of the following special character sequences:
1.1 nicm 2527: .Bl -column "Character pair" "Replaced with" -offset indent
2528: .It Sy "Character pair" Ta Sy "Replaced with"
1.153 nicm 2529: .It Li "#(shell-command)" Ta "First line of the command's output"
1.83 nicm 2530: .It Li "#[attributes]" Ta "Colour or attribute change"
1.1 nicm 2531: .It Li "##" Ta "A literal" Ql #
2532: .El
1.83 nicm 2533: .Pp
1.153 nicm 2534: The #(shell-command) form executes
2535: .Ql shell-command
2536: and inserts the first line of its output.
1.103 nicm 2537: Note that shell commands are only executed once at the interval specified by
2538: the
2539: .Ic status-interval
2540: option: if the status line is redrawn in the meantime, the previous result is
2541: used.
1.161 nicm 2542: Shell commands are executed with the
2543: .Nm
2544: global environment set (see the
1.162 jmc 2545: .Sx ENVIRONMENT
2546: section).
1.163 nicm 2547: .Pp
1.263 nicm 2548: For details on how the names and titles can be set see the
1.261 nicm 2549: .Sx "NAMES AND TITLES"
2550: section.
1.378 nicm 2551: For a list of allowed attributes see the
2552: .Ic message-command-style
2553: option.
1.109 nicm 2554: .Pp
1.83 nicm 2555: Examples are:
2556: .Bd -literal -offset indent
2557: #(sysctl vm.loadavg)
2558: #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
2559: .Ed
1.10 nicm 2560: .Pp
1.12 jmc 2561: By default, UTF-8 in
1.10 nicm 2562: .Ar string
2563: is not interpreted, to enable UTF-8, use the
2564: .Ic status-utf8
2565: option.
1.1 nicm 2566: .It Ic status-left-length Ar length
2567: Set the maximum
2568: .Ar length
2569: of the left component of the status bar.
2570: The default is 10.
1.378 nicm 2571: .It Ic status-left-style Ar style
2572: Set the style of the left part of the status line.
2573: For how to specify
2574: .Ar style ,
2575: see the
2576: .Ic message-command-style
2577: option.
1.269 nicm 2578: .It Xo Ic status-position
2579: .Op Ic top | bottom
2580: .Xc
2581: Set the position of the status line.
1.1 nicm 2582: .It Ic status-right Ar string
2583: Display
2584: .Ar string
2585: to the right of the status bar.
1.151 nicm 2586: By default, the current window title in double quotes, the date and the time
2587: are shown.
1.1 nicm 2588: As with
2589: .Ic status-left ,
2590: .Ar string
2591: will be passed to
1.10 nicm 2592: .Xr strftime 3 ,
2593: character pairs are replaced, and UTF-8 is dependent on the
2594: .Ic status-utf8
2595: option.
1.1 nicm 2596: .It Ic status-right-length Ar length
2597: Set the maximum
2598: .Ar length
2599: of the right component of the status bar.
2600: The default is 40.
1.378 nicm 2601: .It Ic status-right-style Ar style
2602: Set the style of the right part of the status line.
2603: For how to specify
2604: .Ar style ,
2605: see the
2606: .Ic message-command-style
2607: option.
2608: .It Ic status-style Ar style
2609: Set status line style.
2610: For how to specify
2611: .Ar style ,
2612: see the
2613: .Ic message-command-style
2614: option.
1.10 nicm 2615: .It Xo Ic status-utf8
1.56 jmc 2616: .Op Ic on | off
1.10 nicm 2617: .Xc
2618: Instruct
2619: .Nm
2620: to treat top-bit-set characters in the
2621: .Ic status-left
2622: and
2623: .Ic status-right
2624: strings as UTF-8; notably, this is important for wide characters.
2625: This option defaults to off.
1.63 nicm 2626: .It Ic update-environment Ar variables
2627: Set a space-separated string containing a list of environment variables to be
2628: copied into the session environment when a new session is created or an
2629: existing session is attached.
2630: Any variables that do not exist in the source environment are set to be
2631: removed from the session environment (as if
2632: .Fl r
2633: was given to the
2634: .Ic set-environment
2635: command).
2636: The default is
1.190 nicm 2637: "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID
2638: XAUTHORITY".
1.37 nicm 2639: .It Xo Ic visual-activity
1.56 jmc 2640: .Op Ic on | off
1.37 nicm 2641: .Xc
2642: If on, display a status line message when activity occurs in a window
1.39 jmc 2643: for which the
1.37 nicm 2644: .Ic monitor-activity
2645: window option is enabled.
2646: .It Xo Ic visual-bell
1.56 jmc 2647: .Op Ic on | off
1.37 nicm 2648: .Xc
2649: If this option is on, a message is shown on a bell instead of it being passed
2650: through to the terminal (which normally makes a sound).
2651: Also see the
2652: .Ic bell-action
2653: option.
1.192 nicm 2654: .It Xo Ic visual-silence
2655: .Op Ic on | off
2656: .Xc
2657: If
2658: .Ic monitor-silence
2659: is enabled, prints a message after the interval has expired on a given window.
1.255 nicm 2660: .It Ic word-separators Ar string
2661: Sets the session's conception of what characters are considered word
2662: separators, for the purposes of the next and previous word commands in
2663: copy mode.
2664: The default is
2665: .Ql \ -_@ .
1.1 nicm 2666: .El
2667: .It Xo Ic set-window-option
1.356 nicm 2668: .Op Fl agoqu
1.1 nicm 2669: .Op Fl t Ar target-window
2670: .Ar option Ar value
2671: .Xc
2672: .D1 (alias: Ic setw )
1.18 nicm 2673: Set a window option.
1.1 nicm 2674: The
1.58 nicm 2675: .Fl a ,
1.281 nicm 2676: .Fl g ,
1.356 nicm 2677: .Fl o ,
1.281 nicm 2678: .Fl q
1.1 nicm 2679: and
2680: .Fl u
2681: flags work similarly to the
2682: .Ic set-option
2683: command.
2684: .Pp
1.18 nicm 2685: Supported window options are:
1.56 jmc 2686: .Pp
2687: .Bl -tag -width Ds -compact
1.1 nicm 2688: .It Xo Ic aggressive-resize
1.56 jmc 2689: .Op Ic on | off
1.1 nicm 2690: .Xc
2691: Aggressively resize the chosen window.
2692: This means that
2693: .Nm
2694: will resize the window to the size of the smallest session for which it is the
2695: current window, rather than the smallest session to which it is attached.
2696: The window may resize when the current window is changed on another sessions;
1.6 jmc 2697: this option is good for full-screen programs which support
2698: .Dv SIGWINCH
2699: and poor for interactive programs such as shells.
1.262 nicm 2700: .Pp
2701: .It Xo Ic allow-rename
2702: .Op Ic on | off
2703: .Xc
2704: Allow programs to change the window name using a terminal escape
2705: sequence (\\033k...\\033\\\\).
2706: The default is on.
1.56 jmc 2707: .Pp
1.196 nicm 2708: .It Xo Ic alternate-screen
2709: .Op Ic on | off
2710: .Xc
2711: This option configures whether programs running inside
2712: .Nm
2713: may use the terminal alternate screen feature, which allows the
2714: .Em smcup
2715: and
2716: .Em rmcup
2717: .Xr terminfo 5
1.209 nicm 2718: capabilities.
2719: The alternate screen feature preserves the contents of the window when an
2720: interactive application starts and restores it on exit, so that any output
2721: visible before the application starts reappears unchanged after it exits.
2722: The default is on.
1.196 nicm 2723: .Pp
1.1 nicm 2724: .It Xo Ic automatic-rename
1.56 jmc 2725: .Op Ic on | off
1.1 nicm 2726: .Xc
2727: Control automatic window renaming.
2728: When this setting is enabled,
2729: .Nm
1.368 nicm 2730: will rename the window automatically using the format specified by
2731: .Ic automatic-rename-format .
1.1 nicm 2732: This flag is automatically disabled for an individual window when a name
2733: is specified at creation with
1.186 nicm 2734: .Ic new-window
2735: or
1.1 nicm 2736: .Ic new-session ,
2737: or later with
1.261 nicm 2738: .Ic rename-window ,
2739: or with a terminal escape sequence.
1.1 nicm 2740: It may be switched off globally with:
2741: .Bd -literal -offset indent
2742: set-window-option -g automatic-rename off
2743: .Ed
1.368 nicm 2744: .Pp
2745: .It Ic automatic-rename-format Ar format
2746: The format (see
2747: .Sx FORMATS )
2748: used when the
2749: .Ic automatic-rename
2750: option is enabled.
1.283 nicm 2751: .Pp
2752: .It Ic c0-change-interval Ar interval
2753: .It Ic c0-change-trigger Ar trigger
2754: These two options configure a simple form of rate limiting for a pane.
2755: If
2756: .Nm
2757: sees more than
2758: .Ar trigger
2759: C0 sequences that modify the screen (for example, carriage returns, linefeeds
2760: or backspaces) in one millisecond, it will stop updating the pane immediately and
2761: instead redraw it entirely every
2762: .Ar interval
2763: milliseconds.
2764: This helps to prevent fast output (such as
1.374 nicm 2765: .Xr yes 1 )
2766: overwhelming the terminal.
1.284 nicm 2767: The default is a trigger of 250 and an interval of 100.
1.283 nicm 2768: A trigger of zero disables the rate limiting.
1.56 jmc 2769: .Pp
1.1 nicm 2770: .It Ic clock-mode-colour Ar colour
2771: Set clock colour.
1.56 jmc 2772: .Pp
1.1 nicm 2773: .It Xo Ic clock-mode-style
1.56 jmc 2774: .Op Ic 12 | 24
1.1 nicm 2775: .Xc
2776: Set clock hour format.
1.56 jmc 2777: .Pp
1.1 nicm 2778: .It Ic force-height Ar height
2779: .It Ic force-width Ar width
2780: Prevent
2781: .Nm
2782: from resizing a window to greater than
2783: .Ar width
2784: or
2785: .Ar height .
2786: A value of zero restores the default unlimited setting.
1.56 jmc 2787: .Pp
1.196 nicm 2788: .It Ic main-pane-height Ar height
1.2 nicm 2789: .It Ic main-pane-width Ar width
2790: Set the width or height of the main (left or top) pane in the
2791: .Ic main-horizontal
2792: or
2793: .Ic main-vertical
2794: layouts.
1.56 jmc 2795: .Pp
1.1 nicm 2796: .It Xo Ic mode-keys
1.56 jmc 2797: .Op Ic vi | emacs
1.1 nicm 2798: .Xc
1.105 nicm 2799: Use vi or emacs-style key bindings in copy and choice modes.
1.191 nicm 2800: As with the
2801: .Ic status-keys
2802: option, the default is emacs, unless
2803: .Ev VISUAL
2804: or
2805: .Ev EDITOR
2806: contains
2807: .Ql vi .
1.56 jmc 2808: .Pp
1.50 nicm 2809: .It Xo Ic mode-mouse
1.240 nicm 2810: .Op Ic on | off | copy-mode
1.50 nicm 2811: .Xc
1.51 jmc 2812: Mouse state in modes.
1.223 nicm 2813: If on, the mouse may be used to enter copy mode and copy a selection by
2814: dragging, to enter copy mode and scroll with the mouse wheel, or to select an
2815: option in choice mode.
1.240 nicm 2816: If set to
1.241 jmc 2817: .Em copy-mode ,
1.240 nicm 2818: the mouse behaves as set to on, but cannot be used to enter copy
2819: mode.
1.56 jmc 2820: .Pp
1.378 nicm 2821: .It Ic mode-style Ar style
2822: Set window modes style.
2823: For how to specify
2824: .Ar style ,
2825: see the
2826: .Ic message-command-style
2827: option.
2828: .Pp
1.1 nicm 2829: .It Xo Ic monitor-activity
1.56 jmc 2830: .Op Ic on | off
1.1 nicm 2831: .Xc
2832: Monitor for activity in the window.
2833: Windows with activity are highlighted in the status line.
1.56 jmc 2834: .Pp
1.192 nicm 2835: .It Xo Ic monitor-silence
2836: .Op Ic interval
2837: .Xc
2838: Monitor for silence (no activity) in the window within
2839: .Ic interval
2840: seconds.
2841: Windows that have been silent for the interval are highlighted in the
2842: status line.
2843: An interval of zero disables the monitoring.
1.195 nicm 2844: .Pp
2845: .It Ic other-pane-height Ar height
2846: Set the height of the other panes (not the main pane) in the
2847: .Ic main-horizontal
2848: layout.
2849: If this option is set to 0 (the default), it will have no effect.
2850: If both the
2851: .Ic main-pane-height
2852: and
2853: .Ic other-pane-height
2854: options are set, the main pane will grow taller to make the other panes the
2855: specified height, but will never shrink to do so.
2856: .Pp
2857: .It Ic other-pane-width Ar width
2858: Like
2859: .Ic other-pane-height ,
2860: but set the width of other panes in the
2861: .Ic main-vertical
2862: layout.
1.243 nicm 2863: .Pp
2864: .It Ic pane-base-index Ar index
2865: Like
2866: .Ic base-index ,
2867: but set the starting index for pane numbers.
1.192 nicm 2868: .Pp
1.1 nicm 2869: .It Xo Ic remain-on-exit
1.56 jmc 2870: .Op Ic on | off
1.1 nicm 2871: .Xc
2872: A window with this flag set is not destroyed when the program running in it
2873: exits.
2874: The window may be reactivated with the
2875: .Ic respawn-window
2876: command.
1.56 jmc 2877: .Pp
1.99 nicm 2878: .It Xo Ic synchronize-panes
2879: .Op Ic on | off
2880: .Xc
1.164 nicm 2881: Duplicate input to any pane to all other panes in the same window (only
2882: for panes that are not in any special mode).
1.139 nicm 2883: .Pp
1.1 nicm 2884: .It Xo Ic utf8
1.56 jmc 2885: .Op Ic on | off
1.1 nicm 2886: .Xc
2887: Instructs
2888: .Nm
2889: to expect UTF-8 sequences to appear in this window.
1.56 jmc 2890: .Pp
1.378 nicm 2891: .It Ic window-status-activity-style Ar style
2892: Set status line style for windows with an activity alert.
2893: For how to specify
2894: .Ar style ,
2895: see the
2896: .Ic message-command-style
2897: option.
1.169 nicm 2898: .Pp
1.378 nicm 2899: .It Ic window-status-bell-style Ar style
2900: Set status line style for windows with a bell alert.
2901: For how to specify
2902: .Ar style ,
2903: see the
2904: .Ic message-command-style
2905: option.
1.169 nicm 2906: .Pp
1.125 nicm 2907: .It Ic window-status-current-format Ar string
2908: Like
2909: .Ar window-status-format ,
2910: but is the format used when the window is the current window.
1.307 nicm 2911: .Pp
1.378 nicm 2912: .It Ic window-status-current-style Ar style
2913: Set status line style for the currently active window.
2914: For how to specify
2915: .Ar style ,
2916: see the
2917: .Ic message-command-style
2918: option.
1.239 nicm 2919: .Pp
2920: .It Ic window-status-format Ar string
2921: Set the format in which the window is displayed in the status line window list.
2922: See the
2923: .Ar status-left
2924: option for details of special character sequences available.
2925: The default is
2926: .Ql #I:#W#F .
1.290 nicm 2927: .Pp
1.378 nicm 2928: .It Ic window-status-last-style Ar style
2929: Set status line style for the last active window.
2930: For how to specify
2931: .Ar style ,
2932: see the
2933: .Ic message-command-style
2934: option.
2935: .Pp
1.290 nicm 2936: .It Ic window-status-separator Ar string
2937: Sets the separator drawn between windows in the status line.
2938: The default is a single space character.
1.125 nicm 2939: .Pp
1.378 nicm 2940: .It Ic window-status-style Ar style
2941: Set status line style for a single window.
2942: For how to specify
2943: .Ar style ,
2944: see the
2945: .Ic message-command-style
2946: option.
2947: .Pp
1.1 nicm 2948: .It Xo Ic xterm-keys
1.56 jmc 2949: .Op Ic on | off
1.1 nicm 2950: .Xc
2951: If this option is set,
2952: .Nm
2953: will generate
1.57 jmc 2954: .Xr xterm 1 -style
2955: function key sequences; these have a number included to indicate modifiers such
2956: as Shift, Alt or Ctrl.
1.123 nicm 2957: The default is off.
1.282 nicm 2958: .Pp
2959: .It Xo Ic wrap-search
2960: .Op Ic on | off
2961: .Xc
2962: If this option is set, searches will wrap around the end of the pane contents.
2963: The default is on.
1.57 jmc 2964: .El
2965: .It Xo Ic show-options
1.340 nicm 2966: .Op Fl gqsvw
1.129 nicm 2967: .Op Fl t Ar target-session | Ar target-window
1.276 nicm 2968: .Op Ar option
1.57 jmc 2969: .Xc
2970: .D1 (alias: Ic show )
1.276 nicm 2971: Show the window options (or a single window option if given) with
1.129 nicm 2972: .Fl w
1.133 nicm 2973: (equivalent to
1.134 nicm 2974: .Ic show-window-options ) ,
1.133 nicm 2975: the server options with
2976: .Fl s ,
2977: otherwise the session options for
2978: .Ar target session .
2979: Global session or window options are listed if
2980: .Fl g
2981: is used.
1.317 nicm 2982: .Fl v
2983: shows only the option value, not the name.
1.340 nicm 2984: If
2985: .Fl q
2986: is set, no error will be returned if
2987: .Ar option
2988: is unset.
1.57 jmc 2989: .It Xo Ic show-window-options
1.317 nicm 2990: .Op Fl gv
1.57 jmc 2991: .Op Fl t Ar target-window
1.276 nicm 2992: .Op Ar option
1.57 jmc 2993: .Xc
2994: .D1 (alias: Ic showw )
1.276 nicm 2995: List the window options or a single option for
1.57 jmc 2996: .Ar target-window ,
2997: or the global window options if
2998: .Fl g
2999: is used.
1.317 nicm 3000: .Fl v
3001: shows only the option value, not the name.
1.63 nicm 3002: .El
1.245 nicm 3003: .Sh FORMATS
1.294 nicm 3004: Certain commands accept the
1.245 nicm 3005: .Fl F
3006: flag with a
3007: .Ar format
3008: argument.
3009: This is a string which controls the output format of the command.
3010: Replacement variables are enclosed in
3011: .Ql #{
3012: and
3013: .Ql } ,
3014: for example
1.359 nicm 3015: .Ql #{session_name} .
3016: Some variables also have an shorter alias such as
1.245 nicm 3017: .Ql #S .
1.376 nicm 3018: .Ql ##
3019: is replaced by a single
3020: .Ql # .
1.245 nicm 3021: Conditionals are also accepted by prefixing with
1.246 jmc 3022: .Ql \&?
1.245 nicm 3023: and separating two alternatives with a comma;
3024: if the specified variable exists and is not zero, the first alternative
1.246 jmc 3025: is chosen, otherwise the second is used.
3026: For example
1.245 nicm 3027: .Ql #{?session_attached,attached,not attached}
3028: will include the string
3029: .Ql attached
3030: if the session is attached and the string
3031: .Ql not attached
3032: if it is unattached.
1.367 nicm 3033: A limit may be placed on the length of the resultant string by prefixing it
3034: by an
3035: .Ql = ,
3036: a number and a colon, so
3037: .Ql #{=10:pane_title}
3038: will include at most the first 10 characters of the pane title.
1.245 nicm 3039: .Pp
3040: The following variables are available, where appropriate:
1.359 nicm 3041: .Bl -column "XXXXXXXXXXXXXXXXXXX" "XXXXX"
3042: .It Sy "Variable name" Ta Sy "Alias" Ta Sy "Replaced with"
3043: .It Li "alternate_on" Ta "" Ta "If pane is in alternate screen"
3044: .It Li "alternate_saved_x" Ta "" Ta "Saved cursor X in alternate screen"
3045: .It Li "alternate_saved_y" Ta "" Ta "Saved cursor Y in alternate screen"
1.386 nicm 3046: .It Li "buffer_sample" Ta "" Ta "Sample of start of buffer"
1.359 nicm 3047: .It Li "buffer_size" Ta "" Ta "Size of the specified buffer in bytes"
3048: .It Li "client_activity" Ta "" Ta "Integer time client last had activity"
3049: .It Li "client_activity_string" Ta "" Ta "String time client last had activity"
3050: .It Li "client_created" Ta "" Ta "Integer time client created"
3051: .It Li "client_created_string" Ta "" Ta "String time client created"
3052: .It Li "client_height" Ta "" Ta "Height of client"
3053: .It Li "client_last_session" Ta "" Ta "Name of the client's last session"
3054: .It Li "client_prefix" Ta "" Ta "1 if prefix key has been pressed"
3055: .It Li "client_readonly" Ta "" Ta "1 if client is readonly"
3056: .It Li "client_session" Ta "" Ta "Name of the client's session"
3057: .It Li "client_termname" Ta "" Ta "Terminal name of client"
3058: .It Li "client_tty" Ta "" Ta "Pseudo terminal of client"
3059: .It Li "client_utf8" Ta "" Ta "1 if client supports utf8"
3060: .It Li "client_width" Ta "" Ta "Width of client"
3061: .It Li "cursor_flag" Ta "" Ta "Pane cursor flag"
3062: .It Li "cursor_x" Ta "" Ta "Cursor X position in pane"
3063: .It Li "cursor_y" Ta "" Ta "Cursor Y position in pane"
3064: .It Li "history_bytes" Ta "" Ta "Number of bytes in window history"
3065: .It Li "history_limit" Ta "" Ta "Maximum window history lines"
3066: .It Li "history_size" Ta "" Ta "Size of history in bytes"
3067: .It Li "host" Ta "#H" Ta "Hostname of local host"
3068: .It Li "host_short" Ta "#h" Ta "Hostname of local host (no domain name)"
3069: .It Li "insert_flag" Ta "" Ta "Pane insert flag"
3070: .It Li "keypad_cursor_flag" Ta "" Ta "Pane keypad cursor flag"
3071: .It Li "keypad_flag" Ta "" Ta "Pane keypad flag"
3072: .It Li "line" Ta "" Ta "Line number in the list"
3073: .It Li "mouse_any_flag" Ta "" Ta "Pane mouse any flag"
3074: .It Li "mouse_button_flag" Ta "" Ta "Pane mouse button flag"
3075: .It Li "mouse_standard_flag" Ta "" Ta "Pane mouse standard flag"
3076: .It Li "mouse_utf8_flag" Ta "" Ta "Pane mouse UTF-8 flag"
3077: .It Li "pane_active" Ta "" Ta "1 if active pane"
1.396 ! nicm 3078: .It Li "pane_bottom" Ta "" Ta "Bottom of pane"
1.359 nicm 3079: .It Li "pane_current_command" Ta "" Ta "Current command if available"
3080: .It Li "pane_dead" Ta "" Ta "1 if pane is dead"
3081: .It Li "pane_height" Ta "" Ta "Height of pane"
3082: .It Li "pane_id" Ta "#D" Ta "Unique pane ID"
3083: .It Li "pane_in_mode" Ta "" Ta "If pane is in a mode"
3084: .It Li "pane_index" Ta "#P" Ta "Index of pane"
1.396 ! nicm 3085: .It Li "pane_left" Ta "" Ta "Left of pane"
1.359 nicm 3086: .It Li "pane_pid" Ta "" Ta "PID of first process in pane"
1.396 ! nicm 3087: .It Li "pane_right" Ta "" Ta "Right of pane"
1.359 nicm 3088: .It Li "pane_start_command" Ta "" Ta "Command pane started with"
1.396 ! nicm 3089: .It Li "pane_synchronized" Ta "" Ta "If pane is synchronized"
1.359 nicm 3090: .It Li "pane_tabs" Ta "" Ta "Pane tab positions"
3091: .It Li "pane_title" Ta "#T" Ta "Title of pane"
1.396 ! nicm 3092: .It Li "pane_top" Ta "" Ta "Top of pane"
1.359 nicm 3093: .It Li "pane_tty" Ta "" Ta "Pseudo terminal of pane"
3094: .It Li "pane_width" Ta "" Ta "Width of pane"
3095: .It Li "saved_cursor_x" Ta "" Ta "Saved cursor X in pane"
3096: .It Li "saved_cursor_y" Ta "" Ta "Saved cursor Y in pane"
3097: .It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane"
3098: .It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane"
1.382 nicm 3099: .It Li "session_attached" Ta "" Ta "Number of clients session is attached to"
1.359 nicm 3100: .It Li "session_created" Ta "" Ta "Integer time session created"
3101: .It Li "session_created_string" Ta "" Ta "String time session created"
3102: .It Li "session_group" Ta "" Ta "Number of session group"
3103: .It Li "session_grouped" Ta "" Ta "1 if session in a group"
3104: .It Li "session_height" Ta "" Ta "Height of session"
3105: .It Li "session_id" Ta "" Ta "Unique session ID"
1.382 nicm 3106: .It Li "session_many_attached" Ta "" Ta "1 if multiple clients attached"
1.359 nicm 3107: .It Li "session_name" Ta "#S" Ta "Name of session"
3108: .It Li "session_width" Ta "" Ta "Width of session"
3109: .It Li "session_windows" Ta "" Ta "Number of windows in session"
3110: .It Li "window_active" Ta "" Ta "1 if window active"
1.366 nicm 3111: .It Li "window_activity_flag" Ta "" Ta "1 if window has activity alert"
3112: .It Li "window_bell_flag" Ta "" Ta "1 if window has bell"
1.359 nicm 3113: .It Li "window_find_matches" Ta "" Ta "Matched data from the find-window"
3114: .It Li "window_flags" Ta "#F" Ta "Window flags"
3115: .It Li "window_height" Ta "" Ta "Height of window"
3116: .It Li "window_id" Ta "" Ta "Unique window ID"
3117: .It Li "window_index" Ta "#I" Ta "Index of window"
3118: .It Li "window_layout" Ta "" Ta "Window layout description"
3119: .It Li "window_name" Ta "#W" Ta "Name of window"
3120: .It Li "window_panes" Ta "" Ta "Number of panes in window"
1.366 nicm 3121: .It Li "window_silence_flag" Ta "" Ta "1 if window has silence alert"
1.359 nicm 3122: .It Li "window_width" Ta "" Ta "Width of window"
3123: .It Li "wrap_flag" Ta "" Ta "Pane wrap flag"
1.245 nicm 3124: .El
1.261 nicm 3125: .Sh NAMES AND TITLES
3126: .Nm
3127: distinguishes between names and titles.
3128: Windows and sessions have names, which may be used to specify them in targets
3129: and are displayed in the status line and various lists: the name is the
3130: .Nm
3131: identifier for a window or session.
3132: Only panes have titles.
3133: A pane's title is typically set by the program running inside the pane and
3134: is not modified by
3135: .Nm .
3136: It is the same mechanism used to set for example the
3137: .Xr xterm 1
3138: window title in an
3139: .Xr X 7
3140: window manager.
1.268 nicm 3141: Windows themselves do not have titles - a window's title is the title of its
1.261 nicm 3142: active pane.
3143: .Nm
3144: itself may set the title of the terminal in which the client is running, see
3145: the
3146: .Ic set-titles
3147: option.
3148: .Pp
3149: A session's name is set with the
3150: .Ic new-session
3151: and
3152: .Ic rename-session
3153: commands.
3154: A window's name is set with one of:
3155: .Bl -enum -width Ds
3156: .It
3157: A command argument (such as
3158: .Fl n
3159: for
3160: .Ic new-window
3161: or
3162: .Ic new-session ) .
3163: .It
3164: An escape sequence:
3165: .Bd -literal -offset indent
3166: $ printf '\e033kWINDOW_NAME\e033\e\e'
3167: .Ed
3168: .It
3169: Automatic renaming, which sets the name to the active command in the window's
3170: active pane.
3171: See the
3172: .Ic automatic-rename
3173: option.
3174: .El
3175: .Pp
3176: When a pane is first created, its title is the hostname.
3177: A pane's title can be set via the OSC title setting sequence, for example:
3178: .Bd -literal -offset indent
3179: $ printf '\e033]2;My Title\e033\e\e'
3180: .Ed
1.63 nicm 3181: .Sh ENVIRONMENT
3182: When the server is started,
3183: .Nm
3184: copies the environment into the
3185: .Em global environment ;
3186: in addition, each session has a
3187: .Em session environment .
1.193 nicm 3188: When a window is created, the session and global environments are merged.
3189: If a variable exists in both, the value from the session environment is used.
3190: The result is the initial environment passed to the new process.
1.63 nicm 3191: .Pp
3192: The
3193: .Ic update-environment
3194: session option may be used to update the session environment from the client
3195: when a new session is created or an old reattached.
3196: .Nm
3197: also initialises the
3198: .Ev TMUX
3199: variable with some internal information to allow commands to be executed
3200: from inside, and the
3201: .Ev TERM
3202: variable with the correct terminal setting of
3203: .Ql screen .
3204: .Pp
3205: Commands to alter and view the environment are:
3206: .Bl -tag -width Ds
3207: .It Xo Ic set-environment
3208: .Op Fl gru
3209: .Op Fl t Ar target-session
3210: .Ar name Op Ar value
3211: .Xc
1.115 nicm 3212: .D1 (alias: Ic setenv )
1.63 nicm 3213: Set or unset an environment variable.
3214: If
3215: .Fl g
3216: is used, the change is made in the global environment; otherwise, it is applied
3217: to the session environment for
3218: .Ar target-session .
3219: The
3220: .Fl u
3221: flag unsets a variable.
3222: .Fl r
3223: indicates the variable is to be removed from the environment before starting a
3224: new process.
3225: .It Xo Ic show-environment
3226: .Op Fl g
3227: .Op Fl t Ar target-session
1.286 nicm 3228: .Op Ar variable
1.63 nicm 3229: .Xc
1.115 nicm 3230: .D1 (alias: Ic showenv )
1.63 nicm 3231: Display the environment for
3232: .Ar target-session
3233: or the global environment with
3234: .Fl g .
1.286 nicm 3235: If
3236: .Ar variable
3237: is omitted, all variables are shown.
1.63 nicm 3238: Variables removed from the environment are prefixed with
3239: .Ql - .
1.57 jmc 3240: .El
3241: .Sh STATUS LINE
3242: .Nm
3243: includes an optional status line which is displayed in the bottom line of each
3244: terminal.
3245: By default, the status line is enabled (it may be disabled with the
3246: .Ic status
3247: session option) and contains, from left-to-right: the name of the current
1.261 nicm 3248: session in square brackets; the window list; the title of the active pane
3249: in double quotes; and the time and date.
1.57 jmc 3250: .Pp
3251: The status line is made of three parts: configurable left and right sections
3252: (which may contain dynamic content such as the time or output from a shell
3253: command, see the
3254: .Ic status-left ,
3255: .Ic status-left-length ,
3256: .Ic status-right ,
3257: and
3258: .Ic status-right-length
3259: options below), and a central window list.
1.125 nicm 3260: By default, the window list shows the index, name and (if any) flag of the
3261: windows present in the current session in ascending numerical order.
3262: It may be customised with the
3263: .Ar window-status-format
3264: and
3265: .Ar window-status-current-format
3266: options.
1.57 jmc 3267: The flag is one of the following symbols appended to the window name:
3268: .Bl -column "Symbol" "Meaning" -offset indent
3269: .It Sy "Symbol" Ta Sy "Meaning"
3270: .It Li "*" Ta "Denotes the current window."
3271: .It Li "-" Ta "Marks the last window (previously selected)."
3272: .It Li "#" Ta "Window is monitored and activity has been detected."
3273: .It Li "!" Ta "A bell has occurred in the window."
1.192 nicm 3274: .It Li "~" Ta "The window has been silent for the monitor-silence interval."
1.349 nicm 3275: .It Li "Z" Ta "The window's active pane is zoomed."
1.57 jmc 3276: .El
3277: .Pp
3278: The # symbol relates to the
3279: .Ic monitor-activity
1.388 nicm 3280: window option.
1.57 jmc 3281: The window name is printed in inverted colours if an alert (bell, activity or
1.388 nicm 3282: silence) is present.
1.57 jmc 3283: .Pp
1.131 nicm 3284: The colour and attributes of the status line may be configured, the entire
3285: status line using the
1.378 nicm 3286: .Ic status-style
3287: session option and individual windows using the
3288: .Ic window-status-style
3289: window option.
1.57 jmc 3290: .Pp
1.131 nicm 3291: The status line is automatically refreshed at interval if it has changed, the
3292: interval may be controlled with the
1.57 jmc 3293: .Ic status-interval
3294: session option.
3295: .Pp
3296: Commands related to the status line are as follows:
3297: .Bl -tag -width Ds
3298: .It Xo Ic command-prompt
1.235 nicm 3299: .Op Fl I Ar inputs
1.73 nicm 3300: .Op Fl p Ar prompts
1.57 jmc 3301: .Op Fl t Ar target-client
3302: .Op Ar template
3303: .Xc
3304: Open the command prompt in a client.
3305: This may be used from inside
3306: .Nm
3307: to execute commands interactively.
1.231 nicm 3308: .Pp
1.57 jmc 3309: If
3310: .Ar template
1.73 nicm 3311: is specified, it is used as the command.
1.235 nicm 3312: If present,
3313: .Fl I
3314: is a comma-separated list of the initial text for each prompt.
1.73 nicm 3315: If
3316: .Fl p
3317: is given,
3318: .Ar prompts
3319: is a comma-separated list of prompts which are displayed in order; otherwise
3320: a single prompt is displayed, constructed from
3321: .Ar template
3322: if it is present, or
3323: .Ql \&:
3324: if not.
1.235 nicm 3325: .Pp
3326: Both
3327: .Ar inputs
3328: and
1.231 nicm 3329: .Ar prompts
3330: may contain the special character sequences supported by the
3331: .Ic status-left
3332: option.
3333: .Pp
1.73 nicm 3334: Before the command is executed, the first occurrence of the string
3335: .Ql %%
1.74 jmc 3336: and all occurrences of
1.73 nicm 3337: .Ql %1
3338: are replaced by the response to the first prompt, the second
3339: .Ql %%
3340: and all
3341: .Ql %2
3342: are replaced with the response to the second prompt, and so on for further
1.74 jmc 3343: prompts.
3344: Up to nine prompt responses may be replaced
3345: .Po
3346: .Ql %1
1.73 nicm 3347: to
1.74 jmc 3348: .Ql %9
3349: .Pc .
1.57 jmc 3350: .It Xo Ic confirm-before
1.238 nicm 3351: .Op Fl p Ar prompt
1.57 jmc 3352: .Op Fl t Ar target-client
3353: .Ar command
3354: .Xc
3355: .D1 (alias: Ic confirm )
3356: Ask for confirmation before executing
3357: .Ar command .
1.238 nicm 3358: If
3359: .Fl p
3360: is given,
3361: .Ar prompt
3362: is the prompt to display; otherwise a prompt is constructed from
3363: .Ar command .
3364: It may contain the special character sequences supported by the
3365: .Ic status-left
3366: option.
3367: .Pp
1.57 jmc 3368: This command works only from inside
3369: .Nm .
3370: .It Xo Ic display-message
1.127 nicm 3371: .Op Fl p
1.215 nicm 3372: .Op Fl c Ar target-client
3373: .Op Fl t Ar target-pane
1.57 jmc 3374: .Op Ar message
3375: .Xc
3376: .D1 (alias: Ic display )
1.127 nicm 3377: Display a message.
3378: If
3379: .Fl p
3380: is given, the output is printed to stdout, otherwise it is displayed in the
3381: .Ar target-client
3382: status line.
1.122 nicm 3383: The format of
1.124 jmc 3384: .Ar message
1.275 nicm 3385: is described in the
3386: .Sx FORMATS
3387: section; information is taken from
1.215 nicm 3388: .Ar target-pane
3389: if
3390: .Fl t
3391: is given, otherwise the active pane for the session attached to
3392: .Ar target-client .
1.57 jmc 3393: .El
3394: .Sh BUFFERS
3395: .Nm
1.392 nicm 3396: maintains a set of named
1.199 nicm 3397: .Em paste buffers .
1.392 nicm 3398: Each buffer may be either explicitly or automatically named.
3399: Explicitly named buffers are named when created with the
3400: .Ic set-buffer
3401: or
3402: .Ic load-buffer
3403: commands, or by renaming an automatically named buffer with
3404: .Ic set-buffer
3405: .Fl n .
3406: Automatically named buffers are given a name such as
3407: .Ql buffer0001 ,
3408: .Ql buffer0002
3409: and so on.
3410: When the
3411: .Ic buffer-limit
3412: option is reached, the oldest automatically named buffer is deleted.
3413: Explicitly named are not subject to
1.57 jmc 3414: .Ic buffer-limit
1.392 nicm 3415: and may be deleted with
3416: .Ic delete-buffer
3417: command.
3418: .Pp
1.57 jmc 3419: Buffers may be added using
3420: .Ic copy-mode
3421: or the
3422: .Ic set-buffer
1.392 nicm 3423: and
3424: .Ic load-buffer
3425: commands, and pasted into a window using the
1.57 jmc 3426: .Ic paste-buffer
3427: command.
1.392 nicm 3428: If a buffer command is used and no buffer is specified, the most
3429: recently added automatically named buffer is assumed.
1.57 jmc 3430: .Pp
3431: A configurable history buffer is also maintained for each window.
3432: By default, up to 2000 lines are kept; this can be altered with the
3433: .Ic history-limit
3434: option (see the
3435: .Ic set-option
3436: command above).
3437: .Pp
3438: The buffer commands are as follows:
3439: .Bl -tag -width Ds
1.178 nicm 3440: .It Xo
3441: .Ic choose-buffer
1.294 nicm 3442: .Op Fl F Ar format
1.178 nicm 3443: .Op Fl t Ar target-window
3444: .Op Ar template
3445: .Xc
3446: Put a window into buffer choice mode, where a buffer may be chosen
3447: interactively from a list.
3448: After a buffer is selected,
3449: .Ql %%
1.392 nicm 3450: is replaced by the buffer name in
1.178 nicm 3451: .Ar template
3452: and the result executed as a command.
3453: If
3454: .Ar template
3455: is not given, "paste-buffer -b '%%'" is used.
1.294 nicm 3456: For the meaning of the
3457: .Fl F
3458: flag, see the
3459: .Sx FORMATS
3460: section.
1.314 nicm 3461: This command works only if at least one client is attached.
1.57 jmc 3462: .It Ic clear-history Op Fl t Ar target-pane
3463: .D1 (alias: Ic clearhist )
3464: Remove and free the history for the specified pane.
1.392 nicm 3465: .It Ic delete-buffer Op Fl b Ar buffer-name
1.57 jmc 3466: .D1 (alias: Ic deleteb )
1.392 nicm 3467: Delete the buffer named
3468: .Ar buffer-name ,
3469: or the most recently added automatically named buffer if not specified.
1.294 nicm 3470: .It Xo Ic list-buffers
3471: .Op Fl F Ar format
3472: .Xc
1.57 jmc 3473: .D1 (alias: Ic lsb )
1.198 nicm 3474: List the global buffers.
1.294 nicm 3475: For the meaning of the
3476: .Fl F
3477: flag, see the
3478: .Sx FORMATS
3479: section.
1.200 jmc 3480: .It Xo Ic load-buffer
1.392 nicm 3481: .Op Fl b Ar buffer-name
1.57 jmc 3482: .Ar path
3483: .Xc
3484: .D1 (alias: Ic loadb )
3485: Load the contents of the specified paste buffer from
3486: .Ar path .
3487: .It Xo Ic paste-buffer
1.278 nicm 3488: .Op Fl dpr
1.392 nicm 3489: .Op Fl b Ar buffer-name
1.170 nicm 3490: .Op Fl s Ar separator
1.158 nicm 3491: .Op Fl t Ar target-pane
1.57 jmc 3492: .Xc
3493: .D1 (alias: Ic pasteb )
1.158 nicm 3494: Insert the contents of a paste buffer into the specified pane.
3495: If not specified, paste into the current one.
1.57 jmc 3496: With
3497: .Fl d ,
1.392 nicm 3498: also delete the paste buffer.
1.57 jmc 3499: When output, any linefeed (LF) characters in the paste buffer are replaced with
1.170 nicm 3500: a separator, by default carriage return (CR).
3501: A custom separator may be specified using the
3502: .Fl s
3503: flag.
3504: The
1.57 jmc 3505: .Fl r
1.170 nicm 3506: flag means to do no replacement (equivalent to a separator of LF).
1.278 nicm 3507: If
3508: .Fl p
3509: is specified, paste bracket control codes are inserted around the
3510: buffer if the application has requested bracketed paste mode.
1.57 jmc 3511: .It Xo Ic save-buffer
3512: .Op Fl a
1.392 nicm 3513: .Op Fl b Ar buffer-name
1.57 jmc 3514: .Ar path
3515: .Xc
3516: .D1 (alias: Ic saveb )
3517: Save the contents of the specified paste buffer to
3518: .Ar path .
3519: The
3520: .Fl a
3521: option appends to rather than overwriting the file.
3522: .It Xo Ic set-buffer
1.383 nicm 3523: .Op Fl a
1.392 nicm 3524: .Op Fl b Ar buffer-name
3525: .Op Fl n Ar new-buffer-name
1.57 jmc 3526: .Ar data
3527: .Xc
3528: .D1 (alias: Ic setb )
3529: Set the contents of the specified buffer to
3530: .Ar data .
1.383 nicm 3531: The
3532: .Fl a
3533: option appends to rather than overwriting the buffer.
1.392 nicm 3534: The
3535: .Fl n
3536: option renames the buffer to
3537: .Ar new-buffer-name .
1.1 nicm 3538: .It Xo Ic show-buffer
1.392 nicm 3539: .Op Fl b Ar buffer-name
1.1 nicm 3540: .Xc
3541: .D1 (alias: Ic showb )
3542: Display the contents of the specified buffer.
1.57 jmc 3543: .El
3544: .Sh MISCELLANEOUS
3545: Miscellaneous commands are as follows:
3546: .Bl -tag -width Ds
1.72 nicm 3547: .It Ic clock-mode Op Fl t Ar target-pane
1.57 jmc 3548: Display a large clock.
1.334 nicm 3549: .It Xo Ic if-shell
1.352 nicm 3550: .Op Fl b
1.334 nicm 3551: .Op Fl t Ar target-pane
3552: .Ar shell-command command
3553: .Op Ar command
3554: .Xc
1.57 jmc 3555: .D1 (alias: Ic if )
1.251 nicm 3556: Execute the first
1.57 jmc 3557: .Ar command
3558: if
3559: .Ar shell-command
1.251 nicm 3560: returns success or the second
3561: .Ar command
3562: otherwise.
1.334 nicm 3563: Before being executed, shell-command is expanded using the rules specified in the
3564: .Sx FORMATS
3565: section, including those relevant to
3566: .Ar target-pane .
1.335 nicm 3567: With
3568: .Fl b ,
3569: .Ar shell-command
3570: is run in the background.
1.57 jmc 3571: .It Ic lock-server
3572: .D1 (alias: Ic lock )
1.90 nicm 3573: Lock each client individually by running the command specified by the
3574: .Ic lock-command
3575: option.
1.308 nicm 3576: .It Xo Ic run-shell
1.357 nicm 3577: .Op Fl b
1.308 nicm 3578: .Op Fl t Ar target-pane
3579: .Ar shell-command
3580: .Xc
1.87 nicm 3581: .D1 (alias: Ic run )
3582: Execute
1.153 nicm 3583: .Ar shell-command
1.106 nicm 3584: in the background without creating a window.
1.334 nicm 3585: Before being executed, shell-command is expanded using the rules specified in
3586: the
3587: .Sx FORMATS
3588: section.
1.335 nicm 3589: With
3590: .Fl b ,
3591: the command is run in the background.
1.308 nicm 3592: After it finishes, any output to stdout is displayed in copy mode (in the pane
3593: specified by
3594: .Fl t
3595: or the current pane if omitted).
1.153 nicm 3596: If the command doesn't return success, the exit status is also displayed.
1.342 nicm 3597: .It Xo Ic wait-for
1.370 nicm 3598: .Op Fl L | S | U
1.342 nicm 3599: .Ar channel
3600: .Xc
3601: .D1 (alias: Ic wait )
1.343 nicm 3602: When used without options, prevents the client from exiting until woken using
1.342 nicm 3603: .Ic wait-for
3604: .Fl S
3605: with the same channel.
1.343 nicm 3606: When
3607: .Fl L
3608: is used, the channel is locked and any clients that try to lock the same
3609: channel are made to wait until the channel is unlocked with
3610: .Ic wait-for
3611: .Fl U .
1.342 nicm 3612: This command only works from outside
3613: .Nm .
1.228 nicm 3614: .El
3615: .Sh TERMINFO EXTENSIONS
3616: .Nm
3617: understands some extensions to
3618: .Xr terminfo 5 :
3619: .Bl -tag -width Ds
1.360 nicm 3620: .It Em Cs , Cr
1.233 nicm 3621: Set the cursor colour.
1.232 jmc 3622: The first takes a single string argument and is used to set the colour;
3623: the second takes no arguments and restores the default cursor colour.
3624: If set, a sequence such as this may be used
3625: to change the cursor colour from inside
3626: .Nm :
3627: .Bd -literal -offset indent
3628: $ printf '\e033]12;red\e033\e\e'
3629: .Ed
1.361 jmc 3630: .It Em \&Ss , Se
1.230 nicm 3631: Change the cursor style.
1.232 jmc 3632: If set, a sequence such as this may be used
3633: to change the cursor to an underline:
1.230 nicm 3634: .Bd -literal -offset indent
3635: $ printf '\e033[4 q'
3636: .Ed
3637: .Pp
3638: If
3639: .Em Csr
3640: is set, it will be used to reset the cursor style instead
3641: of
3642: .Em Cs .
1.232 jmc 3643: .It Em \&Ms
3644: This sequence can be used by
3645: .Nm
3646: to store the current buffer in the host terminal's selection (clipboard).
3647: See the
3648: .Em set-clipboard
3649: option above and the
3650: .Xr xterm 1
3651: man page.
1.345 nicm 3652: .El
3653: .Sh CONTROL MODE
3654: .Nm
3655: offers a textual interface called
3656: .Em control mode .
3657: This allows applications to communicate with
3658: .Nm
3659: using a simple text-only protocol.
3660: .Pp
3661: In control mode, a client sends
3662: .Nm
3663: commands or command sequences terminated by newlines on standard input.
3664: Each command will produce one block of output on standard output.
3665: An output block consists of a
3666: .Em %begin
3667: line followed by the output (which may be empty).
3668: The output block ends with a
3669: .Em %end
3670: or
3671: .Em %error .
3672: .Em %begin
3673: and matching
3674: .Em %end
3675: or
3676: .Em %error
3677: have two arguments: an integer time (as seconds from epoch) and command number.
3678: For example:
3679: .Bd -literal -offset indent
3680: %begin 1363006971 2
3681: 0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active)
3682: %end 1363006971 2
3683: .Ed
3684: .Pp
3685: In control mode,
3686: .Nm
3687: outputs notifications.
3688: A notification will never occur inside an output block.
3689: .Pp
3690: The following notifications are defined:
3691: .Bl -tag -width Ds
3692: .It Ic %exit Op Ar reason
3693: The
3694: .Nm
3695: client is exiting immediately, either because it is not attached to any session
3696: or an error occurred.
3697: If present,
3698: .Ar reason
3699: describes why the client exited.
3700: .It Ic %layout-change Ar window-id Ar window-layout
3701: The layout of a window with ID
3702: .Ar window-id
3703: changed.
3704: The new layout is
3705: .Ar window-layout .
1.347 nicm 3706: .It Ic %output Ar pane-id Ar value
3707: A window pane produced output.
1.345 nicm 3708: .Ar value
1.350 nicm 3709: escapes non-printable characters and backslash as octal \\xxx.
1.345 nicm 3710: .It Ic %session-changed Ar session-id Ar name
3711: The client is now attached to the session with ID
3712: .Ar session-id ,
3713: which is named
3714: .Ar name .
3715: .It Ic %session-renamed Ar name
3716: The current session was renamed to
3717: .Ar name .
3718: .It Ic %sessions-changed
3719: A session was created or destroyed.
3720: .It Ic %unlinked-window-add Ar window-id
3721: The window with ID
3722: .Ar window-id
3723: was created but is not linked to the current session.
3724: .It Ic %window-add Ar window-id
3725: The window with ID
3726: .Ar window-id
3727: was linked to the current session.
3728: .It Ic %window-close Ar window-id
3729: The window with ID
3730: .Ar window-id
3731: closed.
3732: .It Ic %window-renamed Ar window-id Ar name
3733: The window with ID
3734: .Ar window-id
3735: was renamed to
3736: .Ar name .
1.1 nicm 3737: .El
3738: .Sh FILES
1.26 nicm 3739: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1 nicm 3740: .It Pa ~/.tmux.conf
1.6 jmc 3741: Default
1.1 nicm 3742: .Nm
1.6 jmc 3743: configuration file.
1.26 nicm 3744: .It Pa /etc/tmux.conf
3745: System-wide configuration file.
1.1 nicm 3746: .El
1.57 jmc 3747: .Sh EXAMPLES
3748: To create a new
3749: .Nm
3750: session running
3751: .Xr vi 1 :
3752: .Pp
3753: .Dl $ tmux new-session vi
3754: .Pp
3755: Most commands have a shorter form, known as an alias.
3756: For new-session, this is
3757: .Ic new :
3758: .Pp
3759: .Dl $ tmux new vi
3760: .Pp
3761: Alternatively, the shortest unambiguous form of a command is accepted.
3762: If there are several options, they are listed:
3763: .Bd -literal -offset indent
3764: $ tmux n
3765: ambiguous command: n, could be: new-session, new-window, next-window
3766: .Ed
3767: .Pp
3768: Within an active session, a new window may be created by typing
3769: .Ql C-b c
3770: (Ctrl
3771: followed by the
3772: .Ql b
3773: key
3774: followed by the
3775: .Ql c
3776: key).
3777: .Pp
3778: Windows may be navigated with:
3779: .Ql C-b 0
3780: (to select window 0),
3781: .Ql C-b 1
3782: (to select window 1), and so on;
3783: .Ql C-b n
3784: to select the next window; and
3785: .Ql C-b p
3786: to select the previous window.
3787: .Pp
3788: A session may be detached using
3789: .Ql C-b d
1.64 nicm 3790: (or by an external event such as
3791: .Xr ssh 1
3792: disconnection) and reattached with:
1.57 jmc 3793: .Pp
3794: .Dl $ tmux attach-session
3795: .Pp
3796: Typing
3797: .Ql C-b \&?
3798: lists the current key bindings in the current window; up and down may be used
3799: to navigate the list or
3800: .Ql q
3801: to exit from it.
3802: .Pp
3803: Commands to be run when the
3804: .Nm
3805: server is started may be placed in the
3806: .Pa ~/.tmux.conf
3807: configuration file.
3808: Common examples include:
3809: .Pp
3810: Changing the default prefix key:
3811: .Bd -literal -offset indent
3812: set-option -g prefix C-a
3813: unbind-key C-b
3814: bind-key C-a send-prefix
3815: .Ed
3816: .Pp
3817: Turning the status line off, or changing its colour:
3818: .Bd -literal -offset indent
3819: set-option -g status off
1.378 nicm 3820: set-option -g status-style bg=blue
1.57 jmc 3821: .Ed
3822: .Pp
3823: Setting other options, such as the default command,
3824: or locking after 30 minutes of inactivity:
3825: .Bd -literal -offset indent
3826: set-option -g default-command "exec /bin/ksh"
3827: set-option -g lock-after-time 1800
3828: .Ed
3829: .Pp
3830: Creating new key bindings:
3831: .Bd -literal -offset indent
3832: bind-key b set-option status
3833: bind-key / command-prompt "split-window 'exec man %%'"
1.73 nicm 3834: bind-key S command-prompt "new-window -n %1 'ssh %1'"
1.57 jmc 3835: .Ed
1.1 nicm 3836: .Sh SEE ALSO
3837: .Xr pty 4
3838: .Sh AUTHORS
1.364 schwarze 3839: .An Nicholas Marriott Aq Mt nicm@users.sourceforge.net