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