Annotation of src/usr.bin/tmux/tmux.1, Revision 1.387
1.387 ! nicm 1: .\" $OpenBSD: tmux.1,v 1.386 2014/04/02 18:12:18 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.386 nicm 17: .Dd $Mdocdate: April 2 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.
2647: .It Xo Ic visual-content
1.56 jmc 2648: .Op Ic on | off
1.37 nicm 2649: .Xc
2650: Like
2651: .Ic visual-activity ,
2652: display a message when content is present in a window
1.39 jmc 2653: for which the
1.37 nicm 2654: .Ic monitor-content
2655: window option is enabled.
1.192 nicm 2656: .It Xo Ic visual-silence
2657: .Op Ic on | off
2658: .Xc
2659: If
2660: .Ic monitor-silence
2661: is enabled, prints a message after the interval has expired on a given window.
1.255 nicm 2662: .It Ic word-separators Ar string
2663: Sets the session's conception of what characters are considered word
2664: separators, for the purposes of the next and previous word commands in
2665: copy mode.
2666: The default is
2667: .Ql \ -_@ .
1.1 nicm 2668: .El
2669: .It Xo Ic set-window-option
1.356 nicm 2670: .Op Fl agoqu
1.1 nicm 2671: .Op Fl t Ar target-window
2672: .Ar option Ar value
2673: .Xc
2674: .D1 (alias: Ic setw )
1.18 nicm 2675: Set a window option.
1.1 nicm 2676: The
1.58 nicm 2677: .Fl a ,
1.281 nicm 2678: .Fl g ,
1.356 nicm 2679: .Fl o ,
1.281 nicm 2680: .Fl q
1.1 nicm 2681: and
2682: .Fl u
2683: flags work similarly to the
2684: .Ic set-option
2685: command.
2686: .Pp
1.18 nicm 2687: Supported window options are:
1.56 jmc 2688: .Pp
2689: .Bl -tag -width Ds -compact
1.1 nicm 2690: .It Xo Ic aggressive-resize
1.56 jmc 2691: .Op Ic on | off
1.1 nicm 2692: .Xc
2693: Aggressively resize the chosen window.
2694: This means that
2695: .Nm
2696: will resize the window to the size of the smallest session for which it is the
2697: current window, rather than the smallest session to which it is attached.
2698: The window may resize when the current window is changed on another sessions;
1.6 jmc 2699: this option is good for full-screen programs which support
2700: .Dv SIGWINCH
2701: and poor for interactive programs such as shells.
1.262 nicm 2702: .Pp
2703: .It Xo Ic allow-rename
2704: .Op Ic on | off
2705: .Xc
2706: Allow programs to change the window name using a terminal escape
2707: sequence (\\033k...\\033\\\\).
2708: The default is on.
1.56 jmc 2709: .Pp
1.196 nicm 2710: .It Xo Ic alternate-screen
2711: .Op Ic on | off
2712: .Xc
2713: This option configures whether programs running inside
2714: .Nm
2715: may use the terminal alternate screen feature, which allows the
2716: .Em smcup
2717: and
2718: .Em rmcup
2719: .Xr terminfo 5
1.209 nicm 2720: capabilities.
2721: The alternate screen feature preserves the contents of the window when an
2722: interactive application starts and restores it on exit, so that any output
2723: visible before the application starts reappears unchanged after it exits.
2724: The default is on.
1.196 nicm 2725: .Pp
1.1 nicm 2726: .It Xo Ic automatic-rename
1.56 jmc 2727: .Op Ic on | off
1.1 nicm 2728: .Xc
2729: Control automatic window renaming.
2730: When this setting is enabled,
2731: .Nm
1.368 nicm 2732: will rename the window automatically using the format specified by
2733: .Ic automatic-rename-format .
1.1 nicm 2734: This flag is automatically disabled for an individual window when a name
2735: is specified at creation with
1.186 nicm 2736: .Ic new-window
2737: or
1.1 nicm 2738: .Ic new-session ,
2739: or later with
1.261 nicm 2740: .Ic rename-window ,
2741: or with a terminal escape sequence.
1.1 nicm 2742: It may be switched off globally with:
2743: .Bd -literal -offset indent
2744: set-window-option -g automatic-rename off
2745: .Ed
1.368 nicm 2746: .Pp
2747: .It Ic automatic-rename-format Ar format
2748: The format (see
2749: .Sx FORMATS )
2750: used when the
2751: .Ic automatic-rename
2752: option is enabled.
1.283 nicm 2753: .Pp
2754: .It Ic c0-change-interval Ar interval
2755: .It Ic c0-change-trigger Ar trigger
2756: These two options configure a simple form of rate limiting for a pane.
2757: If
2758: .Nm
2759: sees more than
2760: .Ar trigger
2761: C0 sequences that modify the screen (for example, carriage returns, linefeeds
2762: or backspaces) in one millisecond, it will stop updating the pane immediately and
2763: instead redraw it entirely every
2764: .Ar interval
2765: milliseconds.
2766: This helps to prevent fast output (such as
1.374 nicm 2767: .Xr yes 1 )
2768: overwhelming the terminal.
1.284 nicm 2769: The default is a trigger of 250 and an interval of 100.
1.283 nicm 2770: A trigger of zero disables the rate limiting.
1.56 jmc 2771: .Pp
1.1 nicm 2772: .It Ic clock-mode-colour Ar colour
2773: Set clock colour.
1.56 jmc 2774: .Pp
1.1 nicm 2775: .It Xo Ic clock-mode-style
1.56 jmc 2776: .Op Ic 12 | 24
1.1 nicm 2777: .Xc
2778: Set clock hour format.
1.56 jmc 2779: .Pp
1.1 nicm 2780: .It Ic force-height Ar height
2781: .It Ic force-width Ar width
2782: Prevent
2783: .Nm
2784: from resizing a window to greater than
2785: .Ar width
2786: or
2787: .Ar height .
2788: A value of zero restores the default unlimited setting.
1.56 jmc 2789: .Pp
1.196 nicm 2790: .It Ic main-pane-height Ar height
1.2 nicm 2791: .It Ic main-pane-width Ar width
2792: Set the width or height of the main (left or top) pane in the
2793: .Ic main-horizontal
2794: or
2795: .Ic main-vertical
2796: layouts.
1.56 jmc 2797: .Pp
1.1 nicm 2798: .It Xo Ic mode-keys
1.56 jmc 2799: .Op Ic vi | emacs
1.1 nicm 2800: .Xc
1.105 nicm 2801: Use vi or emacs-style key bindings in copy and choice modes.
1.191 nicm 2802: As with the
2803: .Ic status-keys
2804: option, the default is emacs, unless
2805: .Ev VISUAL
2806: or
2807: .Ev EDITOR
2808: contains
2809: .Ql vi .
1.56 jmc 2810: .Pp
1.50 nicm 2811: .It Xo Ic mode-mouse
1.240 nicm 2812: .Op Ic on | off | copy-mode
1.50 nicm 2813: .Xc
1.51 jmc 2814: Mouse state in modes.
1.223 nicm 2815: If on, the mouse may be used to enter copy mode and copy a selection by
2816: dragging, to enter copy mode and scroll with the mouse wheel, or to select an
2817: option in choice mode.
1.240 nicm 2818: If set to
1.241 jmc 2819: .Em copy-mode ,
1.240 nicm 2820: the mouse behaves as set to on, but cannot be used to enter copy
2821: mode.
1.56 jmc 2822: .Pp
1.378 nicm 2823: .It Ic mode-style Ar style
2824: Set window modes style.
2825: For how to specify
2826: .Ar style ,
2827: see the
2828: .Ic message-command-style
2829: option.
2830: .Pp
1.1 nicm 2831: .It Xo Ic monitor-activity
1.56 jmc 2832: .Op Ic on | off
1.1 nicm 2833: .Xc
2834: Monitor for activity in the window.
2835: Windows with activity are highlighted in the status line.
1.56 jmc 2836: .Pp
2837: .It Ic monitor-content Ar match-string
1.6 jmc 2838: Monitor content in the window.
2839: When
1.16 nicm 2840: .Xr fnmatch 3
2841: pattern
1.1 nicm 2842: .Ar match-string
2843: appears in the window, it is highlighted in the status line.
1.56 jmc 2844: .Pp
1.192 nicm 2845: .It Xo Ic monitor-silence
2846: .Op Ic interval
2847: .Xc
2848: Monitor for silence (no activity) in the window within
2849: .Ic interval
2850: seconds.
2851: Windows that have been silent for the interval are highlighted in the
2852: status line.
2853: An interval of zero disables the monitoring.
1.195 nicm 2854: .Pp
2855: .It Ic other-pane-height Ar height
2856: Set the height of the other panes (not the main pane) in the
2857: .Ic main-horizontal
2858: layout.
2859: If this option is set to 0 (the default), it will have no effect.
2860: If both the
2861: .Ic main-pane-height
2862: and
2863: .Ic other-pane-height
2864: options are set, the main pane will grow taller to make the other panes the
2865: specified height, but will never shrink to do so.
2866: .Pp
2867: .It Ic other-pane-width Ar width
2868: Like
2869: .Ic other-pane-height ,
2870: but set the width of other panes in the
2871: .Ic main-vertical
2872: layout.
1.243 nicm 2873: .Pp
2874: .It Ic pane-base-index Ar index
2875: Like
2876: .Ic base-index ,
2877: but set the starting index for pane numbers.
1.192 nicm 2878: .Pp
1.1 nicm 2879: .It Xo Ic remain-on-exit
1.56 jmc 2880: .Op Ic on | off
1.1 nicm 2881: .Xc
2882: A window with this flag set is not destroyed when the program running in it
2883: exits.
2884: The window may be reactivated with the
2885: .Ic respawn-window
2886: command.
1.56 jmc 2887: .Pp
1.99 nicm 2888: .It Xo Ic synchronize-panes
2889: .Op Ic on | off
2890: .Xc
1.164 nicm 2891: Duplicate input to any pane to all other panes in the same window (only
2892: for panes that are not in any special mode).
1.139 nicm 2893: .Pp
1.1 nicm 2894: .It Xo Ic utf8
1.56 jmc 2895: .Op Ic on | off
1.1 nicm 2896: .Xc
2897: Instructs
2898: .Nm
2899: to expect UTF-8 sequences to appear in this window.
1.56 jmc 2900: .Pp
1.378 nicm 2901: .It Ic window-status-activity-style Ar style
2902: Set status line style for windows with an activity alert.
2903: For how to specify
2904: .Ar style ,
2905: see the
2906: .Ic message-command-style
2907: option.
1.169 nicm 2908: .Pp
1.378 nicm 2909: .It Ic window-status-bell-style Ar style
2910: Set status line style for windows with a bell alert.
2911: For how to specify
2912: .Ar style ,
2913: see the
2914: .Ic message-command-style
2915: option.
1.169 nicm 2916: .Pp
1.378 nicm 2917: .It Ic window-status-content-style Ar style
2918: Set status line style for windows with a content alert.
2919: For how to specify
2920: .Ar style ,
2921: see the
2922: .Ic message-command-style
2923: option.
1.56 jmc 2924: .Pp
1.125 nicm 2925: .It Ic window-status-current-format Ar string
2926: Like
2927: .Ar window-status-format ,
2928: but is the format used when the window is the current window.
1.307 nicm 2929: .Pp
1.378 nicm 2930: .It Ic window-status-current-style Ar style
2931: Set status line style for the currently active window.
2932: For how to specify
2933: .Ar style ,
2934: see the
2935: .Ic message-command-style
2936: option.
1.239 nicm 2937: .Pp
2938: .It Ic window-status-format Ar string
2939: Set the format in which the window is displayed in the status line window list.
2940: See the
2941: .Ar status-left
2942: option for details of special character sequences available.
2943: The default is
2944: .Ql #I:#W#F .
1.290 nicm 2945: .Pp
1.378 nicm 2946: .It Ic window-status-last-style Ar style
2947: Set status line style for the last active window.
2948: For how to specify
2949: .Ar style ,
2950: see the
2951: .Ic message-command-style
2952: option.
2953: .Pp
1.290 nicm 2954: .It Ic window-status-separator Ar string
2955: Sets the separator drawn between windows in the status line.
2956: The default is a single space character.
1.125 nicm 2957: .Pp
1.378 nicm 2958: .It Ic window-status-style Ar style
2959: Set status line style for a single window.
2960: For how to specify
2961: .Ar style ,
2962: see the
2963: .Ic message-command-style
2964: option.
2965: .Pp
1.1 nicm 2966: .It Xo Ic xterm-keys
1.56 jmc 2967: .Op Ic on | off
1.1 nicm 2968: .Xc
2969: If this option is set,
2970: .Nm
2971: will generate
1.57 jmc 2972: .Xr xterm 1 -style
2973: function key sequences; these have a number included to indicate modifiers such
2974: as Shift, Alt or Ctrl.
1.123 nicm 2975: The default is off.
1.282 nicm 2976: .Pp
2977: .It Xo Ic wrap-search
2978: .Op Ic on | off
2979: .Xc
2980: If this option is set, searches will wrap around the end of the pane contents.
2981: The default is on.
1.57 jmc 2982: .El
2983: .It Xo Ic show-options
1.340 nicm 2984: .Op Fl gqsvw
1.129 nicm 2985: .Op Fl t Ar target-session | Ar target-window
1.276 nicm 2986: .Op Ar option
1.57 jmc 2987: .Xc
2988: .D1 (alias: Ic show )
1.276 nicm 2989: Show the window options (or a single window option if given) with
1.129 nicm 2990: .Fl w
1.133 nicm 2991: (equivalent to
1.134 nicm 2992: .Ic show-window-options ) ,
1.133 nicm 2993: the server options with
2994: .Fl s ,
2995: otherwise the session options for
2996: .Ar target session .
2997: Global session or window options are listed if
2998: .Fl g
2999: is used.
1.317 nicm 3000: .Fl v
3001: shows only the option value, not the name.
1.340 nicm 3002: If
3003: .Fl q
3004: is set, no error will be returned if
3005: .Ar option
3006: is unset.
1.57 jmc 3007: .It Xo Ic show-window-options
1.317 nicm 3008: .Op Fl gv
1.57 jmc 3009: .Op Fl t Ar target-window
1.276 nicm 3010: .Op Ar option
1.57 jmc 3011: .Xc
3012: .D1 (alias: Ic showw )
1.276 nicm 3013: List the window options or a single option for
1.57 jmc 3014: .Ar target-window ,
3015: or the global window options if
3016: .Fl g
3017: is used.
1.317 nicm 3018: .Fl v
3019: shows only the option value, not the name.
1.63 nicm 3020: .El
1.245 nicm 3021: .Sh FORMATS
1.294 nicm 3022: Certain commands accept the
1.245 nicm 3023: .Fl F
3024: flag with a
3025: .Ar format
3026: argument.
3027: This is a string which controls the output format of the command.
3028: Replacement variables are enclosed in
3029: .Ql #{
3030: and
3031: .Ql } ,
3032: for example
1.359 nicm 3033: .Ql #{session_name} .
3034: Some variables also have an shorter alias such as
1.245 nicm 3035: .Ql #S .
1.376 nicm 3036: .Ql ##
3037: is replaced by a single
3038: .Ql # .
1.245 nicm 3039: Conditionals are also accepted by prefixing with
1.246 jmc 3040: .Ql \&?
1.245 nicm 3041: and separating two alternatives with a comma;
3042: if the specified variable exists and is not zero, the first alternative
1.246 jmc 3043: is chosen, otherwise the second is used.
3044: For example
1.245 nicm 3045: .Ql #{?session_attached,attached,not attached}
3046: will include the string
3047: .Ql attached
3048: if the session is attached and the string
3049: .Ql not attached
3050: if it is unattached.
1.367 nicm 3051: A limit may be placed on the length of the resultant string by prefixing it
3052: by an
3053: .Ql = ,
3054: a number and a colon, so
3055: .Ql #{=10:pane_title}
3056: will include at most the first 10 characters of the pane title.
1.245 nicm 3057: .Pp
3058: The following variables are available, where appropriate:
1.359 nicm 3059: .Bl -column "XXXXXXXXXXXXXXXXXXX" "XXXXX"
3060: .It Sy "Variable name" Ta Sy "Alias" Ta Sy "Replaced with"
3061: .It Li "alternate_on" Ta "" Ta "If pane is in alternate screen"
3062: .It Li "alternate_saved_x" Ta "" Ta "Saved cursor X in alternate screen"
3063: .It Li "alternate_saved_y" Ta "" Ta "Saved cursor Y in alternate screen"
1.386 nicm 3064: .It Li "buffer_sample" Ta "" Ta "Sample of start of buffer"
1.359 nicm 3065: .It Li "buffer_size" Ta "" Ta "Size of the specified buffer in bytes"
3066: .It Li "client_activity" Ta "" Ta "Integer time client last had activity"
3067: .It Li "client_activity_string" Ta "" Ta "String time client last had activity"
3068: .It Li "client_created" Ta "" Ta "Integer time client created"
3069: .It Li "client_created_string" Ta "" Ta "String time client created"
3070: .It Li "client_height" Ta "" Ta "Height of client"
3071: .It Li "client_last_session" Ta "" Ta "Name of the client's last session"
3072: .It Li "client_prefix" Ta "" Ta "1 if prefix key has been pressed"
3073: .It Li "client_readonly" Ta "" Ta "1 if client is readonly"
3074: .It Li "client_session" Ta "" Ta "Name of the client's session"
3075: .It Li "client_termname" Ta "" Ta "Terminal name of client"
3076: .It Li "client_tty" Ta "" Ta "Pseudo terminal of client"
3077: .It Li "client_utf8" Ta "" Ta "1 if client supports utf8"
3078: .It Li "client_width" Ta "" Ta "Width of client"
3079: .It Li "cursor_flag" Ta "" Ta "Pane cursor flag"
3080: .It Li "cursor_x" Ta "" Ta "Cursor X position in pane"
3081: .It Li "cursor_y" Ta "" Ta "Cursor Y position in pane"
3082: .It Li "history_bytes" Ta "" Ta "Number of bytes in window history"
3083: .It Li "history_limit" Ta "" Ta "Maximum window history lines"
3084: .It Li "history_size" Ta "" Ta "Size of history in bytes"
3085: .It Li "host" Ta "#H" Ta "Hostname of local host"
3086: .It Li "host_short" Ta "#h" Ta "Hostname of local host (no domain name)"
3087: .It Li "insert_flag" Ta "" Ta "Pane insert flag"
3088: .It Li "keypad_cursor_flag" Ta "" Ta "Pane keypad cursor flag"
3089: .It Li "keypad_flag" Ta "" Ta "Pane keypad flag"
3090: .It Li "line" Ta "" Ta "Line number in the list"
3091: .It Li "mouse_any_flag" Ta "" Ta "Pane mouse any flag"
3092: .It Li "mouse_button_flag" Ta "" Ta "Pane mouse button flag"
3093: .It Li "mouse_standard_flag" Ta "" Ta "Pane mouse standard flag"
3094: .It Li "mouse_utf8_flag" Ta "" Ta "Pane mouse UTF-8 flag"
3095: .It Li "pane_active" Ta "" Ta "1 if active pane"
3096: .It Li "pane_current_command" Ta "" Ta "Current command if available"
3097: .It Li "pane_dead" Ta "" Ta "1 if pane is dead"
3098: .It Li "pane_height" Ta "" Ta "Height of pane"
3099: .It Li "pane_id" Ta "#D" Ta "Unique pane ID"
3100: .It Li "pane_in_mode" Ta "" Ta "If pane is in a mode"
1.363 nicm 3101: .It Li "pane_synchronized" Ta "" Ta "If pane is synchronized"
1.359 nicm 3102: .It Li "pane_index" Ta "#P" Ta "Index of pane"
3103: .It Li "pane_pid" Ta "" Ta "PID of first process in pane"
3104: .It Li "pane_start_command" Ta "" Ta "Command pane started with"
3105: .It Li "pane_tabs" Ta "" Ta "Pane tab positions"
3106: .It Li "pane_title" Ta "#T" Ta "Title of pane"
3107: .It Li "pane_tty" Ta "" Ta "Pseudo terminal of pane"
3108: .It Li "pane_width" Ta "" Ta "Width of pane"
3109: .It Li "saved_cursor_x" Ta "" Ta "Saved cursor X in pane"
3110: .It Li "saved_cursor_y" Ta "" Ta "Saved cursor Y in pane"
3111: .It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane"
3112: .It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane"
1.382 nicm 3113: .It Li "session_attached" Ta "" Ta "Number of clients session is attached to"
1.359 nicm 3114: .It Li "session_created" Ta "" Ta "Integer time session created"
3115: .It Li "session_created_string" Ta "" Ta "String time session created"
3116: .It Li "session_group" Ta "" Ta "Number of session group"
3117: .It Li "session_grouped" Ta "" Ta "1 if session in a group"
3118: .It Li "session_height" Ta "" Ta "Height of session"
3119: .It Li "session_id" Ta "" Ta "Unique session ID"
1.382 nicm 3120: .It Li "session_many_attached" Ta "" Ta "1 if multiple clients attached"
1.359 nicm 3121: .It Li "session_name" Ta "#S" Ta "Name of session"
3122: .It Li "session_width" Ta "" Ta "Width of session"
3123: .It Li "session_windows" Ta "" Ta "Number of windows in session"
3124: .It Li "window_active" Ta "" Ta "1 if window active"
1.366 nicm 3125: .It Li "window_activity_flag" Ta "" Ta "1 if window has activity alert"
3126: .It Li "window_bell_flag" Ta "" Ta "1 if window has bell"
3127: .It Li "window_content_flag" Ta "" Ta "1 if window has content alert"
1.359 nicm 3128: .It Li "window_find_matches" Ta "" Ta "Matched data from the find-window"
3129: .It Li "window_flags" Ta "#F" Ta "Window flags"
3130: .It Li "window_height" Ta "" Ta "Height of window"
3131: .It Li "window_id" Ta "" Ta "Unique window ID"
3132: .It Li "window_index" Ta "#I" Ta "Index of window"
3133: .It Li "window_layout" Ta "" Ta "Window layout description"
3134: .It Li "window_name" Ta "#W" Ta "Name of window"
3135: .It Li "window_panes" Ta "" Ta "Number of panes in window"
1.366 nicm 3136: .It Li "window_silence_flag" Ta "" Ta "1 if window has silence alert"
1.359 nicm 3137: .It Li "window_width" Ta "" Ta "Width of window"
3138: .It Li "wrap_flag" Ta "" Ta "Pane wrap flag"
1.245 nicm 3139: .El
1.261 nicm 3140: .Sh NAMES AND TITLES
3141: .Nm
3142: distinguishes between names and titles.
3143: Windows and sessions have names, which may be used to specify them in targets
3144: and are displayed in the status line and various lists: the name is the
3145: .Nm
3146: identifier for a window or session.
3147: Only panes have titles.
3148: A pane's title is typically set by the program running inside the pane and
3149: is not modified by
3150: .Nm .
3151: It is the same mechanism used to set for example the
3152: .Xr xterm 1
3153: window title in an
3154: .Xr X 7
3155: window manager.
1.268 nicm 3156: Windows themselves do not have titles - a window's title is the title of its
1.261 nicm 3157: active pane.
3158: .Nm
3159: itself may set the title of the terminal in which the client is running, see
3160: the
3161: .Ic set-titles
3162: option.
3163: .Pp
3164: A session's name is set with the
3165: .Ic new-session
3166: and
3167: .Ic rename-session
3168: commands.
3169: A window's name is set with one of:
3170: .Bl -enum -width Ds
3171: .It
3172: A command argument (such as
3173: .Fl n
3174: for
3175: .Ic new-window
3176: or
3177: .Ic new-session ) .
3178: .It
3179: An escape sequence:
3180: .Bd -literal -offset indent
3181: $ printf '\e033kWINDOW_NAME\e033\e\e'
3182: .Ed
3183: .It
3184: Automatic renaming, which sets the name to the active command in the window's
3185: active pane.
3186: See the
3187: .Ic automatic-rename
3188: option.
3189: .El
3190: .Pp
3191: When a pane is first created, its title is the hostname.
3192: A pane's title can be set via the OSC title setting sequence, for example:
3193: .Bd -literal -offset indent
3194: $ printf '\e033]2;My Title\e033\e\e'
3195: .Ed
1.63 nicm 3196: .Sh ENVIRONMENT
3197: When the server is started,
3198: .Nm
3199: copies the environment into the
3200: .Em global environment ;
3201: in addition, each session has a
3202: .Em session environment .
1.193 nicm 3203: When a window is created, the session and global environments are merged.
3204: If a variable exists in both, the value from the session environment is used.
3205: The result is the initial environment passed to the new process.
1.63 nicm 3206: .Pp
3207: The
3208: .Ic update-environment
3209: session option may be used to update the session environment from the client
3210: when a new session is created or an old reattached.
3211: .Nm
3212: also initialises the
3213: .Ev TMUX
3214: variable with some internal information to allow commands to be executed
3215: from inside, and the
3216: .Ev TERM
3217: variable with the correct terminal setting of
3218: .Ql screen .
3219: .Pp
3220: Commands to alter and view the environment are:
3221: .Bl -tag -width Ds
3222: .It Xo Ic set-environment
3223: .Op Fl gru
3224: .Op Fl t Ar target-session
3225: .Ar name Op Ar value
3226: .Xc
1.115 nicm 3227: .D1 (alias: Ic setenv )
1.63 nicm 3228: Set or unset an environment variable.
3229: If
3230: .Fl g
3231: is used, the change is made in the global environment; otherwise, it is applied
3232: to the session environment for
3233: .Ar target-session .
3234: The
3235: .Fl u
3236: flag unsets a variable.
3237: .Fl r
3238: indicates the variable is to be removed from the environment before starting a
3239: new process.
3240: .It Xo Ic show-environment
3241: .Op Fl g
3242: .Op Fl t Ar target-session
1.286 nicm 3243: .Op Ar variable
1.63 nicm 3244: .Xc
1.115 nicm 3245: .D1 (alias: Ic showenv )
1.63 nicm 3246: Display the environment for
3247: .Ar target-session
3248: or the global environment with
3249: .Fl g .
1.286 nicm 3250: If
3251: .Ar variable
3252: is omitted, all variables are shown.
1.63 nicm 3253: Variables removed from the environment are prefixed with
3254: .Ql - .
1.57 jmc 3255: .El
3256: .Sh STATUS LINE
3257: .Nm
3258: includes an optional status line which is displayed in the bottom line of each
3259: terminal.
3260: By default, the status line is enabled (it may be disabled with the
3261: .Ic status
3262: session option) and contains, from left-to-right: the name of the current
1.261 nicm 3263: session in square brackets; the window list; the title of the active pane
3264: in double quotes; and the time and date.
1.57 jmc 3265: .Pp
3266: The status line is made of three parts: configurable left and right sections
3267: (which may contain dynamic content such as the time or output from a shell
3268: command, see the
3269: .Ic status-left ,
3270: .Ic status-left-length ,
3271: .Ic status-right ,
3272: and
3273: .Ic status-right-length
3274: options below), and a central window list.
1.125 nicm 3275: By default, the window list shows the index, name and (if any) flag of the
3276: windows present in the current session in ascending numerical order.
3277: It may be customised with the
3278: .Ar window-status-format
3279: and
3280: .Ar window-status-current-format
3281: options.
1.57 jmc 3282: The flag is one of the following symbols appended to the window name:
3283: .Bl -column "Symbol" "Meaning" -offset indent
3284: .It Sy "Symbol" Ta Sy "Meaning"
3285: .It Li "*" Ta "Denotes the current window."
3286: .It Li "-" Ta "Marks the last window (previously selected)."
3287: .It Li "#" Ta "Window is monitored and activity has been detected."
3288: .It Li "!" Ta "A bell has occurred in the window."
3289: .It Li "+" Ta "Window is monitored for content and it has appeared."
1.192 nicm 3290: .It Li "~" Ta "The window has been silent for the monitor-silence interval."
1.349 nicm 3291: .It Li "Z" Ta "The window's active pane is zoomed."
1.57 jmc 3292: .El
3293: .Pp
3294: The # symbol relates to the
3295: .Ic monitor-activity
3296: and + to the
3297: .Ic monitor-content
3298: window options.
3299: The window name is printed in inverted colours if an alert (bell, activity or
3300: content) is present.
3301: .Pp
1.131 nicm 3302: The colour and attributes of the status line may be configured, the entire
3303: status line using the
1.378 nicm 3304: .Ic status-style
3305: session option and individual windows using the
3306: .Ic window-status-style
3307: window option.
1.57 jmc 3308: .Pp
1.131 nicm 3309: The status line is automatically refreshed at interval if it has changed, the
3310: interval may be controlled with the
1.57 jmc 3311: .Ic status-interval
3312: session option.
3313: .Pp
3314: Commands related to the status line are as follows:
3315: .Bl -tag -width Ds
3316: .It Xo Ic command-prompt
1.235 nicm 3317: .Op Fl I Ar inputs
1.73 nicm 3318: .Op Fl p Ar prompts
1.57 jmc 3319: .Op Fl t Ar target-client
3320: .Op Ar template
3321: .Xc
3322: Open the command prompt in a client.
3323: This may be used from inside
3324: .Nm
3325: to execute commands interactively.
1.231 nicm 3326: .Pp
1.57 jmc 3327: If
3328: .Ar template
1.73 nicm 3329: is specified, it is used as the command.
1.235 nicm 3330: If present,
3331: .Fl I
3332: is a comma-separated list of the initial text for each prompt.
1.73 nicm 3333: If
3334: .Fl p
3335: is given,
3336: .Ar prompts
3337: is a comma-separated list of prompts which are displayed in order; otherwise
3338: a single prompt is displayed, constructed from
3339: .Ar template
3340: if it is present, or
3341: .Ql \&:
3342: if not.
1.235 nicm 3343: .Pp
3344: Both
3345: .Ar inputs
3346: and
1.231 nicm 3347: .Ar prompts
3348: may contain the special character sequences supported by the
3349: .Ic status-left
3350: option.
3351: .Pp
1.73 nicm 3352: Before the command is executed, the first occurrence of the string
3353: .Ql %%
1.74 jmc 3354: and all occurrences of
1.73 nicm 3355: .Ql %1
3356: are replaced by the response to the first prompt, the second
3357: .Ql %%
3358: and all
3359: .Ql %2
3360: are replaced with the response to the second prompt, and so on for further
1.74 jmc 3361: prompts.
3362: Up to nine prompt responses may be replaced
3363: .Po
3364: .Ql %1
1.73 nicm 3365: to
1.74 jmc 3366: .Ql %9
3367: .Pc .
1.57 jmc 3368: .It Xo Ic confirm-before
1.238 nicm 3369: .Op Fl p Ar prompt
1.57 jmc 3370: .Op Fl t Ar target-client
3371: .Ar command
3372: .Xc
3373: .D1 (alias: Ic confirm )
3374: Ask for confirmation before executing
3375: .Ar command .
1.238 nicm 3376: If
3377: .Fl p
3378: is given,
3379: .Ar prompt
3380: is the prompt to display; otherwise a prompt is constructed from
3381: .Ar command .
3382: It may contain the special character sequences supported by the
3383: .Ic status-left
3384: option.
3385: .Pp
1.57 jmc 3386: This command works only from inside
3387: .Nm .
3388: .It Xo Ic display-message
1.127 nicm 3389: .Op Fl p
1.215 nicm 3390: .Op Fl c Ar target-client
3391: .Op Fl t Ar target-pane
1.57 jmc 3392: .Op Ar message
3393: .Xc
3394: .D1 (alias: Ic display )
1.127 nicm 3395: Display a message.
3396: If
3397: .Fl p
3398: is given, the output is printed to stdout, otherwise it is displayed in the
3399: .Ar target-client
3400: status line.
1.122 nicm 3401: The format of
1.124 jmc 3402: .Ar message
1.275 nicm 3403: is described in the
3404: .Sx FORMATS
3405: section; information is taken from
1.215 nicm 3406: .Ar target-pane
3407: if
3408: .Fl t
3409: is given, otherwise the active pane for the session attached to
3410: .Ar target-client .
1.57 jmc 3411: .El
3412: .Sh BUFFERS
3413: .Nm
3414: maintains a stack of
1.199 nicm 3415: .Em paste buffers .
1.57 jmc 3416: Up to the value of the
3417: .Ic buffer-limit
3418: option are kept; when a new buffer is added, the buffer at the bottom of the
3419: stack is removed.
3420: Buffers may be added using
3421: .Ic copy-mode
3422: or the
3423: .Ic set-buffer
3424: command, and pasted into a window using the
3425: .Ic paste-buffer
3426: command.
3427: .Pp
3428: A configurable history buffer is also maintained for each window.
3429: By default, up to 2000 lines are kept; this can be altered with the
3430: .Ic history-limit
3431: option (see the
3432: .Ic set-option
3433: command above).
3434: .Pp
3435: The buffer commands are as follows:
3436: .Bl -tag -width Ds
1.178 nicm 3437: .It Xo
3438: .Ic choose-buffer
1.294 nicm 3439: .Op Fl F Ar format
1.178 nicm 3440: .Op Fl t Ar target-window
3441: .Op Ar template
3442: .Xc
3443: Put a window into buffer choice mode, where a buffer may be chosen
3444: interactively from a list.
3445: After a buffer is selected,
3446: .Ql %%
3447: is replaced by the buffer index in
3448: .Ar template
3449: and the result executed as a command.
3450: If
3451: .Ar template
3452: is not given, "paste-buffer -b '%%'" is used.
1.294 nicm 3453: For the meaning of the
3454: .Fl F
3455: flag, see the
3456: .Sx FORMATS
3457: section.
1.314 nicm 3458: This command works only if at least one client is attached.
1.57 jmc 3459: .It Ic clear-history Op Fl t Ar target-pane
3460: .D1 (alias: Ic clearhist )
3461: Remove and free the history for the specified pane.
1.198 nicm 3462: .It Ic delete-buffer Op Fl b Ar buffer-index
1.57 jmc 3463: .D1 (alias: Ic deleteb )
3464: Delete the buffer at
3465: .Ar buffer-index ,
3466: or the top buffer if not specified.
1.294 nicm 3467: .It Xo Ic list-buffers
3468: .Op Fl F Ar format
3469: .Xc
1.57 jmc 3470: .D1 (alias: Ic lsb )
1.198 nicm 3471: List the global buffers.
1.294 nicm 3472: For the meaning of the
3473: .Fl F
3474: flag, see the
3475: .Sx FORMATS
3476: section.
1.200 jmc 3477: .It Xo Ic load-buffer
1.57 jmc 3478: .Op Fl b Ar buffer-index
3479: .Ar path
3480: .Xc
3481: .D1 (alias: Ic loadb )
3482: Load the contents of the specified paste buffer from
3483: .Ar path .
3484: .It Xo Ic paste-buffer
1.278 nicm 3485: .Op Fl dpr
1.57 jmc 3486: .Op Fl b Ar buffer-index
1.170 nicm 3487: .Op Fl s Ar separator
1.158 nicm 3488: .Op Fl t Ar target-pane
1.57 jmc 3489: .Xc
3490: .D1 (alias: Ic pasteb )
1.158 nicm 3491: Insert the contents of a paste buffer into the specified pane.
3492: If not specified, paste into the current one.
1.57 jmc 3493: With
3494: .Fl d ,
3495: also delete the paste buffer from the stack.
3496: When output, any linefeed (LF) characters in the paste buffer are replaced with
1.170 nicm 3497: a separator, by default carriage return (CR).
3498: A custom separator may be specified using the
3499: .Fl s
3500: flag.
3501: The
1.57 jmc 3502: .Fl r
1.170 nicm 3503: flag means to do no replacement (equivalent to a separator of LF).
1.278 nicm 3504: If
3505: .Fl p
3506: is specified, paste bracket control codes are inserted around the
3507: buffer if the application has requested bracketed paste mode.
1.57 jmc 3508: .It Xo Ic save-buffer
3509: .Op Fl a
3510: .Op Fl b Ar buffer-index
3511: .Ar path
3512: .Xc
3513: .D1 (alias: Ic saveb )
3514: Save the contents of the specified paste buffer to
3515: .Ar path .
3516: The
3517: .Fl a
3518: option appends to rather than overwriting the file.
3519: .It Xo Ic set-buffer
1.383 nicm 3520: .Op Fl a
1.57 jmc 3521: .Op Fl b Ar buffer-index
3522: .Ar data
3523: .Xc
3524: .D1 (alias: Ic setb )
3525: Set the contents of the specified buffer to
3526: .Ar data .
1.383 nicm 3527: The
3528: .Fl a
3529: option appends to rather than overwriting the buffer.
1.1 nicm 3530: .It Xo Ic show-buffer
3531: .Op Fl b Ar buffer-index
3532: .Xc
3533: .D1 (alias: Ic showb )
3534: Display the contents of the specified buffer.
1.57 jmc 3535: .El
3536: .Sh MISCELLANEOUS
3537: Miscellaneous commands are as follows:
3538: .Bl -tag -width Ds
1.72 nicm 3539: .It Ic clock-mode Op Fl t Ar target-pane
1.57 jmc 3540: Display a large clock.
1.334 nicm 3541: .It Xo Ic if-shell
1.352 nicm 3542: .Op Fl b
1.334 nicm 3543: .Op Fl t Ar target-pane
3544: .Ar shell-command command
3545: .Op Ar command
3546: .Xc
1.57 jmc 3547: .D1 (alias: Ic if )
1.251 nicm 3548: Execute the first
1.57 jmc 3549: .Ar command
3550: if
3551: .Ar shell-command
1.251 nicm 3552: returns success or the second
3553: .Ar command
3554: otherwise.
1.334 nicm 3555: Before being executed, shell-command is expanded using the rules specified in the
3556: .Sx FORMATS
3557: section, including those relevant to
3558: .Ar target-pane .
1.335 nicm 3559: With
3560: .Fl b ,
3561: .Ar shell-command
3562: is run in the background.
1.57 jmc 3563: .It Ic lock-server
3564: .D1 (alias: Ic lock )
1.90 nicm 3565: Lock each client individually by running the command specified by the
3566: .Ic lock-command
3567: option.
1.308 nicm 3568: .It Xo Ic run-shell
1.357 nicm 3569: .Op Fl b
1.308 nicm 3570: .Op Fl t Ar target-pane
3571: .Ar shell-command
3572: .Xc
1.87 nicm 3573: .D1 (alias: Ic run )
3574: Execute
1.153 nicm 3575: .Ar shell-command
1.106 nicm 3576: in the background without creating a window.
1.334 nicm 3577: Before being executed, shell-command is expanded using the rules specified in
3578: the
3579: .Sx FORMATS
3580: section.
1.335 nicm 3581: With
3582: .Fl b ,
3583: the command is run in the background.
1.308 nicm 3584: After it finishes, any output to stdout is displayed in copy mode (in the pane
3585: specified by
3586: .Fl t
3587: or the current pane if omitted).
1.153 nicm 3588: If the command doesn't return success, the exit status is also displayed.
1.342 nicm 3589: .It Xo Ic wait-for
1.370 nicm 3590: .Op Fl L | S | U
1.342 nicm 3591: .Ar channel
3592: .Xc
3593: .D1 (alias: Ic wait )
1.343 nicm 3594: When used without options, prevents the client from exiting until woken using
1.342 nicm 3595: .Ic wait-for
3596: .Fl S
3597: with the same channel.
1.343 nicm 3598: When
3599: .Fl L
3600: is used, the channel is locked and any clients that try to lock the same
3601: channel are made to wait until the channel is unlocked with
3602: .Ic wait-for
3603: .Fl U .
1.342 nicm 3604: This command only works from outside
3605: .Nm .
1.228 nicm 3606: .El
3607: .Sh TERMINFO EXTENSIONS
3608: .Nm
3609: understands some extensions to
3610: .Xr terminfo 5 :
3611: .Bl -tag -width Ds
1.360 nicm 3612: .It Em Cs , Cr
1.233 nicm 3613: Set the cursor colour.
1.232 jmc 3614: The first takes a single string argument and is used to set the colour;
3615: the second takes no arguments and restores the default cursor colour.
3616: If set, a sequence such as this may be used
3617: to change the cursor colour from inside
3618: .Nm :
3619: .Bd -literal -offset indent
3620: $ printf '\e033]12;red\e033\e\e'
3621: .Ed
1.361 jmc 3622: .It Em \&Ss , Se
1.230 nicm 3623: Change the cursor style.
1.232 jmc 3624: If set, a sequence such as this may be used
3625: to change the cursor to an underline:
1.230 nicm 3626: .Bd -literal -offset indent
3627: $ printf '\e033[4 q'
3628: .Ed
3629: .Pp
3630: If
3631: .Em Csr
3632: is set, it will be used to reset the cursor style instead
3633: of
3634: .Em Cs .
1.232 jmc 3635: .It Em \&Ms
3636: This sequence can be used by
3637: .Nm
3638: to store the current buffer in the host terminal's selection (clipboard).
3639: See the
3640: .Em set-clipboard
3641: option above and the
3642: .Xr xterm 1
3643: man page.
1.345 nicm 3644: .El
3645: .Sh CONTROL MODE
3646: .Nm
3647: offers a textual interface called
3648: .Em control mode .
3649: This allows applications to communicate with
3650: .Nm
3651: using a simple text-only protocol.
3652: .Pp
3653: In control mode, a client sends
3654: .Nm
3655: commands or command sequences terminated by newlines on standard input.
3656: Each command will produce one block of output on standard output.
3657: An output block consists of a
3658: .Em %begin
3659: line followed by the output (which may be empty).
3660: The output block ends with a
3661: .Em %end
3662: or
3663: .Em %error .
3664: .Em %begin
3665: and matching
3666: .Em %end
3667: or
3668: .Em %error
3669: have two arguments: an integer time (as seconds from epoch) and command number.
3670: For example:
3671: .Bd -literal -offset indent
3672: %begin 1363006971 2
3673: 0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active)
3674: %end 1363006971 2
3675: .Ed
3676: .Pp
3677: In control mode,
3678: .Nm
3679: outputs notifications.
3680: A notification will never occur inside an output block.
3681: .Pp
3682: The following notifications are defined:
3683: .Bl -tag -width Ds
3684: .It Ic %exit Op Ar reason
3685: The
3686: .Nm
3687: client is exiting immediately, either because it is not attached to any session
3688: or an error occurred.
3689: If present,
3690: .Ar reason
3691: describes why the client exited.
3692: .It Ic %layout-change Ar window-id Ar window-layout
3693: The layout of a window with ID
3694: .Ar window-id
3695: changed.
3696: The new layout is
3697: .Ar window-layout .
1.347 nicm 3698: .It Ic %output Ar pane-id Ar value
3699: A window pane produced output.
1.345 nicm 3700: .Ar value
1.350 nicm 3701: escapes non-printable characters and backslash as octal \\xxx.
1.345 nicm 3702: .It Ic %session-changed Ar session-id Ar name
3703: The client is now attached to the session with ID
3704: .Ar session-id ,
3705: which is named
3706: .Ar name .
3707: .It Ic %session-renamed Ar name
3708: The current session was renamed to
3709: .Ar name .
3710: .It Ic %sessions-changed
3711: A session was created or destroyed.
3712: .It Ic %unlinked-window-add Ar window-id
3713: The window with ID
3714: .Ar window-id
3715: was created but is not linked to the current session.
3716: .It Ic %window-add Ar window-id
3717: The window with ID
3718: .Ar window-id
3719: was linked to the current session.
3720: .It Ic %window-close Ar window-id
3721: The window with ID
3722: .Ar window-id
3723: closed.
3724: .It Ic %window-renamed Ar window-id Ar name
3725: The window with ID
3726: .Ar window-id
3727: was renamed to
3728: .Ar name .
1.1 nicm 3729: .El
3730: .Sh FILES
1.26 nicm 3731: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1 nicm 3732: .It Pa ~/.tmux.conf
1.6 jmc 3733: Default
1.1 nicm 3734: .Nm
1.6 jmc 3735: configuration file.
1.26 nicm 3736: .It Pa /etc/tmux.conf
3737: System-wide configuration file.
1.1 nicm 3738: .El
1.57 jmc 3739: .Sh EXAMPLES
3740: To create a new
3741: .Nm
3742: session running
3743: .Xr vi 1 :
3744: .Pp
3745: .Dl $ tmux new-session vi
3746: .Pp
3747: Most commands have a shorter form, known as an alias.
3748: For new-session, this is
3749: .Ic new :
3750: .Pp
3751: .Dl $ tmux new vi
3752: .Pp
3753: Alternatively, the shortest unambiguous form of a command is accepted.
3754: If there are several options, they are listed:
3755: .Bd -literal -offset indent
3756: $ tmux n
3757: ambiguous command: n, could be: new-session, new-window, next-window
3758: .Ed
3759: .Pp
3760: Within an active session, a new window may be created by typing
3761: .Ql C-b c
3762: (Ctrl
3763: followed by the
3764: .Ql b
3765: key
3766: followed by the
3767: .Ql c
3768: key).
3769: .Pp
3770: Windows may be navigated with:
3771: .Ql C-b 0
3772: (to select window 0),
3773: .Ql C-b 1
3774: (to select window 1), and so on;
3775: .Ql C-b n
3776: to select the next window; and
3777: .Ql C-b p
3778: to select the previous window.
3779: .Pp
3780: A session may be detached using
3781: .Ql C-b d
1.64 nicm 3782: (or by an external event such as
3783: .Xr ssh 1
3784: disconnection) and reattached with:
1.57 jmc 3785: .Pp
3786: .Dl $ tmux attach-session
3787: .Pp
3788: Typing
3789: .Ql C-b \&?
3790: lists the current key bindings in the current window; up and down may be used
3791: to navigate the list or
3792: .Ql q
3793: to exit from it.
3794: .Pp
3795: Commands to be run when the
3796: .Nm
3797: server is started may be placed in the
3798: .Pa ~/.tmux.conf
3799: configuration file.
3800: Common examples include:
3801: .Pp
3802: Changing the default prefix key:
3803: .Bd -literal -offset indent
3804: set-option -g prefix C-a
3805: unbind-key C-b
3806: bind-key C-a send-prefix
3807: .Ed
3808: .Pp
3809: Turning the status line off, or changing its colour:
3810: .Bd -literal -offset indent
3811: set-option -g status off
1.378 nicm 3812: set-option -g status-style bg=blue
1.57 jmc 3813: .Ed
3814: .Pp
3815: Setting other options, such as the default command,
3816: or locking after 30 minutes of inactivity:
3817: .Bd -literal -offset indent
3818: set-option -g default-command "exec /bin/ksh"
3819: set-option -g lock-after-time 1800
3820: .Ed
3821: .Pp
3822: Creating new key bindings:
3823: .Bd -literal -offset indent
3824: bind-key b set-option status
3825: bind-key / command-prompt "split-window 'exec man %%'"
1.73 nicm 3826: bind-key S command-prompt "new-window -n %1 'ssh %1'"
1.57 jmc 3827: .Ed
1.1 nicm 3828: .Sh SEE ALSO
3829: .Xr pty 4
3830: .Sh AUTHORS
1.364 schwarze 3831: .An Nicholas Marriott Aq Mt nicm@users.sourceforge.net