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