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