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