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