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