Annotation of src/usr.bin/tmux/tmux.1, Revision 1.659
1.659 ! nicm 1: .\" $OpenBSD: tmux.1,v 1.658 2019/05/28 09:50:54 nicm Exp $
1.1 nicm 2: .\"
1.477 nicm 3: .\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
1.1 nicm 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.658 nicm 17: .Dd $Mdocdate: May 28 2019 $
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.434 jmc 26: .Op Fl 2Cluv
1.91 nicm 27: .Op Fl c Ar shell-command
1.1 nicm 28: .Op Fl f Ar file
29: .Op Fl L Ar socket-name
30: .Op Fl S Ar socket-path
31: .Op Ar command Op Ar flags
32: .Ek
33: .Sh DESCRIPTION
34: .Nm
1.59 jmc 35: is a terminal multiplexer:
36: it enables a number of terminals to be created, accessed, and
37: controlled from a single screen.
1.67 jmc 38: .Nm
39: may be detached from a screen
40: and continue running in the background,
41: then later reattached.
1.1 nicm 42: .Pp
1.60 nicm 43: When
44: .Nm
45: is started it creates a new
46: .Em session
47: with a single
48: .Em window
49: and displays it on screen.
50: A status line at the bottom of the screen
51: shows information on the current session
52: and is used to enter interactive commands.
53: .Pp
54: A session is a single collection of
55: .Em pseudo terminals
56: under the management of
57: .Nm .
58: Each session has one or more
59: windows linked to it.
60: A window occupies the entire screen
61: and may be split into rectangular panes,
62: each of which is a separate pseudo terminal
63: (the
64: .Xr pty 4
65: manual page documents the technical details of pseudo terminals).
66: Any number of
67: .Nm
68: instances may connect to the same session,
69: and any number of windows may be present in the same session.
70: Once all sessions are killed,
71: .Nm
72: exits.
73: .Pp
1.64 nicm 74: Each session is persistent and will survive accidental disconnection
1.66 jmc 75: (such as
1.64 nicm 76: .Xr ssh 1
1.67 jmc 77: connection timeout) or intentional detaching (with the
1.64 nicm 78: .Ql C-b d
79: key strokes).
80: .Nm
81: may be reattached using:
82: .Pp
83: .Dl $ tmux attach
1.60 nicm 84: .Pp
1.64 nicm 85: In
86: .Nm ,
87: a session is displayed on screen by a
88: .Em client
89: and all sessions are managed by a single
90: .Em server .
91: The server and each client are separate processes which communicate through a
92: socket in
93: .Pa /tmp .
1.65 nicm 94: .Pp
1.1 nicm 95: The options are as follows:
96: .Bl -tag -width "XXXXXXXXXXXX"
97: .It Fl 2
98: Force
99: .Nm
100: to assume the terminal supports 256 colours.
1.345 nicm 101: .It Fl C
1.369 nicm 102: Start in control mode (see the
103: .Sx CONTROL MODE
104: section).
1.345 nicm 105: Given twice
106: .Xo ( Fl CC ) Xc
107: disables echo.
1.91 nicm 108: .It Fl c Ar shell-command
109: Execute
110: .Ar shell-command
111: using the default shell.
112: If necessary, the
113: .Nm
114: server will be started to retrieve the
115: .Ic default-shell
116: option.
1.153 nicm 117: This option is for compatibility with
118: .Xr sh 1
119: when
120: .Nm
121: is used as a login shell.
1.1 nicm 122: .It Fl f Ar file
123: Specify an alternative configuration file.
124: By default,
125: .Nm
1.26 nicm 126: loads the system configuration file from
127: .Pa /etc/tmux.conf ,
128: if present, then looks for a user configuration file at
1.1 nicm 129: .Pa ~/.tmux.conf .
1.306 nicm 130: .Pp
1.1 nicm 131: The configuration file is a set of
132: .Nm
133: commands which are executed in sequence when the server is first started.
1.306 nicm 134: .Nm
135: loads configuration files once when the server process has started.
136: The
137: .Ic source-file
138: command may be used to load a file later.
1.61 nicm 139: .Pp
140: .Nm
1.306 nicm 141: shows any error messages from commands in configuration files in the first
142: session created, and continues to process the rest of the configuration file.
1.1 nicm 143: .It Fl L Ar socket-name
144: .Nm
145: stores the server socket in a directory under
1.455 nicm 146: .Ev TMUX_TMPDIR
147: or
1.208 nicm 148: .Pa /tmp
1.455 nicm 149: if it is unset.
1.355 nicm 150: The default socket is named
1.1 nicm 151: .Em default .
152: This option allows a different socket name to be specified, allowing several
153: independent
154: .Nm
155: servers to be run.
156: Unlike
157: .Fl S
158: a full path is not necessary: the sockets are all created in the same
159: directory.
1.2 nicm 160: .Pp
161: If the socket is accidentally removed, the
1.6 jmc 162: .Dv SIGUSR1
1.2 nicm 163: signal may be sent to the
164: .Nm
1.422 nicm 165: server process to recreate it (note that this will fail if any parent
166: directories are missing).
1.166 sobrado 167: .It Fl l
168: Behave as a login shell.
169: This flag currently has no effect and is for compatibility with other shells
170: when using tmux as a login shell.
1.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
1.644 schwarze 179: Write UTF-8 output to the terminal even if the first environment
180: variable of
1.14 nicm 181: .Ev LC_ALL ,
1.644 schwarze 182: .Ev LC_CTYPE ,
183: or
1.2 nicm 184: .Ev LANG
1.644 schwarze 185: that is set does not contain
186: .Qq UTF-8
187: or
188: .Qq UTF8 .
1.1 nicm 189: .It Fl v
190: Request verbose logging.
191: Log messages will be saved into
192: .Pa tmux-client-PID.log
193: and
194: .Pa tmux-server-PID.log
195: files in the current directory, where
196: .Em PID
1.6 jmc 197: is the PID of the server or client process.
1.558 nicm 198: If
199: .Fl v
200: is specified twice, an additional
201: .Pa tmux-out-PID.log
202: file is generated with a copy of everything
203: .Nm
204: writes to the terminal.
205: .Pp
206: The
207: .Dv SIGUSR2
208: signal may be sent to the
209: .Nm
210: server process to toggle logging between on (as if
211: .Fl v
212: was given) and off.
1.1 nicm 213: .It Ar command Op Ar flags
214: This specifies one of a set of commands used to control
215: .Nm ,
1.6 jmc 216: as described in the following sections.
1.59 jmc 217: If no commands are specified, the
1.1 nicm 218: .Ic new-session
219: command is assumed.
1.57 jmc 220: .El
1.627 nicm 221: .Sh DEFAULT KEY BINDINGS
1.64 nicm 222: .Nm
223: may be controlled from an attached client by using a key combination of a
224: prefix key,
225: .Ql C-b
226: (Ctrl-b) by default, followed by a command key.
227: .Pp
1.172 nicm 228: The default command key bindings are:
1.64 nicm 229: .Pp
1.171 nicm 230: .Bl -tag -width "XXXXXXXXXX" -offset indent -compact
231: .It C-b
232: Send the prefix key (C-b) through to the application.
233: .It C-o
234: Rotate the panes in the current window forwards.
235: .It C-z
236: Suspend the
237: .Nm
238: client.
239: .It !
240: Break the current pane out of the window.
241: .It \&"
1.625 nicm 242: .\" "
1.171 nicm 243: Split the current pane into two, top and bottom.
244: .It #
245: List all paste buffers.
1.236 nicm 246: .It $
247: Rename the current session.
1.171 nicm 248: .It %
249: Split the current pane into two, left and right.
250: .It &
251: Kill the current window.
252: .It '
253: Prompt for a window index to select.
1.412 nicm 254: .It \&(
255: Switch the attached client to the previous session.
256: .It \&)
257: Switch the attached client to the next session.
1.171 nicm 258: .It ,
259: Rename the current window.
260: .It -
261: Delete the most recently copied buffer of text.
262: .It .
263: Prompt for an index to move the current window.
264: .It 0 to 9
265: Select windows 0 to 9.
266: .It :
267: Enter the
268: .Nm
269: command prompt.
1.187 nicm 270: .It ;
271: Move to the previously active pane.
1.178 nicm 272: .It =
273: Choose which buffer to paste interactively from a list.
1.171 nicm 274: .It \&?
275: List all key bindings.
276: .It D
277: Choose a client to detach.
1.412 nicm 278: .It L
279: Switch the attached client back to the last session.
1.182 jmc 280: .It \&[
1.171 nicm 281: Enter copy mode to copy text or view the history.
1.182 jmc 282: .It \&]
1.171 nicm 283: Paste the most recently copied buffer of text.
1.64 nicm 284: .It c
1.65 nicm 285: Create a new window.
1.64 nicm 286: .It d
1.65 nicm 287: Detach the current client.
1.171 nicm 288: .It f
289: Prompt to search for text in open windows.
290: .It i
291: Display some information about the current window.
1.64 nicm 292: .It l
1.65 nicm 293: Move to the previously selected window.
1.64 nicm 294: .It n
1.65 nicm 295: Change to the next window.
1.171 nicm 296: .It o
297: Select the next pane in the current window.
1.64 nicm 298: .It p
1.65 nicm 299: Change to the previous window.
1.171 nicm 300: .It q
301: Briefly display pane indexes.
302: .It r
303: Force redraw of the attached client.
1.432 nicm 304: .It m
305: Mark the current pane (see
306: .Ic select-pane
307: .Fl m ) .
308: .It M
309: Clear the marked pane.
1.171 nicm 310: .It s
311: Select a new session for the attached client interactively.
312: .It t
313: Show the time.
314: .It w
315: Choose the current window interactively.
316: .It x
317: Kill the current pane.
1.412 nicm 318: .It z
319: Toggle zoom state of the current pane.
1.171 nicm 320: .It {
321: Swap the current pane with the previous pane.
322: .It }
323: Swap the current pane with the next pane.
324: .It ~
325: Show previous messages from
326: .Nm ,
327: if any.
328: .It Page Up
329: Enter copy mode and scroll one page up.
330: .It Up, Down
331: .It Left, Right
332: Change to the pane above, below, to the left, or to the right of the current
333: pane.
334: .It M-1 to M-5
335: Arrange panes in one of the five preset layouts: even-horizontal,
336: even-vertical, main-horizontal, main-vertical, or tiled.
1.412 nicm 337: .It Space
338: Arrange the current window in the next preset layout.
1.171 nicm 339: .It M-n
340: Move to the next window with a bell or activity marker.
341: .It M-o
342: Rotate the panes in the current window backwards.
343: .It M-p
344: Move to the previous window with a bell or activity marker.
345: .It C-Up, C-Down
346: .It C-Left, C-Right
347: Resize the current pane in steps of one cell.
348: .It M-Up, M-Down
349: .It M-Left, M-Right
350: Resize the current pane in steps of five cells.
1.64 nicm 351: .El
352: .Pp
353: Key bindings may be changed with the
354: .Ic bind-key
355: and
356: .Ic unbind-key
357: commands.
1.651 nicm 358: .Sh COMMAND PARSING AND EXECUTION
359: .Nm
360: supports a large number of commands which can be used to control its
361: behaviour.
362: Each command is named and can accept zero or more flags and arguments.
363: They may be bound to a key with the
364: .Ic bind-key
365: command or run from the shell prompt, a shell script, a configuration file or
366: the command prompt.
367: For example, the same
368: .Ic set-option
369: command run from the shell prompt, from
370: .Pa ~/.tmux.conf
371: and bound to a key may look like:
372: .Bd -literal -offset indent
373: $ tmux set-option -g status-style bg=cyan
374:
375: set-option -g status-style bg=cyan
376:
377: bind-key C set-option -g status-style bg=cyan
378: .Ed
379: .Pp
380: Here, the command name is
381: .Ql set-option ,
382: .Ql Fl g
383: is a flag and
384: .Ql status-style
385: and
386: .Ql bg=cyan
387: are arguments.
388: .Pp
389: .Nm
390: distinguishes between command parsing and execution.
391: In order to execute a command,
392: .Nm
393: needs it to be split up into its name and arguments.
394: This is command parsing.
395: If a command is run from the shell, the shell parses it; from inside
396: .Nm
397: or from a configuration file,
398: .Nm
399: does.
400: Examples of when
401: .Nm
402: parses commands are:
403: .Bl -dash -offset indent
404: .It
405: in a configuration file;
406: .It
407: typed at the command prompt (see
408: .Ic command-prompt ) ;
409: .It
410: given to
411: .Ic bind-key ;
412: .It
413: passed as arguments to
414: .Ic if-shell
415: or
416: .Ic confirm-before .
417: .El
418: .Pp
419: To execute commands, each client has a
420: .Ql command queue .
421: A global command queue not attached to any client is used on startup
422: for configuration files like
423: .Pa ~/.tmux.conf .
424: Parsed commands added to the queue are executed in order.
425: Some commands, like
426: .Ic if-shell
427: and
428: .Ic confirm-before ,
429: parse their argument to create a new command which is inserted immediately
430: after themselves.
431: This means that arguments can be parsed twice or more - once when the parent command (such as
432: .Ic if-shell )
433: is parsed and again when it parses and executes its command.
434: Commands like
435: .Ic if-shell ,
436: .Ic run-shell
437: and
438: .Ic display-panes
439: stop execution of subsequent commands on the queue until something happens -
440: .Ic if-shell
441: and
442: .Ic run-shell
443: until a shell command finishes and
444: .Ic display-panes
445: until a key is pressed.
446: For example, the following commands:
447: .Bd -literal -offset indent
448: new-session; new-window
449: if-shell "true" "split-window"
450: kill-session
451: .Ed
452: .Pp
453: Will execute
454: .Ic new-session ,
455: .Ic new-window ,
456: .Ic if-shell ,
457: the shell command
458: .Xr true 1 ,
459: .Ic new-window
460: and
461: .Ic kill-session
462: in that order.
463: .Pp
464: The
465: .Sx COMMANDS
466: section lists the
467: .Nm
468: commands and their arguments.
469: .Sh PARSING SYNTAX
470: This section describes the syntax of commands parsed by
471: .Nm ,
472: for example in a configuration file or at the command prompt.
473: Note the when commands are entered into the shell, they are parsed by the shell
474: - see for example
475: .Xr ksh 1
476: or
477: .Xr csh 1 .
478: .Pp
479: Each command is terminated by a newline or a semicolon (;).
480: Commands separated by semicolons together form a
481: .Ql command sequence
482: - if a command in the sequence encounters an error, no subsequent commands are
483: executed.
484: .Pp
485: Comments are marked by the unquoted # character - any remaining text after a
486: comment is ignored until the end of the line.
487: .Pp
488: If the last character of a line is \e, the line is joined with the following
489: line (the \e and the newline are completely removed).
490: This is called line continuation and applies both inside and outside quoted
1.656 nicm 491: strings and in comments, but not inside braces.
1.651 nicm 492: .Pp
1.655 nicm 493: Command arguments may be specified as strings surrounded by single (') quotes,
494: double quotes (") or braces ({}).
1.651 nicm 495: .\" "
496: This is required when the argument contains any special character.
1.655 nicm 497: Single and double quoted strings cannot span multiple lines except with line
498: continuation.
499: Braces can span multiple lines.
1.651 nicm 500: .Pp
501: Outside of quotes and inside double quotes, these replacements are performed:
502: .Bl -dash -offset indent
503: .It
504: Environment variables preceded by $ are replaced with their value from the
505: global environment (see the
506: .Sx GLOBAL AND SESSION ENVIRONMENT
507: section).
508: .It
509: A leading ~ or ~user is expanded to the home directory of the current or
510: specified user.
511: .It
512: \euXXXX or \euXXXXXXXX is replaced by the Unicode codepoint corresponding to
513: the given four or eight digit hexadecimal number.
514: .It
515: When preceded (escaped) by a \e, the following characters are replaced: \ee by
516: the escape character; \er by a carriage return; \en by a newline; and \et by a
517: tab.
518: .Pp
519: Any other characters preceded by \e are replaced by themselves (that is, the \e
520: is removed) and are not treated as having any special meaning - so for example
521: \e; will not mark a command sequence and \e$ will not expand an environment
522: variable.
523: .El
524: .Pp
1.655 nicm 525: Braces are similar to single quotes in that the text inside is taken literally
1.656 nicm 526: without any replacements but this also includes line continuation.
527: Braces can span multiple lines in which case a literal newline is included in the
528: string.
1.655 nicm 529: They are designed to avoid the need for additional escaping when passing a group
530: of
531: .Nm
532: or shell commands as an argument (for example to
533: .Ic if-shell
534: or
535: .Ic pipe-pane ) .
536: These two examples produce an identical command - note that no escaping is
537: needed when using {}:
538: .Bd -literal -offset indent
539: if-shell true {
540: display -p 'brace-dollar-foo: }$foo'
541: }
542:
543: if-shell true "\en display -p 'brace-dollar-foo: }\e$foo'\en"
544: .Ed
545: .Pp
546: Braces may be enclosed inside braces, for example:
547: .Bd -literal -offset indent
548: bind x if-shell "true" {
549: if-shell "true" {
550: display "true!"
551: }
552: }
553: .Ed
554: .Pp
1.651 nicm 555: Environment variables may be set by using the syntax
556: .Ql name=value ,
557: for example
558: .Ql HOME=/home/user .
559: Variables set during parsing are added to the global environment.
560: .Pp
561: Commands may be parsed conditionally by surrounding them with
562: .Ql %if ,
563: .Ql %elif ,
564: .Ql %else
565: and
566: .Ql %endif .
567: The argument to
568: .Ql %if
569: and
570: .Ql %elif
571: is expanded as a format (see
572: .Sx FORMATS )
573: and if it evaluates to false (zero or empty), subsequent text is ignored until
574: the closing
575: .Ql %elif ,
576: .Ql %else
577: or
578: .Ql %endif .
579: For example:
580: .Bd -literal -offset indent
581: %if #{==:#{host},myhost}
582: set -g status-style bg=red
583: %elif #{==:#{host},myotherhost}
584: set -g status-style bg=green
585: %else
586: set -g status-style bg=blue
587: %endif
588: .Ed
589: .Pp
590: Will change the status line to red if running on
591: .Ql myhost ,
592: green if running on
593: .Ql myotherhost ,
594: or blue if running on another host.
595: Conditionals may be given on one line, for example:
596: .Bd -literal -offset indent
597: %if #{==:#{host},myhost} set -g status-style bg=red %endif
598: .Ed
1.57 jmc 599: .Sh COMMANDS
1.651 nicm 600: This section describes the commands supported by
1.57 jmc 601: .Nm .
602: Most commands accept the optional
603: .Fl t
1.432 nicm 604: (and sometimes
605: .Fl s )
1.57 jmc 606: argument with one of
607: .Ar target-client ,
608: .Ar target-session
609: .Ar target-window ,
610: or
611: .Ar target-pane .
612: These specify the client, session, window or pane which a command should affect.
1.423 nicm 613: .Pp
1.57 jmc 614: .Ar target-client
1.540 nicm 615: should be the name of the client,
616: typically the
1.57 jmc 617: .Xr pty 4
618: file to which the client is connected, for example either of
619: .Pa /dev/ttyp1
620: or
621: .Pa ttyp1
622: for the client attached to
623: .Pa /dev/ttyp1 .
1.423 nicm 624: If no client is specified,
625: .Nm
626: attempts to work out the client currently in use; if that fails, an error is
627: reported.
1.57 jmc 628: Clients may be listed with the
629: .Ic list-clients
630: command.
1.1 nicm 631: .Pp
1.57 jmc 632: .Ar target-session
1.423 nicm 633: is tried as, in order:
634: .Bl -enum -offset Ds
635: .It
636: A session ID prefixed with a $.
637: .It
638: An exact name of a session (as listed by the
1.57 jmc 639: .Ic list-sessions
1.423 nicm 640: command).
641: .It
642: The start of a session name, for example
643: .Ql mysess
644: would match a session named
645: .Ql mysession .
646: .It
647: An
1.57 jmc 648: .Xr fnmatch 3
1.423 nicm 649: pattern which is matched against the session name.
650: .El
651: .Pp
1.441 nicm 652: If the session name is prefixed with an
653: .Ql = ,
1.435 nicm 654: only an exact match is accepted (so
655: .Ql =mysess
656: will only match exactly
657: .Ql mysess ,
658: not
659: .Ql mysession ) .
1.441 nicm 660: .Pp
1.423 nicm 661: If a single session is found, it is used as the target session; multiple matches
1.57 jmc 662: produce an error.
663: If a session is omitted, the current session is used if available; if no
1.117 nicm 664: current session is available, the most recently used is chosen.
1.1 nicm 665: .Pp
1.57 jmc 666: .Ar target-window
1.472 nicm 667: (or
668: .Ar src-window
669: or
670: .Ar dst-window )
1.57 jmc 671: specifies a window in the form
672: .Em session Ns \&: Ns Em window .
673: .Em session
674: follows the same rules as for
675: .Ar target-session ,
676: and
677: .Em window
1.423 nicm 678: is looked for in order as:
679: .Bl -enum -offset Ds
680: .It
681: A special token, listed below.
682: .It
683: A window index, for example
684: .Ql mysession:1
685: is window 1 in session
686: .Ql mysession .
687: .It
688: A window ID, such as @1.
689: .It
690: An exact window name, such as
691: .Ql mysession:mywindow .
692: .It
693: The start of a window name, such as
694: .Ql mysession:mywin .
695: .It
696: As an
1.57 jmc 697: .Xr fnmatch 3
1.423 nicm 698: pattern matched against the window name.
699: .El
700: .Pp
1.435 nicm 701: Like sessions, a
702: .Ql =
703: prefix will do an exact match only.
1.57 jmc 704: An empty window name specifies the next unused index if appropriate (for
705: example the
706: .Ic new-window
707: and
708: .Ic link-window
709: commands)
710: otherwise the current window in
711: .Em session
712: is chosen.
1.423 nicm 713: .Pp
1.424 nicm 714: The following special tokens are available to indicate particular windows.
715: Each has a single-character alternative form.
1.423 nicm 716: .Bl -column "XXXXXXXXXX" "X"
717: .It Sy "Token" Ta Sy "" Ta Sy "Meaning"
718: .It Li "{start}" Ta "^" Ta "The lowest-numbered window"
719: .It Li "{end}" Ta "$" Ta "The highest-numbered window"
720: .It Li "{last}" Ta "!" Ta "The last (previously current) window"
721: .It Li "{next}" Ta "+" Ta "The next window by number"
722: .It Li "{previous}" Ta "-" Ta "The previous window by number"
723: .El
1.1 nicm 724: .Pp
1.57 jmc 725: .Ar target-pane
1.472 nicm 726: (or
727: .Ar src-pane
728: or
729: .Ar dst-pane )
730: may be a pane ID or takes a similar form to
1.57 jmc 731: .Ar target-window
1.423 nicm 732: but with the optional addition of a period followed by a pane index or pane ID,
733: for example:
734: .Ql mysession:mywindow.1 .
1.57 jmc 735: If the pane index is omitted, the currently active pane in the specified
736: window is used.
1.423 nicm 737: The following special tokens are available for the pane index:
738: .Bl -column "XXXXXXXXXXXXXX" "X"
739: .It Sy "Token" Ta Sy "" Ta Sy "Meaning"
740: .It Li "{last}" Ta "!" Ta "The last (previously active) pane"
741: .It Li "{next}" Ta "+" Ta "The next pane by number"
742: .It Li "{previous}" Ta "-" Ta "The previous pane by number"
743: .It Li "{top}" Ta "" Ta "The top pane"
744: .It Li "{bottom}" Ta "" Ta "The bottom pane"
745: .It Li "{left}" Ta "" Ta "The leftmost pane"
746: .It Li "{right}" Ta "" Ta "The rightmost pane"
747: .It Li "{top-left}" Ta "" Ta "The top-left pane"
748: .It Li "{top-right}" Ta "" Ta "The top-right pane"
749: .It Li "{bottom-left}" Ta "" Ta "The bottom-left pane"
750: .It Li "{bottom-right}" Ta "" Ta "The bottom-right pane"
1.447 nicm 751: .It Li "{up-of}" Ta "" Ta "The pane above the active pane"
752: .It Li "{down-of}" Ta "" Ta "The pane below the active pane"
753: .It Li "{left-of}" Ta "" Ta "The pane to the left of the active pane"
754: .It Li "{right-of}" Ta "" Ta "The pane to the right of the active pane"
1.423 nicm 755: .El
1.177 nicm 756: .Pp
1.423 nicm 757: The tokens
1.177 nicm 758: .Ql +
759: and
760: .Ql -
761: may be followed by an offset, for example:
762: .Bd -literal -offset indent
763: select-window -t:+2
764: .Ed
765: .Pp
1.432 nicm 766: In addition,
767: .Em target-session ,
768: .Em target-window
769: or
770: .Em target-pane
771: may consist entirely of the token
772: .Ql {mouse}
773: (alternative form
774: .Ql = )
775: to specify the most recent mouse event
776: (see the
777: .Sx MOUSE SUPPORT
778: section)
779: or
780: .Ql {marked}
781: (alternative form
782: .Ql ~ )
783: to specify the marked pane (see
784: .Ic select-pane
785: .Fl m ) .
786: .Pp
1.423 nicm 787: Sessions, window and panes are each numbered with a unique ID; session IDs are
788: prefixed with a
789: .Ql $ ,
790: windows with a
791: .Ql @ ,
792: and panes with a
793: .Ql % .
794: These are unique and are unchanged for the life of the session, window or pane
795: in the
1.212 nicm 796: .Nm
1.423 nicm 797: server.
798: The pane ID is passed to the child process of the pane in the
1.212 nicm 799: .Ev TMUX_PANE
800: environment variable.
1.423 nicm 801: IDs may be displayed using the
802: .Ql session_id ,
803: .Ql window_id ,
804: or
805: .Ql pane_id
806: formats (see the
807: .Sx FORMATS
808: section) and the
809: .Ic display-message ,
810: .Ic list-sessions ,
811: .Ic list-windows
812: or
813: .Ic list-panes
814: commands.
1.15 jmc 815: .Pp
1.153 nicm 816: .Ar shell-command
817: arguments are
818: .Xr sh 1
819: commands.
1.394 nicm 820: This may be a single argument passed to the shell, for example:
1.153 nicm 821: .Bd -literal -offset indent
822: new-window 'vi /etc/passwd'
823: .Ed
1.394 nicm 824: .Pp
825: Will run:
826: .Bd -literal -offset indent
827: /bin/sh -c 'vi /etc/passwd'
828: .Ed
829: .Pp
830: Additionally, the
831: .Ic new-window ,
832: .Ic new-session ,
833: .Ic split-window ,
834: .Ic respawn-window
835: and
836: .Ic respawn-pane
837: commands allow
838: .Ar shell-command
839: to be given as multiple arguments and executed directly (without
840: .Ql sh -c ) .
841: This can avoid issues with shell quoting.
842: For example:
843: .Bd -literal -offset indent
844: $ tmux new-window vi /etc/passwd
845: .Ed
846: .Pp
847: Will run
848: .Xr vi 1
849: directly without invoking the shell.
1.153 nicm 850: .Pp
851: .Ar command
852: .Op Ar arguments
853: refers to a
854: .Nm
1.655 nicm 855: command, either passed with the command and arguments separately, for example:
1.153 nicm 856: .Bd -literal -offset indent
1.629 nicm 857: bind-key F1 set-option status off
1.153 nicm 858: .Ed
859: .Pp
1.655 nicm 860: Or passed as a single string argument in
861: .Pa .tmux.conf ,
862: for example:
1.153 nicm 863: .Bd -literal -offset indent
1.655 nicm 864: bind-key F1 { set-option status off }
1.153 nicm 865: .Ed
866: .Pp
867: Example
868: .Nm
869: commands include:
1.13 nicm 870: .Bd -literal -offset indent
1.57 jmc 871: refresh-client -t/dev/ttyp2
872:
873: rename-session -tfirst newname
874:
875: set-window-option -t:0 monitor-activity on
876:
877: new-window ; split-window -d
1.244 nicm 878:
879: bind-key R source-file ~/.tmux.conf \e; \e
880: display-message "source-file done"
1.13 nicm 881: .Ed
1.153 nicm 882: .Pp
883: Or from
884: .Xr sh 1 :
885: .Bd -literal -offset indent
886: $ tmux kill-window -t :1
887:
1.159 jmc 888: $ tmux new-window \e; split-window -d
1.153 nicm 889:
1.159 jmc 890: $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
1.153 nicm 891: .Ed
1.57 jmc 892: .Sh CLIENTS AND SESSIONS
1.153 nicm 893: The
894: .Nm
895: server manages clients, sessions, windows and panes.
896: Clients are attached to sessions to interact with them, either
897: when they are created with the
898: .Ic new-session
899: command, or later with the
900: .Ic attach-session
901: command.
1.188 nicm 902: Each session has one or more windows
1.153 nicm 903: .Em linked
904: into it.
905: Windows may be linked to multiple sessions and are made up of one or
906: more panes,
907: each of which contains a pseudo terminal.
908: Commands for creating, linking and otherwise manipulating windows
909: are covered
910: in the
911: .Sx WINDOWS AND PANES
912: section.
913: .Pp
914: The following commands are available to manage clients and sessions:
1.57 jmc 915: .Bl -tag -width Ds
916: .It Xo Ic attach-session
1.436 nicm 917: .Op Fl dEr
1.372 nicm 918: .Op Fl c Ar working-directory
1.57 jmc 919: .Op Fl t Ar target-session
920: .Xc
921: .D1 (alias: Ic attach )
922: If run from outside
923: .Nm ,
924: create a new client in the current terminal and attach it to
925: .Ar target-session .
926: If used from inside, switch the current client.
927: If
928: .Fl d
929: is specified, any other clients attached to the session are detached.
1.148 nicm 930: .Fl r
931: signifies the client is read-only (only keys bound to the
932: .Ic detach-client
1.242 nicm 933: or
934: .Ic switch-client
935: commands have any effect)
1.13 nicm 936: .Pp
1.57 jmc 937: If no server is started,
938: .Ic attach-session
939: will attempt to start it; this will fail unless sessions are created in the
940: configuration file.
1.217 nicm 941: .Pp
942: The
943: .Ar target-session
944: rules for
945: .Ic attach-session
946: are slightly adjusted: if
947: .Nm
948: needs to select the most recently used session, it will prefer the most
949: recently used
950: .Em unattached
951: session.
1.372 nicm 952: .Pp
953: .Fl c
954: will set the session working directory (used for new windows) to
955: .Ar working-directory .
1.436 nicm 956: .Pp
957: If
958: .Fl E
1.480 nicm 959: is used, the
1.436 nicm 960: .Ic update-environment
961: option will not be applied.
1.211 nicm 962: .It Xo Ic detach-client
1.463 nicm 963: .Op Fl aP
1.525 nicm 964: .Op Fl E Ar shell-command
1.219 nicm 965: .Op Fl s Ar target-session
1.211 nicm 966: .Op Fl t Ar target-client
967: .Xc
1.57 jmc 968: .D1 (alias: Ic detach )
1.218 nicm 969: Detach the current client if bound to a key, the client specified with
970: .Fl t ,
1.258 jmc 971: or all clients currently attached to the session specified by
1.218 nicm 972: .Fl s .
1.296 nicm 973: The
974: .Fl a
975: option kills all but the client given with
976: .Fl t .
1.211 nicm 977: If
978: .Fl P
979: is given, send SIGHUP to the parent process of the client, typically causing it
980: to exit.
1.525 nicm 981: With
982: .Fl E ,
983: run
984: .Ar shell-command
985: to replace the client.
1.57 jmc 986: .It Ic has-session Op Fl t Ar target-session
987: .D1 (alias: Ic has )
988: Report an error and exit with 1 if the specified session does not exist.
989: If it does exist, exit with 0.
990: .It Ic kill-server
991: Kill the
1.1 nicm 992: .Nm
1.57 jmc 993: server and clients and destroy all sessions.
1.369 nicm 994: .It Xo Ic kill-session
1.464 nicm 995: .Op Fl aC
1.297 nicm 996: .Op Fl t Ar target-session
1.369 nicm 997: .Xc
1.57 jmc 998: Destroy the given session, closing any windows linked to it and no other
999: sessions, and detaching all clients attached to it.
1.297 nicm 1000: If
1001: .Fl a
1002: is given, all sessions but the specified one is killed.
1.464 nicm 1003: The
1004: .Fl C
1.467 nicm 1005: flag clears alerts (bell, activity, or silence) in all windows linked to the
1.464 nicm 1006: session.
1.250 nicm 1007: .It Xo Ic list-clients
1008: .Op Fl F Ar format
1009: .Op Fl t Ar target-session
1010: .Xc
1.57 jmc 1011: .D1 (alias: Ic lsc )
1.221 jmc 1012: List all clients attached to the server.
1.250 nicm 1013: For the meaning of the
1014: .Fl F
1015: flag, see the
1.252 jmc 1016: .Sx FORMATS
1017: section.
1.221 jmc 1018: If
1.220 nicm 1019: .Ar target-session
1020: is specified, list only clients connected to that session.
1.489 nicm 1021: .It Xo Ic list-commands
1022: .Op Fl F Ar format
1023: .Xc
1.57 jmc 1024: .D1 (alias: Ic lscm )
1025: List the syntax of all commands supported by
1026: .Nm .
1.247 nicm 1027: .It Ic list-sessions Op Fl F Ar format
1.57 jmc 1028: .D1 (alias: Ic ls )
1029: List all sessions managed by the server.
1.247 nicm 1030: For the meaning of the
1031: .Fl F
1032: flag, see the
1033: .Sx FORMATS
1034: section.
1.175 nicm 1035: .It Ic lock-client Op Fl t Ar target-client
1036: .D1 (alias: Ic lockc )
1.92 nicm 1037: Lock
1038: .Ar target-client ,
1039: see the
1040: .Ic lock-server
1041: command.
1.175 nicm 1042: .It Ic lock-session Op Fl t Ar target-session
1043: .D1 (alias: Ic locks )
1.92 nicm 1044: Lock all clients attached to
1045: .Ar target-session .
1.57 jmc 1046: .It Xo Ic new-session
1.436 nicm 1047: .Op Fl AdDEP
1.371 nicm 1048: .Op Fl c Ar start-directory
1.351 nicm 1049: .Op Fl F Ar format
1.57 jmc 1050: .Op Fl n Ar window-name
1051: .Op Fl s Ar session-name
1.536 nicm 1052: .Op Fl t Ar group-name
1.210 nicm 1053: .Op Fl x Ar width
1054: .Op Fl y Ar height
1.153 nicm 1055: .Op Ar shell-command
1.57 jmc 1056: .Xc
1057: .D1 (alias: Ic new )
1058: Create a new session with name
1059: .Ar session-name .
1.153 nicm 1060: .Pp
1.57 jmc 1061: The new session is attached to the current terminal unless
1062: .Fl d
1063: is given.
1064: .Ar window-name
1.1 nicm 1065: and
1.153 nicm 1066: .Ar shell-command
1067: are the name of and shell command to execute in the initial window.
1.552 nicm 1068: With
1069: .Fl d ,
1.642 nicm 1070: the initial size comes from the global
1071: .Ic default-size
1072: option;
1.210 nicm 1073: .Fl x
1074: and
1075: .Fl y
1.602 nicm 1076: can be used to specify a different size.
1077: .Ql -
1078: uses the size of the current client if any.
1.642 nicm 1079: If
1080: .Fl x
1081: or
1082: .Fl y
1083: is given, the
1084: .Ic default-size
1085: option is set for the session.
1.68 nicm 1086: .Pp
1087: If run from a terminal, any
1088: .Xr termios 4
1089: special characters are saved and used for new windows in the new session.
1.338 nicm 1090: .Pp
1091: The
1092: .Fl A
1093: flag makes
1094: .Ic new-session
1095: behave like
1096: .Ic attach-session
1097: if
1098: .Ar session-name
1.416 nicm 1099: already exists; in this case,
1.338 nicm 1100: .Fl D
1101: behaves like
1102: .Fl d
1103: to
1104: .Ic attach-session .
1.101 nicm 1105: .Pp
1106: If
1107: .Fl t
1.536 nicm 1108: is given, it specifies a
1109: .Ic session group .
1110: Sessions in the same group share the same set of windows - new windows are
1.537 nicm 1111: linked to all sessions in the group and any windows closed removed from all
1.536 nicm 1112: sessions.
1.101 nicm 1113: The current and previous window and any session options remain independent and
1.536 nicm 1114: any session in a group may be killed without affecting the others.
1115: The
1116: .Ar group-name
1117: argument may be:
1118: .Bl -enum -width Ds
1119: .It
1120: the name of an existing group, in which case the new session is added to that
1121: group;
1122: .It
1123: the name of an existing session - the new session is added to the same group
1124: as that session, creating a new group if necessary;
1125: .It
1126: the name for a new group containing only the new session.
1127: .El
1128: .Pp
1.101 nicm 1129: .Fl n
1.480 nicm 1130: and
1.153 nicm 1131: .Ar shell-command
1.101 nicm 1132: are invalid if
1133: .Fl t
1134: is used.
1.351 nicm 1135: .Pp
1136: The
1137: .Fl P
1138: option prints information about the new session after it has been created.
1139: By default, it uses the format
1140: .Ql #{session_name}:
1141: but a different format may be specified with
1142: .Fl F .
1.436 nicm 1143: .Pp
1144: If
1145: .Fl E
1.480 nicm 1146: is used, the
1.436 nicm 1147: .Ic update-environment
1148: option will not be applied.
1.248 nicm 1149: .It Xo Ic refresh-client
1.613 nicm 1150: .Op Fl cDlLRSU
1.535 nicm 1151: .Op Fl C Ar width,height
1.248 nicm 1152: .Op Fl t Ar target-client
1.613 nicm 1153: .Op Ar adjustment
1.248 nicm 1154: .Xc
1.57 jmc 1155: .D1 (alias: Ic refresh )
1156: Refresh the current client if bound to a key, or a single client if one is given
1157: with
1158: .Fl t .
1.248 nicm 1159: If
1160: .Fl S
1.538 nicm 1161: is specified, only update the client's status line.
1.535 nicm 1162: .Pp
1.642 nicm 1163: The
1164: .Fl U ,
1165: .Fl D ,
1166: .Fl L
1167: .Fl R ,
1168: and
1169: .Fl c
1170: flags allow the visible portion of a window which is larger than the client
1171: to be changed.
1172: .Fl U
1173: moves the visible part up by
1174: .Ar adjustment
1175: rows and
1176: .Fl D
1177: down,
1178: .Fl L
1179: left by
1180: .Ar adjustment
1181: columns and
1182: .Fl R
1183: right.
1184: .Fl c
1185: returns to tracking the cursor automatically.
1186: If
1187: .Ar adjustment
1188: is omitted, 1 is used.
1189: Note that the visible position is a property of the client not of the
1190: window, changing the current window in the attached session will reset
1191: it.
1192: .Pp
1.535 nicm 1193: .Fl C
1194: sets the width and height of a control client.
1.612 nicm 1195: .Fl l
1196: requests the clipboard from the client using the
1197: .Xr xterm 1
1198: escape sequence and stores it in a new paste buffer.
1.613 nicm 1199: .Pp
1200: .Fl L ,
1201: .Fl R ,
1202: .Fl U
1203: and
1204: .Fl D
1205: move the visible portion of the window left, right, up or down
1206: by
1207: .Ar adjustment ,
1208: if the window is larger than the client.
1209: .Fl c
1210: resets so that the position follows the cursor.
1211: See the
1212: .Ic window-size
1213: option.
1.57 jmc 1214: .It Xo Ic rename-session
1215: .Op Fl t Ar target-session
1216: .Ar new-name
1217: .Xc
1218: .D1 (alias: Ic rename )
1219: Rename the session to
1220: .Ar new-name .
1.121 nicm 1221: .It Xo Ic show-messages
1.465 nicm 1222: .Op Fl JT
1.120 nicm 1223: .Op Fl t Ar target-client
1224: .Xc
1225: .D1 (alias: Ic showmsgs )
1.377 nicm 1226: Show client messages or server information.
1.120 nicm 1227: Any messages displayed on the status line are saved in a per-client message
1228: log, up to a maximum of the limit set by the
1229: .Ar message-limit
1.384 nicm 1230: server option.
1.377 nicm 1231: With
1232: .Fl t ,
1233: display the log for
1.120 nicm 1234: .Ar target-client .
1.377 nicm 1235: .Fl J
1236: and
1237: .Fl T
1.465 nicm 1238: show debugging information about jobs and terminals.
1.488 tim 1239: .It Xo Ic source-file
1.651 nicm 1240: .Op Fl nq
1.488 tim 1241: .Ar path
1.659 ! nicm 1242: .Ar ...
1.488 tim 1243: .Xc
1.57 jmc 1244: .D1 (alias: Ic source )
1.659 ! nicm 1245: Execute commands from one or more files specified by
1.519 nicm 1246: .Ar path
1.659 ! nicm 1247: (which may be
1.607 kn 1248: .Xr glob 7
1.659 ! nicm 1249: patterns).
1.488 tim 1250: If
1251: .Fl q
1252: is given, no error will be returned if
1253: .Ar path
1254: does not exist.
1.651 nicm 1255: With
1256: .Fl n ,
1257: the file is parsed but no commands are executed.
1.57 jmc 1258: .It Ic start-server
1259: .D1 (alias: Ic start )
1260: Start the
1.1 nicm 1261: .Nm
1.57 jmc 1262: server, if not already running, without creating any sessions.
1263: .It Xo Ic suspend-client
1.202 nicm 1264: .Op Fl t Ar target-client
1.57 jmc 1265: .Xc
1266: .D1 (alias: Ic suspendc )
1267: Suspend a client by sending
1268: .Dv SIGTSTP
1269: (tty stop).
1270: .It Xo Ic switch-client
1.436 nicm 1271: .Op Fl Elnpr
1.57 jmc 1272: .Op Fl c Ar target-client
1273: .Op Fl t Ar target-session
1.421 nicm 1274: .Op Fl T Ar key-table
1.57 jmc 1275: .Xc
1276: .D1 (alias: Ic switchc )
1277: Switch the current session for client
1278: .Ar target-client
1279: to
1280: .Ar target-session .
1.635 nicm 1281: As a special case,
1282: .Fl t
1283: may refer to a pane (a target that contains
1.636 jmc 1284: .Ql \&: ,
1285: .Ql \&.
1.635 nicm 1286: or
1.636 jmc 1287: .Ql % ) ,
1.635 nicm 1288: in which case the session, window and pane are all changed.
1.183 nicm 1289: If
1.197 jmc 1290: .Fl l ,
1.183 nicm 1291: .Fl n
1292: or
1293: .Fl p
1.194 nicm 1294: is used, the client is moved to the last, next or previous session
1295: respectively.
1.242 nicm 1296: .Fl r
1297: toggles whether a client is read-only (see the
1298: .Ic attach-session
1299: command).
1.436 nicm 1300: .Pp
1301: If
1302: .Fl E
1303: is used,
1304: .Ic update-environment
1305: option will not be applied.
1.421 nicm 1306: .Pp
1307: .Fl T
1308: sets the client's key table; the next key from the client will be interpreted from
1309: .Ar key-table .
1310: This may be used to configure multiple prefix keys, or to bind commands to
1311: sequences of keys.
1312: For example, to make typing
1313: .Ql abc
1314: run the
1315: .Ic list-keys
1316: command:
1317: .Bd -literal -offset indent
1318: bind-key -Ttable2 c list-keys
1319: bind-key -Ttable1 b switch-client -Ttable2
1320: bind-key -Troot a switch-client -Ttable1
1321: .Ed
1.57 jmc 1322: .El
1323: .Sh WINDOWS AND PANES
1.1 nicm 1324: A
1325: .Nm
1.493 nicm 1326: window may be in one of two modes.
1.1 nicm 1327: The default permits direct access to the terminal attached to the window.
1.164 nicm 1328: The other is copy mode, which permits a section of a window or its
1329: history to be copied to a
1.1 nicm 1330: .Em paste buffer
1331: for later insertion into another window.
1332: This mode is entered with the
1333: .Ic copy-mode
1334: command, bound to
1.113 nicm 1335: .Ql \&[
1.1 nicm 1336: by default.
1.164 nicm 1337: It is also entered when a command that produces output, such as
1338: .Ic list-keys ,
1339: is executed from a key binding.
1.1 nicm 1340: .Pp
1.497 nicm 1341: Commands are sent to copy mode using the
1342: .Fl X
1343: flag to the
1344: .Ic send-keys
1345: command.
1346: When a key is pressed, copy mode automatically uses one of two key tables,
1347: depending on the
1.1 nicm 1348: .Ic mode-keys
1.497 nicm 1349: option:
1350: .Ic copy-mode
1351: for emacs, or
1352: .Ic copy-mode-vi
1353: for vi.
1354: Key tables may be viewed with the
1355: .Ic list-keys
1356: command.
1357: .Pp
1358: The following commands are supported in copy mode:
1.648 nicm 1359: .Bl -column "CommandXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
1.497 nicm 1360: .It Sy "Command" Ta Sy "vi" Ta Sy "emacs"
1361: .It Li "append-selection" Ta "" Ta ""
1362: .It Li "append-selection-and-cancel" Ta "A" Ta ""
1363: .It Li "back-to-indentation" Ta "^" Ta "M-m"
1364: .It Li "begin-selection" Ta "Space" Ta "C-Space"
1365: .It Li "bottom-line" Ta "L" Ta ""
1366: .It Li "cancel" Ta "q" Ta "Escape"
1367: .It Li "clear-selection" Ta "Escape" Ta "C-g"
1.633 nicm 1368: .It Li "copy-end-of-line [<prefix>]" Ta "D" Ta "C-k"
1369: .It Li "copy-line [<prefix>]" Ta "" Ta ""
1370: .It Li "copy-pipe <command> [<prefix>]" Ta "" Ta ""
1.638 nicm 1371: .It Li "copy-pipe-no-clear <command> [<prefix>]" Ta "" Ta ""
1.633 nicm 1372: .It Li "copy-pipe-and-cancel <command> [<prefix>]" Ta "" Ta ""
1373: .It Li "copy-selection [<prefix>]" Ta "" Ta ""
1.638 nicm 1374: .It Li "copy-selection-no-clear [<prefix>]" Ta "" Ta ""
1.633 nicm 1375: .It Li "copy-selection-and-cancel [<prefix>]" Ta "Enter" Ta "M-w"
1.497 nicm 1376: .It Li "cursor-down" Ta "j" Ta "Down"
1377: .It Li "cursor-left" Ta "h" Ta "Left"
1378: .It Li "cursor-right" Ta "l" Ta "Right"
1379: .It Li "cursor-up" Ta "k" Ta "Up"
1380: .It Li "end-of-line" Ta "$" Ta "C-e"
1381: .It Li "goto-line <line>" Ta ":" Ta "g"
1382: .It Li "halfpage-down" Ta "C-d" Ta "M-Down"
1.589 nicm 1383: .It Li "halfpage-down-and-cancel" Ta "" Ta ""
1.497 nicm 1384: .It Li "halfpage-up" Ta "C-u" Ta "M-Up"
1.589 nicm 1385: .It Li "history-bottom" Ta "G" Ta "M->"
1386: .It Li "history-top" Ta "g" Ta "M-<"
1.497 nicm 1387: .It Li "jump-again" Ta ";" Ta ";"
1388: .It Li "jump-backward <to>" Ta "F" Ta "F"
1389: .It Li "jump-forward <to>" Ta "f" Ta "f"
1390: .It Li "jump-reverse" Ta "," Ta ","
1391: .It Li "jump-to-backward <to>" Ta "T" Ta ""
1392: .It Li "jump-to-forward <to>" Ta "t" Ta ""
1393: .It Li "middle-line" Ta "M" Ta "M-r"
1394: .It Li "next-paragraph" Ta "}" Ta "M-}"
1395: .It Li "next-space" Ta "W" Ta ""
1396: .It Li "next-space-end" Ta "E" Ta ""
1397: .It Li "next-word" Ta "w" Ta ""
1398: .It Li "next-word-end" Ta "e" Ta "M-f"
1399: .It Li "other-end" Ta "o" Ta ""
1400: .It Li "page-down" Ta "C-f" Ta "PageDown"
1.589 nicm 1401: .It Li "page-down-and-cancel" Ta "" Ta ""
1.497 nicm 1402: .It Li "page-up" Ta "C-b" Ta "PageUp"
1403: .It Li "previous-paragraph" Ta "{" Ta "M-{"
1404: .It Li "previous-space" Ta "B" Ta ""
1405: .It Li "previous-word" Ta "b" Ta "M-b"
1406: .It Li "rectangle-toggle" Ta "v" Ta "R"
1407: .It Li "scroll-down" Ta "C-e" Ta "C-Down"
1.589 nicm 1408: .It Li "scroll-down-and-cancel" Ta "" Ta ""
1.497 nicm 1409: .It Li "scroll-up" Ta "C-y" Ta "C-Up"
1410: .It Li "search-again" Ta "n" Ta "n"
1.517 nicm 1411: .It Li "search-backward <for>" Ta "?" Ta ""
1412: .It Li "search-forward <for>" Ta "/" Ta ""
1413: .It Li "search-backward-incremental <for>" Ta "" Ta "C-r"
1414: .It Li "search-forward-incremental <for>" Ta "" Ta "C-s"
1.497 nicm 1415: .It Li "search-reverse" Ta "N" Ta "N"
1416: .It Li "select-line" Ta "V" Ta ""
1.634 nicm 1417: .It Li "select-word" Ta "" Ta ""
1.497 nicm 1418: .It Li "start-of-line" Ta "0" Ta "C-a"
1.515 nicm 1419: .It Li "stop-selection" Ta "" Ta ""
1.497 nicm 1420: .It Li "top-line" Ta "H" Ta "M-R"
1.1 nicm 1421: .El
1.589 nicm 1422: .Pp
1.633 nicm 1423: Copy commands may take an optional buffer prefix argument which is used
1424: to generate the buffer name (the default is
1425: .Ql buffer
1426: so buffers are named
1427: .Ql buffer0 ,
1428: .Ql buffer1
1429: and so on).
1430: Pipe commands take a command argument which is the command to which the
1431: copied text is piped.
1.589 nicm 1432: The
1433: .Ql -and-cancel
1434: variants of some commands exit copy mode after they have completed (for copy
1435: commands) or when the cursor reaches the bottom (for scrolling commands).
1.638 nicm 1436: .Ql -no-clear
1437: variants do not clear the selection.
1.146 nicm 1438: .Pp
1439: The next and previous word keys use space and the
1440: .Ql - ,
1.154 nicm 1441: .Ql _
1.146 nicm 1442: and
1443: .Ql @
1.154 nicm 1444: characters as word delimiters by default, but this can be adjusted by
1445: setting the
1446: .Em word-separators
1.255 nicm 1447: session option.
1.146 nicm 1448: Next word moves to the start of the next word, next word end to the end of the
1449: next word and previous word to the start of the previous word.
1450: The three next and previous space keys work similarly but use a space alone as
1451: the word separator.
1.157 nicm 1452: .Pp
1453: The jump commands enable quick movement within a line.
1454: For instance, typing
1455: .Ql f
1456: followed by
1457: .Ql /
1458: will move the cursor to the next
1459: .Ql /
1460: character on the current line.
1461: A
1462: .Ql \&;
1463: will then jump to the next occurrence.
1.1 nicm 1464: .Pp
1.155 nicm 1465: Commands in copy mode may be prefaced by an optional repeat count.
1466: With vi key bindings, a prefix is entered using the number keys; with
1467: emacs, the Alt (meta) key and a number begins prefix entry.
1468: .Pp
1.164 nicm 1469: The synopsis for the
1470: .Ic copy-mode
1471: command is:
1.57 jmc 1472: .Bl -tag -width Ds
1473: .It Xo Ic copy-mode
1.450 nicm 1474: .Op Fl Meu
1.72 nicm 1475: .Op Fl t Ar target-pane
1.57 jmc 1476: .Xc
1477: Enter copy mode.
1478: The
1479: .Fl u
1480: option scrolls one page up.
1.419 nicm 1481: .Fl M
1482: begins a mouse drag (only valid if bound to a mouse key binding, see
1.420 jmc 1483: .Sx MOUSE SUPPORT ) .
1.450 nicm 1484: .Fl e
1485: specifies that scrolling to the bottom of the history (to the visible screen)
1486: should exit copy mode.
1487: While in copy mode, pressing a key other than those used for scrolling will
1488: disable this behaviour.
1489: This is intended to allow fast scrolling through a pane's history, for
1490: example with:
1491: .Bd -literal -offset indent
1492: bind PageUp copy-mode -eu
1493: .Ed
1.57 jmc 1494: .El
1.18 nicm 1495: .Pp
1.1 nicm 1496: Each window displayed by
1497: .Nm
1498: may be split into one or more
1499: .Em panes ;
1500: each pane takes up a certain area of the display and is a separate terminal.
1501: A window may be split into panes using the
1502: .Ic split-window
1503: command.
1.38 nicm 1504: Windows may be split horizontally (with the
1505: .Fl h
1506: flag) or vertically.
1507: Panes may be resized with the
1508: .Ic resize-pane
1.1 nicm 1509: command (bound to
1.523 nicm 1510: .Ql C-Up ,
1511: .Ql C-Down
1512: .Ql C-Left
1.38 nicm 1513: and
1.523 nicm 1514: .Ql C-Right
1.1 nicm 1515: by default), the current pane may be changed with the
1.156 nicm 1516: .Ic select-pane
1517: command and the
1.1 nicm 1518: .Ic rotate-window
1519: and
1520: .Ic swap-pane
1.38 nicm 1521: commands may be used to swap panes without changing their position.
1522: Panes are numbered beginning from zero in the order they are created.
1523: .Pp
1524: A number of preset
1525: .Em layouts
1526: are available.
1527: These may be selected with the
1528: .Ic select-layout
1529: command or cycled with
1530: .Ic next-layout
1531: (bound to
1.149 nicm 1532: .Ql Space
1.131 nicm 1533: by default); once a layout is chosen, panes within it may be moved and resized
1534: as normal.
1.1 nicm 1535: .Pp
1536: The following layouts are supported:
1537: .Bl -tag -width Ds
1538: .It Ic even-horizontal
1539: Panes are spread out evenly from left to right across the window.
1540: .It Ic even-vertical
1541: Panes are spread evenly from top to bottom.
1.2 nicm 1542: .It Ic main-horizontal
1.131 nicm 1543: A large (main) pane is shown at the top of the window and the remaining panes
1544: are spread from left to right in the leftover space at the bottom.
1.2 nicm 1545: Use the
1546: .Em main-pane-height
1547: window option to specify the height of the top pane.
1.1 nicm 1548: .It Ic main-vertical
1.2 nicm 1549: Similar to
1550: .Ic main-horizontal
1551: but the large pane is placed on the left and the others spread from top to
1552: bottom along the right.
1553: See the
1554: .Em main-pane-width
1555: window option.
1.165 nicm 1556: .It Ic tiled
1557: Panes are spread out as evenly as possible over the window in both rows and
1558: columns.
1.1 nicm 1559: .El
1.8 nicm 1560: .Pp
1.181 nicm 1561: In addition,
1562: .Ic select-layout
1563: may be used to apply a previously used layout - the
1564: .Ic list-windows
1565: command displays the layout of each window in a form suitable for use with
1566: .Ic select-layout .
1567: For example:
1568: .Bd -literal -offset indent
1569: $ tmux list-windows
1570: 0: ksh [159x48]
1571: layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
1572: $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
1573: .Ed
1.196 nicm 1574: .Pp
1.181 nicm 1575: .Nm
1576: automatically adjusts the size of the layout for the current window size.
1577: Note that a layout cannot be applied to a window with more panes than that
1578: from which the layout was originally defined.
1579: .Pp
1.57 jmc 1580: Commands related to windows and panes are as follows:
1581: .Bl -tag -width Ds
1582: .It Xo Ic break-pane
1.280 nicm 1583: .Op Fl dP
1584: .Op Fl F Ar format
1.532 nicm 1585: .Op Fl n Ar window-name
1.440 nicm 1586: .Op Fl s Ar src-pane
1.480 nicm 1587: .Op Fl t Ar dst-window
1.57 jmc 1588: .Xc
1589: .D1 (alias: Ic breakp )
1590: Break
1.440 nicm 1591: .Ar src-pane
1592: off from its containing window to make it the only pane in
1593: .Ar dst-window .
1.57 jmc 1594: If
1595: .Fl d
1596: is given, the new window does not become the current window.
1.280 nicm 1597: The
1598: .Fl P
1599: option prints information about the new window after it has been created.
1600: By default, it uses the format
1601: .Ql #{session_name}:#{window_index}
1602: but a different format may be specified with
1603: .Fl F .
1.128 nicm 1604: .It Xo Ic capture-pane
1.506 nicm 1605: .Op Fl aepPqCJ
1.392 nicm 1606: .Op Fl b Ar buffer-name
1.213 nicm 1607: .Op Fl E Ar end-line
1608: .Op Fl S Ar start-line
1.128 nicm 1609: .Op Fl t Ar target-pane
1610: .Xc
1611: .D1 (alias: Ic capturep )
1.322 nicm 1612: Capture the contents of a pane.
1613: If
1614: .Fl p
1.325 nicm 1615: is given, the output goes to stdout, otherwise to the buffer specified with
1.322 nicm 1616: .Fl b
1617: or a new buffer if omitted.
1.339 nicm 1618: If
1619: .Fl a
1620: is given, the alternate screen is used, and the history is not accessible.
1.340 nicm 1621: If no alternate screen exists, an error will be returned unless
1622: .Fl q
1623: is given.
1.326 nicm 1624: If
1625: .Fl e
1.328 nicm 1626: is given, the output includes escape sequences for text and background
1627: attributes.
1628: .Fl C
1.330 nicm 1629: also escapes non-printable characters as octal \exxx.
1.328 nicm 1630: .Fl J
1.341 nicm 1631: joins wrapped lines and preserves trailing spaces at each line's end.
1.346 nicm 1632: .Fl P
1633: captures only any output that the pane has received that is the beginning of an
1634: as-yet incomplete escape sequence.
1.213 nicm 1635: .Pp
1636: .Fl S
1637: and
1638: .Fl E
1639: specify the starting and ending line numbers, zero is the first line of the
1640: visible pane and negative numbers are lines in the history.
1.397 nicm 1641: .Ql -
1642: to
1643: .Fl S
1644: is the start of the history and to
1645: .Fl E
1646: the end of the visible pane.
1.213 nicm 1647: The default is to capture only the visible contents of the pane.
1.76 nicm 1648: .It Xo
1649: .Ic choose-client
1.593 nicm 1650: .Op Fl NZ
1.572 nicm 1651: .Op Fl F Ar format
1.562 nicm 1652: .Op Fl f Ar filter
1.561 nicm 1653: .Op Fl O Ar sort-order
1.555 nicm 1654: .Op Fl t Ar target-pane
1.76 nicm 1655: .Op Ar template
1656: .Xc
1.555 nicm 1657: Put a pane into client mode, allowing a client to be selected interactively from
1658: a list.
1.593 nicm 1659: .Fl Z
1660: zooms the pane.
1.555 nicm 1661: The following keys may be used in client mode:
1662: .Bl -column "Key" "Function" -offset indent
1663: .It Sy "Key" Ta Sy "Function"
1664: .It Li "Enter" Ta "Choose selected client"
1665: .It Li "Up" Ta "Select previous client"
1666: .It Li "Down" Ta "Select next client"
1.559 nicm 1667: .It Li "C-s" Ta "Search by name"
1668: .It Li "n" Ta "Repeat last search"
1.555 nicm 1669: .It Li "t" Ta "Toggle if client is tagged"
1670: .It Li "T" Ta "Tag no clients"
1671: .It Li "C-t" Ta "Tag all clients"
1672: .It Li "d" Ta "Detach selected client"
1673: .It Li "D" Ta "Detach tagged clients"
1674: .It Li "x" Ta "Detach and HUP selected client"
1675: .It Li "X" Ta "Detach and HUP tagged clients"
1676: .It Li "z" Ta "Suspend selected client"
1677: .It Li "Z" Ta "Suspend tagged clients"
1.562 nicm 1678: .It Li "f" Ta "Enter a format to filter items"
1.555 nicm 1679: .It Li "O" Ta "Change sort order"
1.576 nicm 1680: .It Li "v" Ta "Toggle preview"
1.555 nicm 1681: .It Li "q" Ta "Exit mode"
1682: .El
1683: .Pp
1.76 nicm 1684: After a client is chosen,
1685: .Ql %%
1.555 nicm 1686: is replaced by the client name in
1.76 nicm 1687: .Ar template
1688: and the result executed as a command.
1689: If
1690: .Ar template
1691: is not given, "detach-client -t '%%'" is used.
1.555 nicm 1692: .Pp
1.561 nicm 1693: .Fl O
1694: specifies the initial sort order: one of
1695: .Ql name ,
1696: .Ql size ,
1697: .Ql creation ,
1698: or
1699: .Ql activity .
1.562 nicm 1700: .Fl f
1.579 nicm 1701: specifies an initial filter: the filter is a format - if it evaluates to zero,
1702: the item in the list is not shown, otherwise it is shown.
1703: If a filter would lead to an empty list, it is ignored.
1.572 nicm 1704: .Fl F
1705: specifies the format for each item in the list.
1.576 nicm 1706: .Fl N
1707: starts without the preview.
1.314 nicm 1708: This command works only if at least one client is attached.
1.76 nicm 1709: .It Xo
1.555 nicm 1710: .Ic choose-tree
1.593 nicm 1711: .Op Fl GNswZ
1.572 nicm 1712: .Op Fl F Ar format
1.562 nicm 1713: .Op Fl f Ar filter
1.561 nicm 1714: .Op Fl O Ar sort-order
1.555 nicm 1715: .Op Fl t Ar target-pane
1.76 nicm 1716: .Op Ar template
1717: .Xc
1.555 nicm 1718: Put a pane into tree mode, where a session, window or pane may be chosen
1.76 nicm 1719: interactively from a list.
1.298 nicm 1720: .Fl s
1.555 nicm 1721: starts with sessions collapsed and
1.298 nicm 1722: .Fl w
1.555 nicm 1723: with windows collapsed.
1.593 nicm 1724: .Fl Z
1725: zooms the pane.
1.555 nicm 1726: The following keys may be used in tree mode:
1727: .Bl -column "Key" "Function" -offset indent
1728: .It Sy "Key" Ta Sy "Function"
1729: .It Li "Enter" Ta "Choose selected item"
1730: .It Li "Up" Ta "Select previous item"
1731: .It Li "Down" Ta "Select next item"
1.594 nicm 1732: .It Li "x" Ta "Kill selected item"
1733: .It Li "X" Ta "Kill tagged items"
1.566 nicm 1734: .It Li "<" Ta "Scroll list of previews left"
1735: .It Li ">" Ta "Scroll list of previews right"
1.559 nicm 1736: .It Li "C-s" Ta "Search by name"
1737: .It Li "n" Ta "Repeat last search"
1.555 nicm 1738: .It Li "t" Ta "Toggle if item is tagged"
1739: .It Li "T" Ta "Tag no items"
1740: .It Li "C-t" Ta "Tag all items"
1.557 nicm 1741: .It Li "\&:" Ta "Run a command for each tagged item"
1.555 nicm 1742: .It Li "f" Ta "Enter a format to filter items"
1743: .It Li "O" Ta "Change sort order"
1.576 nicm 1744: .It Li "v" Ta "Toggle preview"
1.555 nicm 1745: .It Li "q" Ta "Exit mode"
1746: .El
1.320 nicm 1747: .Pp
1.555 nicm 1748: After a session, window or pane is chosen,
1.76 nicm 1749: .Ql %%
1.555 nicm 1750: is replaced by the target in
1.76 nicm 1751: .Ar template
1752: and the result executed as a command.
1753: If
1754: .Ar template
1.555 nicm 1755: is not given, "switch-client -t '%%'" is used.
1756: .Pp
1.561 nicm 1757: .Fl O
1758: specifies the initial sort order: one of
1759: .Ql index ,
1760: .Ql name ,
1761: or
1762: .Ql time .
1.562 nicm 1763: .Fl f
1.579 nicm 1764: specifies an initial filter: the filter is a format - if it evaluates to zero,
1765: the item in the list is not shown, otherwise it is shown.
1766: If a filter would lead to an empty list, it is ignored.
1.572 nicm 1767: .Fl F
1768: specifies the format for each item in the tree.
1.576 nicm 1769: .Fl N
1770: starts without the preview.
1.586 nicm 1771: .Fl G
1772: includes all sessions in any session groups in the tree rather than only the
1773: first.
1.314 nicm 1774: This command works only if at least one client is attached.
1.491 nicm 1775: .It Xo
1776: .Ic display-panes
1.616 nicm 1777: .Op Fl b
1.573 nicm 1778: .Op Fl d Ar duration
1.491 nicm 1779: .Op Fl t Ar target-client
1780: .Op Ar template
1781: .Xc
1.398 nicm 1782: .D1 (alias: Ic displayp )
1.78 nicm 1783: Display a visible indicator of each pane shown by
1784: .Ar target-client .
1785: See the
1.573 nicm 1786: .Ic display-panes-colour
1.78 nicm 1787: and
1.145 nicm 1788: .Ic display-panes-active-colour
1.78 nicm 1789: session options.
1.573 nicm 1790: The indicator is closed when a key is pressed or
1791: .Ar duration
1792: milliseconds have passed.
1793: If
1794: .Fl d
1795: is not given,
1796: .Ic display-panes-time
1797: is used.
1798: A duration of zero means the indicator stays until a key is pressed.
1.491 nicm 1799: While the indicator is on screen, a pane may be chosen with the
1.84 nicm 1800: .Ql 0
1801: to
1802: .Ql 9
1.491 nicm 1803: keys, which will cause
1804: .Ar template
1805: to be executed as a command with
1806: .Ql %%
1807: substituted by the pane ID.
1808: The default
1809: .Ar template
1810: is "select-pane -t '%%'".
1.616 nicm 1811: With
1812: .Fl b ,
1813: other commands are not blocked from running until the indicator is closed.
1.57 jmc 1814: .It Xo Ic find-window
1.608 nicm 1815: .Op Fl CNTZ
1.555 nicm 1816: .Op Fl t Ar target-pane
1.57 jmc 1817: .Ar match-string
1818: .Xc
1819: .D1 (alias: Ic findw )
1820: Search for the
1821: .Xr fnmatch 3
1822: pattern
1823: .Ar match-string
1824: in window names, titles, and visible content (but not history).
1.285 nicm 1825: The flags control matching behavior:
1826: .Fl C
1827: matches only visible window contents,
1828: .Fl N
1829: matches only the window name and
1830: .Fl T
1831: matches only the window title.
1832: The default is
1833: .Fl CNT .
1.608 nicm 1834: .Fl Z
1835: zooms the pane.
1.555 nicm 1836: .Pp
1.314 nicm 1837: This command works only if at least one client is attached.
1.137 nicm 1838: .It Xo Ic join-pane
1.277 nicm 1839: .Op Fl bdhv
1.137 nicm 1840: .Oo Fl l
1841: .Ar size |
1842: .Fl p Ar percentage Oc
1843: .Op Fl s Ar src-pane
1844: .Op Fl t Ar dst-pane
1845: .Xc
1846: .D1 (alias: Ic joinp )
1847: Like
1848: .Ic split-window ,
1849: but instead of splitting
1850: .Ar dst-pane
1851: and creating a new pane, split it and move
1852: .Ar src-pane
1853: into the space.
1854: This can be used to reverse
1855: .Ic break-pane .
1.277 nicm 1856: The
1857: .Fl b
1858: option causes
1859: .Ar src-pane
1860: to be joined to left of or above
1861: .Ar dst-pane .
1.432 nicm 1862: .Pp
1863: If
1864: .Fl s
1865: is omitted and a marked pane is present (see
1866: .Ic select-pane
1867: .Fl m ) ,
1868: the marked pane is used rather than the current pane.
1.112 nicm 1869: .It Xo Ic kill-pane
1870: .Op Fl a
1871: .Op Fl t Ar target-pane
1872: .Xc
1.57 jmc 1873: .D1 (alias: Ic killp )
1874: Destroy the given pane.
1875: If no panes remain in the containing window, it is also destroyed.
1.112 nicm 1876: The
1877: .Fl a
1878: option kills all but the pane given with
1879: .Fl t .
1.289 nicm 1880: .It Xo Ic kill-window
1881: .Op Fl a
1882: .Op Fl t Ar target-window
1883: .Xc
1.57 jmc 1884: .D1 (alias: Ic killw )
1885: Kill the current window or the window at
1886: .Ar target-window ,
1.1 nicm 1887: removing it from any sessions to which it is linked.
1.289 nicm 1888: The
1889: .Fl a
1890: option kills all but the window given with
1891: .Fl t .
1.398 nicm 1892: .It Xo Ic last-pane
1893: .Op Fl de
1894: .Op Fl t Ar target-window
1895: .Xc
1.187 nicm 1896: .D1 (alias: Ic lastp )
1897: Select the last (previously selected) pane.
1.398 nicm 1898: .Fl e
1899: enables or
1900: .Fl d
1901: disables input to the pane.
1.56 jmc 1902: .It Ic last-window Op Fl t Ar target-session
1.1 nicm 1903: .D1 (alias: Ic last )
1904: Select the last (previously selected) window.
1905: If no
1906: .Ar target-session
1907: is specified, select the last window of the current session.
1908: .It Xo Ic link-window
1.439 nicm 1909: .Op Fl adk
1.1 nicm 1910: .Op Fl s Ar src-window
1911: .Op Fl t Ar dst-window
1912: .Xc
1913: .D1 (alias: Ic linkw )
1914: Link the window at
1915: .Ar src-window
1916: to the specified
1917: .Ar dst-window .
1918: If
1919: .Ar dst-window
1920: is specified and no such window exists, the
1921: .Ar src-window
1922: is linked there.
1.439 nicm 1923: With
1924: .Fl a ,
1925: the window is moved to the next index up (following windows
1926: are moved if necessary).
1.1 nicm 1927: If
1928: .Fl k
1929: is given and
1930: .Ar dst-window
1931: exists, it is killed, otherwise an error is generated.
1932: If
1933: .Fl d
1934: is given, the newly linked window is not selected.
1.214 nicm 1935: .It Xo Ic list-panes
1936: .Op Fl as
1.245 nicm 1937: .Op Fl F Ar format
1.214 nicm 1938: .Op Fl t Ar target
1939: .Xc
1.104 nicm 1940: .D1 (alias: Ic lsp )
1.214 nicm 1941: If
1942: .Fl a
1943: is given,
1944: .Ar target
1945: is ignored and all panes on the server are listed.
1946: If
1947: .Fl s
1948: is given,
1949: .Ar target
1950: is a session (or the current session).
1951: If neither is given,
1952: .Ar target
1953: is a window (or the current window).
1.247 nicm 1954: For the meaning of the
1955: .Fl F
1956: flag, see the
1957: .Sx FORMATS
1958: section.
1.214 nicm 1959: .It Xo Ic list-windows
1960: .Op Fl a
1.245 nicm 1961: .Op Fl F Ar format
1.214 nicm 1962: .Op Fl t Ar target-session
1963: .Xc
1.1 nicm 1964: .D1 (alias: Ic lsw )
1.214 nicm 1965: If
1966: .Fl a
1967: is given, list all windows on the server.
1968: Otherwise, list windows in the current session or in
1.1 nicm 1969: .Ar target-session .
1.245 nicm 1970: For the meaning of the
1971: .Fl F
1972: flag, see the
1973: .Sx FORMATS
1974: section.
1.277 nicm 1975: .It Xo Ic move-pane
1976: .Op Fl bdhv
1977: .Oo Fl l
1978: .Ar size |
1979: .Fl p Ar percentage Oc
1980: .Op Fl s Ar src-pane
1981: .Op Fl t Ar dst-pane
1982: .Xc
1983: .D1 (alias: Ic movep )
1984: Like
1985: .Ic join-pane ,
1986: but
1987: .Ar src-pane
1988: and
1989: .Ar dst-pane
1990: may belong to the same window.
1.1 nicm 1991: .It Xo Ic move-window
1.439 nicm 1992: .Op Fl ardk
1.1 nicm 1993: .Op Fl s Ar src-window
1994: .Op Fl t Ar dst-window
1995: .Xc
1996: .D1 (alias: Ic movew )
1997: This is similar to
1998: .Ic link-window ,
1999: except the window at
2000: .Ar src-window
2001: is moved to
2002: .Ar dst-window .
1.291 nicm 2003: With
2004: .Fl r ,
2005: all windows in the session are renumbered in sequential order, respecting
2006: the
2007: .Ic base-index
2008: option.
1.1 nicm 2009: .It Xo Ic new-window
1.201 nicm 2010: .Op Fl adkP
1.272 nicm 2011: .Op Fl c Ar start-directory
1.641 nicm 2012: .Op Fl e Ar environment
1.351 nicm 2013: .Op Fl F Ar format
1.1 nicm 2014: .Op Fl n Ar window-name
2015: .Op Fl t Ar target-window
1.153 nicm 2016: .Op Ar shell-command
1.1 nicm 2017: .Xc
2018: .D1 (alias: Ic neww )
2019: Create a new window.
1.160 nicm 2020: With
2021: .Fl a ,
2022: the new window is inserted at the next index up from the specified
2023: .Ar target-window ,
2024: moving windows up if necessary,
2025: otherwise
2026: .Ar target-window
2027: is the new window location.
2028: .Pp
1.1 nicm 2029: If
2030: .Fl d
2031: is given, the session does not make the new window the current window.
2032: .Ar target-window
1.28 nicm 2033: represents the window to be created; if the target already exists an error is
2034: shown, unless the
2035: .Fl k
2036: flag is used, in which case it is destroyed.
1.153 nicm 2037: .Ar shell-command
1.1 nicm 2038: is the command to execute.
2039: If
1.153 nicm 2040: .Ar shell-command
2041: is not specified, the value of the
2042: .Ic default-command
2043: option is used.
1.272 nicm 2044: .Fl c
2045: specifies the working directory in which the new window is created.
1.153 nicm 2046: .Pp
2047: When the shell command completes, the window closes.
2048: See the
2049: .Ic remain-on-exit
2050: option to change this behaviour.
1.1 nicm 2051: .Pp
1.641 nicm 2052: .Fl e
2053: takes the form
2054: .Ql VARIABLE=value
2055: and sets an environment variable for the newly created window; it may be
2056: specified multiple times.
2057: .Pp
1.1 nicm 2058: The
2059: .Ev TERM
2060: environment variable must be set to
1.523 nicm 2061: .Ql screen
2062: or
2063: .Ql tmux
1.1 nicm 2064: for all programs running
2065: .Em inside
2066: .Nm .
2067: New windows will automatically have
1.523 nicm 2068: .Ql TERM=screen
1.1 nicm 2069: added to their environment, but care must be taken not to reset this in shell
1.641 nicm 2070: start-up files or by the
2071: .Fl e
2072: option.
1.201 nicm 2073: .Pp
2074: The
2075: .Fl P
1.279 nicm 2076: option prints information about the new window after it has been created.
2077: By default, it uses the format
2078: .Ql #{session_name}:#{window_index}
2079: but a different format may be specified with
2080: .Fl F .
1.56 jmc 2081: .It Ic next-layout Op Fl t Ar target-window
1.1 nicm 2082: .D1 (alias: Ic nextl )
2083: Move a window to the next layout and rearrange the panes to fit.
2084: .It Xo Ic next-window
1.9 nicm 2085: .Op Fl a
1.1 nicm 2086: .Op Fl t Ar target-session
2087: .Xc
2088: .D1 (alias: Ic next )
2089: Move to the next window in the session.
1.9 nicm 2090: If
1.12 jmc 2091: .Fl a
1.295 nicm 2092: is used, move to the next window with an alert.
1.107 nicm 2093: .It Xo Ic pipe-pane
1.591 nicm 2094: .Op Fl IOo
1.107 nicm 2095: .Op Fl t Ar target-pane
1.153 nicm 2096: .Op Ar shell-command
1.107 nicm 2097: .Xc
2098: .D1 (alias: Ic pipep )
1.591 nicm 2099: Pipe output sent by the program in
1.107 nicm 2100: .Ar target-pane
1.591 nicm 2101: to a shell command or vice versa.
2102: A pane may only be connected to one command at a time, any existing pipe is
1.107 nicm 2103: closed before
1.153 nicm 2104: .Ar shell-command
1.107 nicm 2105: is executed.
1.174 nicm 2106: The
2107: .Ar shell-command
2108: string may contain the special character sequences supported by the
2109: .Ic status-left
1.231 nicm 2110: option.
1.107 nicm 2111: If no
1.153 nicm 2112: .Ar shell-command
1.107 nicm 2113: is given, the current pipe (if any) is closed.
1.591 nicm 2114: .Pp
2115: .Fl I
2116: and
2117: .Fl O
2118: specify which of the
2119: .Ar shell-command
2120: output streams are connected to the pane:
2121: with
2122: .Fl I
2123: stdout is connected (so anything
2124: .Ar shell-command
2125: prints is written to the pane as if it were typed);
2126: with
2127: .Fl O
2128: stdin is connected (so any output in the pane is piped to
2129: .Ar shell-command ) .
2130: Both may be used together and if neither are specified,
2131: .Fl O
2132: is used.
1.107 nicm 2133: .Pp
2134: The
2135: .Fl o
2136: option only opens a new pipe if no previous pipe exists, allowing a pipe to
2137: be toggled with a single key, for example:
2138: .Bd -literal -offset indent
1.174 nicm 2139: bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1.107 nicm 2140: .Ed
1.176 nicm 2141: .It Xo Ic previous-layout
2142: .Op Fl t Ar target-window
2143: .Xc
2144: .D1 (alias: Ic prevl )
2145: Move to the previous layout in the session.
1.1 nicm 2146: .It Xo Ic previous-window
1.9 nicm 2147: .Op Fl a
1.1 nicm 2148: .Op Fl t Ar target-session
2149: .Xc
2150: .D1 (alias: Ic prev )
2151: Move to the previous window in the session.
1.9 nicm 2152: With
2153: .Fl a ,
1.295 nicm 2154: move to the previous window with an alert.
1.1 nicm 2155: .It Xo Ic rename-window
2156: .Op Fl t Ar target-window
2157: .Ar new-name
2158: .Xc
2159: .D1 (alias: Ic renamew )
2160: Rename the current window, or the window at
2161: .Ar target-window
2162: if specified, to
2163: .Ar new-name .
2164: .It Xo Ic resize-pane
1.419 nicm 2165: .Op Fl DLMRUZ
1.52 nicm 2166: .Op Fl t Ar target-pane
1.324 nicm 2167: .Op Fl x Ar width
2168: .Op Fl y Ar height
1.1 nicm 2169: .Op Ar adjustment
2170: .Xc
2171: .D1 (alias: Ic resizep )
1.324 nicm 2172: Resize a pane, up, down, left or right by
2173: .Ar adjustment
2174: with
2175: .Fl U ,
1.57 jmc 2176: .Fl D ,
2177: .Fl L
1.324 nicm 2178: or
2179: .Fl R ,
2180: or
2181: to an absolute size
2182: with
2183: .Fl x
2184: or
2185: .Fl y .
1.57 jmc 2186: The
2187: .Ar adjustment
2188: is given in lines or cells (the default is 1).
1.337 nicm 2189: .Pp
2190: With
2191: .Fl Z ,
1.349 nicm 2192: the active pane is toggled between zoomed (occupying the whole of the window)
2193: and unzoomed (its normal position in the layout).
1.419 nicm 2194: .Pp
2195: .Fl M
2196: begins mouse resizing (only valid if bound to a mouse key binding, see
1.420 jmc 2197: .Sx MOUSE SUPPORT ) .
1.629 nicm 2198: .It Xo Ic resize-window
2199: .Op Fl aADLRU
2200: .Op Fl t Ar target-window
2201: .Op Fl x Ar width
2202: .Op Fl y Ar height
2203: .Op Ar adjustment
2204: .Xc
2205: .D1 (alias: Ic resizew )
2206: Resize a window, up, down, left or right by
2207: .Ar adjustment
2208: with
2209: .Fl U ,
2210: .Fl D ,
2211: .Fl L
2212: or
2213: .Fl R ,
2214: or
2215: to an absolute size
2216: with
2217: .Fl x
2218: or
2219: .Fl y .
2220: The
2221: .Ar adjustment
2222: is given in lines or cells (the default is 1).
2223: .Fl A
2224: sets the size of the largest session containing the window;
2225: .Fl a
2226: the size of the smallest.
2227: This command will automatically set
2228: .Ic window-size
2229: to manual in the window options.
1.234 nicm 2230: .It Xo Ic respawn-pane
1.641 nicm 2231: .Op Fl k
1.568 nicm 2232: .Op Fl c Ar start-directory
1.641 nicm 2233: .Op Fl e Ar environment
1.234 nicm 2234: .Op Fl t Ar target-pane
2235: .Op Ar shell-command
2236: .Xc
2237: .D1 (alias: Ic respawnp )
2238: Reactivate a pane in which the command has exited (see the
2239: .Ic remain-on-exit
2240: window option).
2241: If
2242: .Ar shell-command
2243: is not given, the command used when the pane was created is executed.
2244: The pane must be already inactive, unless
2245: .Fl k
2246: is given, in which case any existing command is killed.
1.568 nicm 2247: .Fl c
2248: specifies a new working directory for the pane.
1.641 nicm 2249: The
2250: .Fl e
2251: option has the same meaning as for the
2252: .Ic new-window
2253: command.
1.57 jmc 2254: .It Xo Ic respawn-window
1.641 nicm 2255: .Op Fl k
1.568 nicm 2256: .Op Fl c Ar start-directory
1.641 nicm 2257: .Op Fl e Ar environment
1.57 jmc 2258: .Op Fl t Ar target-window
1.153 nicm 2259: .Op Ar shell-command
1.57 jmc 2260: .Xc
2261: .D1 (alias: Ic respawnw )
1.153 nicm 2262: Reactivate a window in which the command has exited (see the
1.57 jmc 2263: .Ic remain-on-exit
2264: window option).
2265: If
1.153 nicm 2266: .Ar shell-command
1.57 jmc 2267: is not given, the command used when the window was created is executed.
2268: The window must be already inactive, unless
2269: .Fl k
2270: is given, in which case any existing command is killed.
1.568 nicm 2271: .Fl c
2272: specifies a new working directory for the window.
1.641 nicm 2273: The
2274: .Fl e
2275: option has the same meaning as for the
2276: .Ic new-window
2277: command.
1.57 jmc 2278: .It Xo Ic rotate-window
2279: .Op Fl DU
2280: .Op Fl t Ar target-window
2281: .Xc
2282: .D1 (alias: Ic rotatew )
2283: Rotate the positions of the panes within a window, either upward (numerically
2284: lower) with
2285: .Fl U
2286: or downward (numerically higher).
2287: .It Xo Ic select-layout
1.588 nicm 2288: .Op Fl Enop
2289: .Op Fl t Ar target-pane
1.57 jmc 2290: .Op Ar layout-name
2291: .Xc
1.176 nicm 2292: .D1 (alias: Ic selectl )
1.57 jmc 2293: Choose a specific layout for a window.
2294: If
2295: .Ar layout-name
1.181 nicm 2296: is not given, the last preset layout used (if any) is reapplied.
1.204 nicm 2297: .Fl n
2298: and
2299: .Fl p
2300: are equivalent to the
2301: .Ic next-layout
2302: and
2303: .Ic previous-layout
2304: commands.
1.424 nicm 2305: .Fl o
2306: applies the last set layout if possible (undoes the most recent layout change).
1.588 nicm 2307: .Fl E
2308: spreads the current pane and any panes next to it out evenly.
1.156 nicm 2309: .It Xo Ic select-pane
1.432 nicm 2310: .Op Fl DdegLlMmRU
1.418 nicm 2311: .Op Fl P Ar style
1.577 nicm 2312: .Op Fl T Ar title
1.156 nicm 2313: .Op Fl t Ar target-pane
2314: .Xc
1.57 jmc 2315: .D1 (alias: Ic selectp )
2316: Make pane
2317: .Ar target-pane
2318: the active pane in window
1.418 nicm 2319: .Ar target-window ,
1.420 jmc 2320: or set its style (with
1.418 nicm 2321: .Fl P ) .
1.156 nicm 2322: If one of
2323: .Fl D ,
2324: .Fl L ,
2325: .Fl R ,
2326: or
2327: .Fl U
2328: is used, respectively the pane below, to the left, to the right, or above the
2329: target pane is used.
1.204 nicm 2330: .Fl l
2331: is the same as using the
2332: .Ic last-pane
2333: command.
1.398 nicm 2334: .Fl e
2335: enables or
2336: .Fl d
2337: disables input to the pane.
1.418 nicm 2338: .Pp
1.432 nicm 2339: .Fl m
2340: and
2341: .Fl M
2342: are used to set and clear the
2343: .Em marked pane .
2344: There is one marked pane at a time, setting a new marked pane clears the last.
2345: The marked pane is the default target for
2346: .Fl s
2347: to
2348: .Ic join-pane ,
2349: .Ic swap-pane
2350: and
2351: .Ic swap-window .
2352: .Pp
1.418 nicm 2353: Each pane has a style: by default the
2354: .Ic window-style
2355: and
2356: .Ic window-active-style
2357: options are used,
2358: .Ic select-pane
2359: .Fl P
2360: sets the style for a single pane.
2361: For example, to set the pane 1 background to red:
2362: .Bd -literal -offset indent
2363: select-pane -t:.1 -P 'bg=red'
2364: .Ed
2365: .Pp
2366: .Fl g
2367: shows the current pane style.
1.577 nicm 2368: .Pp
2369: .Fl T
2370: sets the pane title.
1.204 nicm 2371: .It Xo Ic select-window
1.310 nicm 2372: .Op Fl lnpT
1.204 nicm 2373: .Op Fl t Ar target-window
2374: .Xc
1.57 jmc 2375: .D1 (alias: Ic selectw )
2376: Select the window at
2377: .Ar target-window .
1.204 nicm 2378: .Fl l ,
2379: .Fl n
2380: and
2381: .Fl p
2382: are equivalent to the
2383: .Ic last-window ,
2384: .Ic next-window
2385: and
2386: .Ic previous-window
2387: commands.
1.310 nicm 2388: If
2389: .Fl T
2390: is given and the selected window is already the current window,
2391: the command behaves like
2392: .Ic last-window .
1.57 jmc 2393: .It Xo Ic split-window
1.643 nicm 2394: .Op Fl bdfhIvP
1.272 nicm 2395: .Op Fl c Ar start-directory
1.641 nicm 2396: .Op Fl e Ar environment
1.57 jmc 2397: .Oo Fl l
2398: .Ar size |
2399: .Fl p Ar percentage Oc
1.136 nicm 2400: .Op Fl t Ar target-pane
1.153 nicm 2401: .Op Ar shell-command
1.279 nicm 2402: .Op Fl F Ar format
1.57 jmc 2403: .Xc
1.176 nicm 2404: .D1 (alias: Ic splitw )
1.136 nicm 2405: Create a new pane by splitting
2406: .Ar target-pane :
1.57 jmc 2407: .Fl h
2408: does a horizontal split and
2409: .Fl v
2410: a vertical split; if neither is specified,
2411: .Fl v
2412: is assumed.
2413: The
2414: .Fl l
2415: and
2416: .Fl p
1.136 nicm 2417: options specify the size of the new pane in lines (for vertical split) or in
1.57 jmc 2418: cells (for horizontal split), or as a percentage, respectively.
1.408 nicm 2419: The
2420: .Fl b
2421: option causes the new pane to be created to the left of or above
2422: .Ar target-pane .
1.494 nicm 2423: The
2424: .Fl f
2425: option creates a new pane spanning the full window height (with
2426: .Fl h )
2427: or full window width (with
2428: .Fl v ) ,
2429: instead of splitting the active pane.
1.643 nicm 2430: .Pp
2431: An empty
2432: .Ar shell-command
2433: ('') will create a pane with no command running in it.
2434: Output can be sent to such a pane with the
2435: .Ic display-message
2436: command.
2437: The
2438: .Fl I
2439: flag (if
2440: .Ar shell-command
2441: is not specified or empty)
2442: will create an empty pane and forward any output from stdin to it.
2443: For example:
2444: .Bd -literal -offset indent
2445: $ make 2>&1|tmux splitw -dI &
2446: .Ed
2447: .Pp
1.136 nicm 2448: All other options have the same meaning as for the
1.57 jmc 2449: .Ic new-window
2450: command.
2451: .It Xo Ic swap-pane
2452: .Op Fl dDU
2453: .Op Fl s Ar src-pane
2454: .Op Fl t Ar dst-pane
2455: .Xc
2456: .D1 (alias: Ic swapp )
2457: Swap two panes.
2458: If
2459: .Fl U
2460: is used and no source pane is specified with
2461: .Fl s ,
2462: .Ar dst-pane
2463: is swapped with the previous pane (before it numerically);
2464: .Fl D
2465: swaps with the next pane (after it numerically).
1.138 nicm 2466: .Fl d
2467: instructs
2468: .Nm
2469: not to change the active pane.
1.432 nicm 2470: .Pp
2471: If
2472: .Fl s
2473: is omitted and a marked pane is present (see
2474: .Ic select-pane
2475: .Fl m ) ,
2476: the marked pane is used rather than the current pane.
1.57 jmc 2477: .It Xo Ic swap-window
2478: .Op Fl d
2479: .Op Fl s Ar src-window
2480: .Op Fl t Ar dst-window
2481: .Xc
2482: .D1 (alias: Ic swapw )
2483: This is similar to
2484: .Ic link-window ,
2485: except the source and destination windows are swapped.
2486: It is an error if no window exists at
2487: .Ar src-window .
1.432 nicm 2488: .Pp
2489: Like
2490: .Ic swap-pane ,
2491: if
2492: .Fl s
2493: is omitted and a marked pane is present (see
2494: .Ic select-pane
2495: .Fl m ) ,
2496: the window containing the marked pane is used rather than the current window.
1.57 jmc 2497: .It Xo Ic unlink-window
1.1 nicm 2498: .Op Fl k
2499: .Op Fl t Ar target-window
2500: .Xc
1.57 jmc 2501: .D1 (alias: Ic unlinkw )
2502: Unlink
2503: .Ar target-window .
2504: Unless
2505: .Fl k
2506: is given, a window may be unlinked only if it is linked to multiple sessions -
2507: windows may not be linked to no sessions;
2508: if
1.1 nicm 2509: .Fl k
1.57 jmc 2510: is specified and the window is linked to only one session, it is unlinked and
2511: destroyed.
2512: .El
2513: .Sh KEY BINDINGS
1.93 nicm 2514: .Nm
2515: allows a command to be bound to most keys, with or without a prefix key.
2516: When specifying keys, most represent themselves (for example
2517: .Ql A
2518: to
1.95 jmc 2519: .Ql Z ) .
1.93 nicm 2520: Ctrl keys may be prefixed with
2521: .Ql C-
2522: or
1.95 jmc 2523: .Ql ^ ,
2524: and Alt (meta) with
1.93 nicm 2525: .Ql M- .
2526: In addition, the following special key names are accepted:
1.126 nicm 2527: .Em Up ,
2528: .Em Down ,
2529: .Em Left ,
2530: .Em Right ,
1.93 nicm 2531: .Em BSpace ,
2532: .Em BTab ,
2533: .Em DC
2534: (Delete),
2535: .Em End ,
2536: .Em Enter ,
2537: .Em Escape ,
2538: .Em F1
2539: to
1.402 nicm 2540: .Em F12 ,
1.93 nicm 2541: .Em Home ,
2542: .Em IC
2543: (Insert),
1.254 nicm 2544: .Em NPage/PageDown/PgDn ,
2545: .Em PPage/PageUp/PgUp ,
1.93 nicm 2546: .Em Space ,
2547: and
2548: .Em Tab .
2549: Note that to bind the
2550: .Ql \&"
2551: or
2552: .Ql '
2553: keys, quotation marks are necessary, for example:
2554: .Bd -literal -offset indent
2555: bind-key '"' split-window
1.167 nicm 2556: bind-key "'" new-window
1.93 nicm 2557: .Ed
2558: .Pp
1.57 jmc 2559: Commands related to key bindings are as follows:
2560: .Bl -tag -width Ds
2561: .It Xo Ic bind-key
1.501 nicm 2562: .Op Fl nr
1.421 nicm 2563: .Op Fl T Ar key-table
1.57 jmc 2564: .Ar key Ar command Op Ar arguments
1.1 nicm 2565: .Xc
1.57 jmc 2566: .D1 (alias: Ic bind )
2567: Bind key
2568: .Ar key
2569: to
2570: .Ar command .
1.421 nicm 2571: Keys are bound in a key table.
2572: By default (without -T), the key is bound in
2573: the
2574: .Em prefix
2575: key table.
2576: This table is used for keys pressed after the prefix key (for example,
2577: by default
2578: .Ql c
2579: is bound to
2580: .Ic new-window
2581: in the
2582: .Em prefix
2583: table, so
2584: .Ql C-b c
2585: creates a new window).
2586: The
2587: .Em root
2588: table is used for keys pressed without the prefix key: binding
2589: .Ql c
2590: to
2591: .Ic new-window
2592: in the
2593: .Em root
2594: table (not recommended) means a plain
2595: .Ql c
2596: will create a new window.
1.57 jmc 2597: .Fl n
1.421 nicm 2598: is an alias
2599: for
2600: .Fl T Ar root .
2601: Keys may also be bound in custom key tables and the
2602: .Ic switch-client
2603: .Fl T
2604: command used to switch to them from a key binding.
1.1 nicm 2605: The
1.57 jmc 2606: .Fl r
2607: flag indicates this key may repeat, see the
2608: .Ic repeat-time
2609: option.
2610: .Pp
2611: To view the default bindings and possible commands, see the
2612: .Ic list-keys
2613: command.
1.421 nicm 2614: .It Xo Ic list-keys
2615: .Op Fl T Ar key-table
2616: .Xc
1.57 jmc 2617: .D1 (alias: Ic lsk )
2618: List all key bindings.
2619: Without
1.421 nicm 2620: .Fl T
2621: all key tables are printed.
2622: With
2623: .Fl T
2624: only
2625: .Ar key-table .
1.57 jmc 2626: .It Xo Ic send-keys
1.497 nicm 2627: .Op Fl lMRX
2628: .Op Fl N Ar repeat-count
1.72 nicm 2629: .Op Fl t Ar target-pane
1.57 jmc 2630: .Ar key Ar ...
1.1 nicm 2631: .Xc
1.57 jmc 2632: .D1 (alias: Ic send )
2633: Send a key or keys to a window.
2634: Each argument
2635: .Ar key
2636: is the name of the key (such as
2637: .Ql C-a
2638: or
1.523 nicm 2639: .Ql NPage )
2640: to send; if the string is not recognised as a key, it is sent as a series of
1.57 jmc 2641: characters.
1.273 nicm 2642: The
2643: .Fl l
2644: flag disables key name lookup and sends the keys literally.
1.57 jmc 2645: All arguments are sent sequentially from first to last.
1.265 nicm 2646: The
2647: .Fl R
2648: flag causes the terminal state to be reset.
1.419 nicm 2649: .Pp
2650: .Fl M
2651: passes through a mouse event (only valid if bound to a mouse key binding, see
1.420 jmc 2652: .Sx MOUSE SUPPORT ) .
1.497 nicm 2653: .Pp
2654: .Fl X
2655: is used to send a command into copy mode - see
2656: the
2657: .Sx WINDOWS AND PANES
2658: section.
2659: .Fl N
1.516 nicm 2660: specifies a repeat count.
1.267 nicm 2661: .It Xo Ic send-prefix
2662: .Op Fl 2
2663: .Op Fl t Ar target-pane
2664: .Xc
2665: Send the prefix key, or with
2666: .Fl 2
2667: the secondary prefix key, to a window as if it was pressed.
1.57 jmc 2668: .It Xo Ic unbind-key
1.501 nicm 2669: .Op Fl an
1.421 nicm 2670: .Op Fl T Ar key-table
1.57 jmc 2671: .Ar key
1.2 nicm 2672: .Xc
1.57 jmc 2673: .D1 (alias: Ic unbind )
2674: Unbind the command bound to
2675: .Ar key .
1.530 nicm 2676: .Fl n
2677: and
1.421 nicm 2678: .Fl T
2679: are the same as for
2680: .Ic bind-key .
1.189 nicm 2681: If
2682: .Fl a
2683: is present, all key bindings are removed.
1.57 jmc 2684: .El
2685: .Sh OPTIONS
2686: The appearance and behaviour of
2687: .Nm
2688: may be modified by changing the value of various options.
1.133 nicm 2689: There are three types of option:
2690: .Em server options ,
1.57 jmc 2691: .Em session options
2692: and
2693: .Em window options .
2694: .Pp
1.133 nicm 2695: The
2696: .Nm
2697: server has a set of global options which do not apply to any particular
2698: window or session.
2699: These are altered with the
2700: .Ic set-option
2701: .Fl s
2702: command, or displayed with the
2703: .Ic show-options
2704: .Fl s
2705: command.
2706: .Pp
2707: In addition, each individual session may have a set of session options, and
2708: there is a separate set of global session options.
1.57 jmc 2709: Sessions which do not have a particular option configured inherit the value
2710: from the global session options.
2711: Session options are set or unset with the
2712: .Ic set-option
2713: command and may be listed with the
2714: .Ic show-options
2715: command.
1.133 nicm 2716: The available server and session options are listed under the
1.57 jmc 2717: .Ic set-option
2718: command.
2719: .Pp
2720: Similarly, a set of window options is attached to each window, and there is
2721: a set of global window options from which any unset options are inherited.
2722: Window options are altered with the
2723: .Ic set-window-option
2724: command and can be listed with the
2725: .Ic show-window-options
2726: command.
2727: All window options are documented with the
2728: .Ic set-window-option
2729: command.
1.318 nicm 2730: .Pp
2731: .Nm
2732: also supports user options which are prefixed with a
2733: .Ql \&@ .
1.321 jmc 2734: User options may have any name, so long as they are prefixed with
2735: .Ql \&@ ,
1.318 nicm 2736: and be set to any string.
1.418 nicm 2737: For example:
1.318 nicm 2738: .Bd -literal -offset indent
2739: $ tmux setw -q @foo "abc123"
2740: $ tmux showw -v @foo
2741: abc123
2742: .Ed
1.57 jmc 2743: .Pp
2744: Commands which set options are as follows:
2745: .Bl -tag -width Ds
1.1 nicm 2746: .It Xo Ic set-option
1.550 nicm 2747: .Op Fl aFgoqsuw
1.129 nicm 2748: .Op Fl t Ar target-session | Ar target-window
1.1 nicm 2749: .Ar option Ar value
2750: .Xc
2751: .D1 (alias: Ic set )
1.133 nicm 2752: Set a window option with
2753: .Fl w
2754: (equivalent to the
2755: .Ic set-window-option
2756: command),
2757: a server option with
2758: .Fl s ,
2759: otherwise a session option.
1.637 nicm 2760: If the option is not a user option,
2761: .Fl w
2762: and
2763: .Fl s
2764: are unnecessary -
2765: .Nm
2766: will infer the type from the option name.
1.133 nicm 2767: If
2768: .Fl g
1.433 nicm 2769: is given, the global session or window option is set.
1.637 nicm 2770: .Pp
1.550 nicm 2771: .Fl F
2772: expands formats in the option value.
1.1 nicm 2773: The
2774: .Fl u
2775: flag unsets an option, so a session inherits the option from the global
1.433 nicm 2776: options (or with
2777: .Fl g ,
2778: restores a global option to the default).
1.336 nicm 2779: .Pp
2780: The
2781: .Fl o
1.446 nicm 2782: flag prevents setting an option that is already set and the
1.281 nicm 2783: .Fl q
1.446 nicm 2784: flag suppresses errors about unknown or ambiguous options.
1.281 nicm 2785: .Pp
1.378 nicm 2786: With
2787: .Fl a ,
2788: and if the option expects a string or a style,
2789: .Ar value
2790: is appended to the existing setting.
2791: For example:
2792: .Bd -literal -offset indent
2793: set -g status-left "foo"
2794: set -ag status-left "bar"
2795: .Ed
2796: .Pp
2797: Will result in
2798: .Ql foobar .
2799: And:
2800: .Bd -literal -offset indent
2801: set -g status-style "bg=red"
2802: set -ag status-style "fg=blue"
2803: .Ed
2804: .Pp
2805: Will result in a red background
2806: .Em and
2807: blue foreground.
2808: Without
2809: .Fl a ,
2810: the result would be the default background and a blue foreground.
2811: .Pp
1.133 nicm 2812: Available window options are listed under
2813: .Ic set-window-option .
1.274 nicm 2814: .Pp
2815: .Ar value
2816: depends on the option and may be a number, a string, or a flag (on, off, or
2817: omitted to toggle).
1.133 nicm 2818: .Pp
2819: Available server options are:
2820: .Bl -tag -width Ds
1.198 nicm 2821: .It Ic buffer-limit Ar number
2822: Set the number of buffers; as new buffers are added to the top of the stack,
2823: old ones are removed from the bottom if necessary to maintain this maximum
2824: length.
1.526 nicm 2825: .It Xo Ic command-alias[]
2826: .Ar name=value
2827: .Xc
2828: This is an array of custom aliases for commands.
2829: If an unknown command matches
2830: .Ar name ,
2831: it is replaced with
2832: .Ar value .
2833: For example, after:
2834: .Pp
1.565 nicm 2835: .Dl set -s command-alias[100] zoom='resize-pane -Z'
1.526 nicm 2836: .Pp
2837: Using:
2838: .Pp
2839: .Dl zoom -t:.1
2840: .Pp
2841: Is equivalent to:
2842: .Pp
2843: .Dl resize-pane -Z -t:.1
2844: .Pp
2845: Note that aliases are expanded when a command is parsed rather than when it is
2846: executed, so binding an alias with
2847: .Ic bind-key
2848: will bind the expanded form.
1.425 nicm 2849: .It Ic default-terminal Ar terminal
2850: Set the default terminal for new windows created in this session - the
2851: default value of the
2852: .Ev TERM
2853: environment variable.
2854: For
2855: .Nm
2856: to work correctly, this
2857: .Em must
2858: be set to
2859: .Ql screen ,
2860: .Ql tmux
2861: or a derivative of them.
1.239 nicm 2862: .It Ic escape-time Ar time
2863: Set the time in milliseconds for which
2864: .Nm
2865: waits after an escape is input to determine if it is part of a function or meta
2866: key sequences.
2867: The default is 500 milliseconds.
1.592 nicm 2868: .It Xo Ic exit-empty
2869: .Op Ic on | off
2870: .Xc
2871: If enabled (the default), the server will exit when there are no active
2872: sessions.
1.239 nicm 2873: .It Xo Ic exit-unattached
2874: .Op Ic on | off
2875: .Xc
2876: If enabled, the server will exit when there are no attached clients.
1.362 nicm 2877: .It Xo Ic focus-events
2878: .Op Ic on | off
2879: .Xc
2880: When enabled, focus events are requested from the terminal if supported and
2881: passed through to applications running in
2882: .Nm .
2883: Attached clients should be detached and attached again after changing this
2884: option.
1.445 nicm 2885: .It Ic history-file Ar path
2886: If not empty, a file to which
2887: .Nm
2888: will write command prompt history on exit and load it from on start.
1.384 nicm 2889: .It Ic message-limit Ar number
2890: Set the number of error or information messages to save in the message log for
2891: each client.
2892: The default is 100.
1.228 nicm 2893: .It Xo Ic set-clipboard
1.556 nicm 2894: .Op Ic on | external | off
1.228 nicm 2895: .Xc
2896: Attempt to set the terminal clipboard content using the
2897: .Xr xterm 1
1.560 nicm 2898: escape sequence, if there is an
1.228 nicm 2899: .Em \&Ms
2900: entry in the
2901: .Xr terminfo 5
1.560 nicm 2902: description (see the
2903: .Sx TERMINFO EXTENSIONS
2904: section).
2905: .Pp
1.556 nicm 2906: If set to
2907: .Ic on ,
2908: .Nm
2909: will both accept the escape sequence to create a buffer and attempt to set
2910: the terminal clipboard.
2911: If set to
2912: .Ic external ,
2913: .Nm
2914: will attempt to set the terminal clipboard but ignore attempts
2915: by applications to set
2916: .Nm
2917: buffers.
2918: If
2919: .Ic off ,
2920: .Nm
2921: will neither accept the clipboard escape sequence nor attempt to set the
2922: clipboard.
2923: .Pp
1.228 nicm 2924: Note that this feature needs to be enabled in
2925: .Xr xterm 1
2926: by setting the resource:
2927: .Bd -literal -offset indent
2928: disallowedWindowOps: 20,21,SetXprop
2929: .Ed
2930: .Pp
2931: Or changing this property from the
2932: .Xr xterm 1
2933: interactive menu when required.
1.528 nicm 2934: .It Ic terminal-overrides[] Ar string
2935: Allow terminal descriptions read using
2936: .Xr terminfo 5
1.531 nicm 2937: to be overridden.
1.528 nicm 2938: Each entry is a colon-separated string made up of a terminal type pattern
2939: (matched using
1.381 nicm 2940: .Xr fnmatch 3 )
2941: and a set of
2942: .Em name=value
2943: entries.
2944: .Pp
2945: For example, to set the
2946: .Ql clear
2947: .Xr terminfo 5
2948: entry to
2949: .Ql \ee[H\ee[2J
1.528 nicm 2950: for all terminal types matching
2951: .Ql rxvt* :
2952: .Pp
2953: .Dl "rxvt*:clear=\ee[H\ee[2J"
1.381 nicm 2954: .Pp
2955: The terminal entry value is passed through
2956: .Xr strunvis 3
2957: before interpretation.
1.133 nicm 2958: .El
1.129 nicm 2959: .Pp
1.18 nicm 2960: Available session options are:
1.1 nicm 2961: .Bl -tag -width Ds
1.569 nicm 2962: .It Xo Ic activity-action
2963: .Op Ic any | none | current | other
2964: .Xc
2965: Set action on window activity when
2966: .Ic monitor-activity
2967: is on.
2968: .Ic any
2969: means activity in any window linked to a session causes a bell or message
2970: (depending on
2971: .Ic visual-activity )
2972: in the current window of that session,
2973: .Ic none
2974: means all activity is ignored (equivalent to
2975: .Ic monitor-activity
2976: being off),
2977: .Ic current
2978: means only activity in windows other than the current window are ignored and
2979: .Ic other
2980: means activity in the current window is ignored but not those in other windows.
1.312 nicm 2981: .It Ic assume-paste-time Ar milliseconds
2982: If keys are entered faster than one in
2983: .Ar milliseconds ,
2984: they are assumed to have been pasted rather than typed and
2985: .Nm
2986: key bindings are not processed.
2987: The default is one millisecond and zero disables.
1.69 nicm 2988: .It Ic base-index Ar index
2989: Set the base index from which an unused index should be searched when a new
2990: window is created.
2991: The default is zero.
1.1 nicm 2992: .It Xo Ic bell-action
1.429 nicm 2993: .Op Ic any | none | current | other
1.1 nicm 2994: .Xc
1.574 nicm 2995: Set action on a bell in a window when
2996: .Ic monitor-bell
2997: is on.
1.569 nicm 2998: The values are the same as those for
2999: .Ic activity-action .
1.153 nicm 3000: .It Ic default-command Ar shell-command
1.1 nicm 3001: Set the command used for new windows (if not specified when the window is
3002: created) to
1.153 nicm 3003: .Ar shell-command ,
1.79 nicm 3004: which may be any
3005: .Xr sh 1
3006: command.
1.19 nicm 3007: The default is an empty string, which instructs
3008: .Nm
1.79 nicm 3009: to create a login shell using the value of the
3010: .Ic default-shell
3011: option.
3012: .It Ic default-shell Ar path
3013: Specify the default shell.
3014: This is used as the login shell for new windows when the
3015: .Ic default-command
3016: option is set to empty, and must be the full path of the executable.
3017: When started
3018: .Nm
3019: tries to set a default value from the first suitable of the
1.19 nicm 3020: .Ev SHELL
1.79 nicm 3021: environment variable, the shell returned by
3022: .Xr getpwuid 3 ,
3023: or
3024: .Pa /bin/sh .
3025: This option should be configured when
3026: .Nm
3027: is used as a login shell.
1.629 nicm 3028: .It Ic default-size Ar XxY
1.642 nicm 3029: Set the default size of new windows when the
1.643 nicm 3030: .Ic window-size
1.642 nicm 3031: option is set to manual or when a session is created with
3032: .Ic new-session
3033: .Fl d .
3034: The value is the width and height separated by an
3035: .Ql x
3036: character.
3037: The default is 80x24.
1.206 nicm 3038: .It Xo Ic destroy-unattached
3039: .Op Ic on | off
3040: .Xc
1.185 nicm 3041: If enabled and the session is no longer attached to any clients, it is
3042: destroyed.
1.206 nicm 3043: .It Xo Ic detach-on-destroy
3044: .Op Ic on | off
3045: .Xc
1.184 nicm 3046: If on (the default), the client is detached when the session it is attached to
3047: is destroyed.
3048: If off, the client is switched to the most recently active of the remaining
3049: sessions.
1.145 nicm 3050: .It Ic display-panes-active-colour Ar colour
3051: Set the colour used by the
3052: .Ic display-panes
3053: command to show the indicator for the active pane.
1.78 nicm 3054: .It Ic display-panes-colour Ar colour
1.145 nicm 3055: Set the colour used by the
1.78 nicm 3056: .Ic display-panes
1.145 nicm 3057: command to show the indicators for inactive panes.
1.78 nicm 3058: .It Ic display-panes-time Ar time
3059: Set the time in milliseconds for which the indicators shown by the
3060: .Ic display-panes
3061: command appear.
1.21 nicm 3062: .It Ic display-time Ar time
1.78 nicm 3063: Set the amount of time for which status line messages and other on-screen
3064: indicators are displayed.
1.462 tim 3065: If set to 0, messages and indicators are displayed until a key is pressed.
1.21 nicm 3066: .Ar time
3067: is in milliseconds.
1.1 nicm 3068: .It Ic history-limit Ar lines
3069: Set the maximum number of lines held in window history.
3070: This setting applies only to new windows - existing window histories are not
3071: resized and retain the limit at the point they were created.
1.474 nicm 3072: .It Ic key-table Ar key-table
3073: Set the default key table to
3074: .Ar key-table
3075: instead of
3076: .Em root .
1.1 nicm 3077: .It Ic lock-after-time Ar number
1.100 nicm 3078: Lock the session (like the
3079: .Ic lock-session
1.90 nicm 3080: command) after
1.1 nicm 3081: .Ar number
1.448 nicm 3082: seconds of inactivity.
1.100 nicm 3083: The default is not to lock (set to 0).
1.153 nicm 3084: .It Ic lock-command Ar shell-command
1.90 nicm 3085: Command to run when locking each client.
3086: The default is to run
3087: .Xr lock 1
3088: with
3089: .Fl np .
1.378 nicm 3090: .It Ic message-command-style Ar style
1.623 nicm 3091: Set status line message command style.
3092: For how to specify
3093: .Ar style ,
3094: see the
3095: .Sx STYLES
3096: section.
1.378 nicm 3097: .It Ic message-style Ar style
3098: Set status line message style.
3099: For how to specify
3100: .Ar style ,
3101: see the
1.623 nicm 3102: .Sx STYLES
3103: section.
1.419 nicm 3104: .It Xo Ic mouse
1.226 nicm 3105: .Op Ic on | off
3106: .Xc
3107: If on,
3108: .Nm
1.419 nicm 3109: captures the mouse and allows mouse events to be bound as key bindings.
3110: See the
3111: .Sx MOUSE SUPPORT
3112: section for details.
1.267 nicm 3113: .It Ic prefix Ar key
3114: Set the key accepted as a prefix key.
1.473 nicm 3115: In addition to the standard keys described under
3116: .Sx KEY BINDINGS ,
3117: .Ic prefix
3118: can be set to the special key
3119: .Ql None
3120: to set no prefix.
1.267 nicm 3121: .It Ic prefix2 Ar key
3122: Set a secondary key accepted as a prefix key.
1.473 nicm 3123: Like
3124: .Ic prefix ,
3125: .Ic prefix2
3126: can be set to
3127: .Ql None .
1.291 nicm 3128: .It Xo Ic renumber-windows
3129: .Op Ic on | off
3130: .Xc
3131: If on, when a window is closed in a session, automatically renumber the other
3132: windows in numerical order.
3133: This respects the
3134: .Ic base-index
3135: option if it has been set.
3136: If off, do not renumber the windows.
1.21 nicm 3137: .It Ic repeat-time Ar time
1.1 nicm 3138: Allow multiple commands to be entered without pressing the prefix-key again
3139: in the specified
1.21 nicm 3140: .Ar time
1.1 nicm 3141: milliseconds (the default is 500).
3142: Whether a key repeats may be set when it is bound using the
3143: .Fl r
3144: flag to
3145: .Ic bind-key .
1.52 nicm 3146: Repeat is enabled for the default keys bound to the
3147: .Ic resize-pane
3148: command.
1.1 nicm 3149: .It Xo Ic set-titles
1.56 jmc 3150: .Op Ic on | off
1.1 nicm 3151: .Xc
1.261 nicm 3152: Attempt to set the client terminal title using the
3153: .Em tsl
3154: and
3155: .Em fsl
3156: .Xr terminfo 5
3157: entries if they exist.
3158: .Nm
1.444 nicm 3159: automatically sets these to the \ee]0;...\e007 sequence if
3160: the terminal appears to be
3161: .Xr xterm 1 .
1.11 nicm 3162: This option is off by default.
1.86 nicm 3163: .It Ic set-titles-string Ar string
3164: String used to set the window title if
3165: .Ic set-titles
3166: is on.
1.414 nicm 3167: Formats are expanded, see the
3168: .Sx FORMATS
3169: section.
1.569 nicm 3170: .It Xo Ic silence-action
3171: .Op Ic any | none | current | other
3172: .Xc
3173: Set action on window silence when
3174: .Ic monitor-silence
3175: is on.
3176: The values are the same as those for
3177: .Ic activity-action .
1.1 nicm 3178: .It Xo Ic status
1.625 nicm 3179: .Op Ic off | on | 2 | 3 | 4 | 5
1.1 nicm 3180: .Xc
1.625 nicm 3181: Show or hide the status line or specify its size.
3182: Using
3183: .Ic on
3184: gives a status line one row in height;
3185: .Ic 2 ,
3186: .Ic 3 ,
3187: .Ic 4
3188: or
3189: .Ic 5
3190: more rows.
3191: .It Ic status-format[] Ar format
3192: Specify the format to be used for each line of the status line.
3193: The default builds the top status line from the various individual status
3194: options below.
1.1 nicm 3195: .It Ic status-interval Ar interval
1.538 nicm 3196: Update the status line every
1.1 nicm 3197: .Ar interval
3198: seconds.
3199: By default, updates will occur every 15 seconds.
3200: A setting of zero disables redrawing at interval.
1.41 nicm 3201: .It Xo Ic status-justify
1.56 jmc 3202: .Op Ic left | centre | right
1.41 nicm 3203: .Xc
3204: Set the position of the window list component of the status line: left, centre
3205: or right justified.
1.1 nicm 3206: .It Xo Ic status-keys
1.56 jmc 3207: .Op Ic vi | emacs
1.1 nicm 3208: .Xc
1.6 jmc 3209: Use vi or emacs-style
1.1 nicm 3210: key bindings in the status line, for example at the command prompt.
1.191 nicm 3211: The default is emacs, unless the
3212: .Ev VISUAL
3213: or
3214: .Ev EDITOR
3215: environment variables are set and contain the string
3216: .Ql vi .
1.1 nicm 3217: .It Ic status-left Ar string
3218: Display
3219: .Ar string
1.538 nicm 3220: (by default the session name) to the left of the status line.
1.1 nicm 3221: .Ar string
3222: will be passed through
1.623 nicm 3223: .Xr strftime 3 .
3224: Also see the
3225: .Sx FORMATS
3226: and
3227: .Sx STYLES
3228: sections.
1.83 nicm 3229: .Pp
1.263 nicm 3230: For details on how the names and titles can be set see the
1.261 nicm 3231: .Sx "NAMES AND TITLES"
3232: section.
1.109 nicm 3233: .Pp
1.83 nicm 3234: Examples are:
3235: .Bd -literal -offset indent
3236: #(sysctl vm.loadavg)
3237: #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
3238: .Ed
1.10 nicm 3239: .Pp
1.405 nicm 3240: The default is
3241: .Ql "[#S] " .
1.1 nicm 3242: .It Ic status-left-length Ar length
3243: Set the maximum
3244: .Ar length
1.538 nicm 3245: of the left component of the status line.
1.1 nicm 3246: The default is 10.
1.378 nicm 3247: .It Ic status-left-style Ar style
3248: Set the style of the left part of the status line.
3249: For how to specify
3250: .Ar style ,
3251: see the
1.623 nicm 3252: .Sx STYLES
3253: section.
1.269 nicm 3254: .It Xo Ic status-position
3255: .Op Ic top | bottom
3256: .Xc
3257: Set the position of the status line.
1.1 nicm 3258: .It Ic status-right Ar string
3259: Display
3260: .Ar string
1.538 nicm 3261: to the right of the status line.
1.577 nicm 3262: By default, the current pane title in double quotes, the date and the time
1.151 nicm 3263: are shown.
1.1 nicm 3264: As with
3265: .Ic status-left ,
3266: .Ar string
3267: will be passed to
1.459 jmc 3268: .Xr strftime 3
3269: and character pairs are replaced.
1.1 nicm 3270: .It Ic status-right-length Ar length
3271: Set the maximum
3272: .Ar length
1.538 nicm 3273: of the right component of the status line.
1.1 nicm 3274: The default is 40.
1.378 nicm 3275: .It Ic status-right-style Ar style
3276: Set the style of the right part of the status line.
3277: For how to specify
3278: .Ar style ,
3279: see the
1.623 nicm 3280: .Sx STYLES
3281: section.
1.378 nicm 3282: .It Ic status-style Ar style
3283: Set status line style.
3284: For how to specify
3285: .Ar style ,
3286: see the
1.623 nicm 3287: .Sx STYLES
3288: section.
1.529 nicm 3289: .It Ic update-environment[] Ar variable
3290: Set list of environment variables to be copied into the session environment
3291: when a new session is created or an existing session is attached.
1.63 nicm 3292: Any variables that do not exist in the source environment are set to be
3293: removed from the session environment (as if
3294: .Fl r
3295: was given to the
3296: .Ic set-environment
3297: command).
1.563 nicm 3298: .It Ic user-keys[] Ar key
3299: Set list of user-defined key escape sequences.
3300: Each item is associated with a key named
1.564 nicm 3301: .Ql User0 ,
3302: .Ql User1 ,
1.563 nicm 3303: and so on.
3304: .Pp
3305: For example:
3306: .Bd -literal -offset indent
1.575 nicm 3307: set -s user-keys[0] "\ee[5;30012~"
1.563 nicm 3308: bind User0 resize-pane -L 3
3309: .Ed
1.37 nicm 3310: .It Xo Ic visual-activity
1.569 nicm 3311: .Op Ic on | off | both
1.37 nicm 3312: .Xc
1.569 nicm 3313: If on, display a message instead of sending a bell when activity occurs in a
3314: window for which the
1.37 nicm 3315: .Ic monitor-activity
3316: window option is enabled.
1.569 nicm 3317: If set to both, a bell and a message are produced.
1.37 nicm 3318: .It Xo Ic visual-bell
1.569 nicm 3319: .Op Ic on | off | both
1.37 nicm 3320: .Xc
1.574 nicm 3321: If on, a message is shown on a bell in a window for which the
3322: .Ic monitor-bell
3323: window option is enabled instead of it being passed through to the
1.569 nicm 3324: terminal (which normally makes a sound).
3325: If set to both, a bell and a message are produced.
1.37 nicm 3326: Also see the
3327: .Ic bell-action
3328: option.
1.192 nicm 3329: .It Xo Ic visual-silence
1.569 nicm 3330: .Op Ic on | off | both
1.192 nicm 3331: .Xc
3332: If
3333: .Ic monitor-silence
1.569 nicm 3334: is enabled, prints a message after the interval has expired on a given window
3335: instead of sending a bell.
3336: If set to both, a bell and a message are produced.
1.255 nicm 3337: .It Ic word-separators Ar string
3338: Sets the session's conception of what characters are considered word
3339: separators, for the purposes of the next and previous word commands in
3340: copy mode.
3341: The default is
3342: .Ql \ -_@ .
1.1 nicm 3343: .El
3344: .It Xo Ic set-window-option
1.550 nicm 3345: .Op Fl aFgoqu
1.1 nicm 3346: .Op Fl t Ar target-window
3347: .Ar option Ar value
3348: .Xc
3349: .D1 (alias: Ic setw )
1.18 nicm 3350: Set a window option.
1.1 nicm 3351: The
1.58 nicm 3352: .Fl a ,
1.550 nicm 3353: .Fl F ,
1.281 nicm 3354: .Fl g ,
1.356 nicm 3355: .Fl o ,
1.281 nicm 3356: .Fl q
1.1 nicm 3357: and
3358: .Fl u
3359: flags work similarly to the
3360: .Ic set-option
3361: command.
3362: .Pp
1.18 nicm 3363: Supported window options are:
1.56 jmc 3364: .Pp
3365: .Bl -tag -width Ds -compact
1.1 nicm 3366: .It Xo Ic aggressive-resize
1.56 jmc 3367: .Op Ic on | off
1.1 nicm 3368: .Xc
3369: Aggressively resize the chosen window.
3370: This means that
3371: .Nm
1.642 nicm 3372: will resize the window to the size of the smallest or largest session
3373: (see the
3374: .Ic window-size
3375: option) for which it is the current window, rather than the session to
3376: which it is attached.
3377: The window may resize when the current window is changed on another
3378: session; this option is good for full-screen programs which support
1.6 jmc 3379: .Dv SIGWINCH
3380: and poor for interactive programs such as shells.
1.262 nicm 3381: .Pp
3382: .It Xo Ic allow-rename
3383: .Op Ic on | off
3384: .Xc
3385: Allow programs to change the window name using a terminal escape
1.478 nicm 3386: sequence (\eek...\ee\e\e).
1.583 nicm 3387: The default is off.
1.56 jmc 3388: .Pp
1.196 nicm 3389: .It Xo Ic alternate-screen
3390: .Op Ic on | off
3391: .Xc
3392: This option configures whether programs running inside
3393: .Nm
3394: may use the terminal alternate screen feature, which allows the
3395: .Em smcup
3396: and
3397: .Em rmcup
3398: .Xr terminfo 5
1.209 nicm 3399: capabilities.
3400: The alternate screen feature preserves the contents of the window when an
3401: interactive application starts and restores it on exit, so that any output
3402: visible before the application starts reappears unchanged after it exits.
3403: The default is on.
1.196 nicm 3404: .Pp
1.1 nicm 3405: .It Xo Ic automatic-rename
1.56 jmc 3406: .Op Ic on | off
1.1 nicm 3407: .Xc
3408: Control automatic window renaming.
3409: When this setting is enabled,
3410: .Nm
1.368 nicm 3411: will rename the window automatically using the format specified by
3412: .Ic automatic-rename-format .
1.1 nicm 3413: This flag is automatically disabled for an individual window when a name
3414: is specified at creation with
1.186 nicm 3415: .Ic new-window
3416: or
1.1 nicm 3417: .Ic new-session ,
3418: or later with
1.261 nicm 3419: .Ic rename-window ,
3420: or with a terminal escape sequence.
1.1 nicm 3421: It may be switched off globally with:
3422: .Bd -literal -offset indent
3423: set-window-option -g automatic-rename off
3424: .Ed
1.368 nicm 3425: .Pp
3426: .It Ic automatic-rename-format Ar format
3427: The format (see
3428: .Sx FORMATS )
3429: used when the
3430: .Ic automatic-rename
3431: option is enabled.
1.56 jmc 3432: .Pp
1.1 nicm 3433: .It Ic clock-mode-colour Ar colour
3434: Set clock colour.
1.56 jmc 3435: .Pp
1.1 nicm 3436: .It Xo Ic clock-mode-style
1.56 jmc 3437: .Op Ic 12 | 24
1.1 nicm 3438: .Xc
3439: Set clock hour format.
1.56 jmc 3440: .Pp
1.196 nicm 3441: .It Ic main-pane-height Ar height
1.2 nicm 3442: .It Ic main-pane-width Ar width
3443: Set the width or height of the main (left or top) pane in the
3444: .Ic main-horizontal
3445: or
3446: .Ic main-vertical
3447: layouts.
1.56 jmc 3448: .Pp
1.1 nicm 3449: .It Xo Ic mode-keys
1.56 jmc 3450: .Op Ic vi | emacs
1.1 nicm 3451: .Xc
1.500 nicm 3452: Use vi or emacs-style key bindings in copy mode.
3453: The default is emacs, unless
1.191 nicm 3454: .Ev VISUAL
3455: or
3456: .Ev EDITOR
3457: contains
3458: .Ql vi .
1.56 jmc 3459: .Pp
1.378 nicm 3460: .It Ic mode-style Ar style
3461: Set window modes style.
3462: For how to specify
3463: .Ar style ,
3464: see the
1.623 nicm 3465: .Sx STYLES
3466: section.
1.378 nicm 3467: .Pp
1.1 nicm 3468: .It Xo Ic monitor-activity
1.56 jmc 3469: .Op Ic on | off
1.1 nicm 3470: .Xc
3471: Monitor for activity in the window.
3472: Windows with activity are highlighted in the status line.
1.56 jmc 3473: .Pp
1.574 nicm 3474: .It Xo Ic monitor-bell
3475: .Op Ic on | off
3476: .Xc
3477: Monitor for a bell in the window.
3478: Windows with a bell are highlighted in the status line.
3479: .Pp
1.192 nicm 3480: .It Xo Ic monitor-silence
3481: .Op Ic interval
3482: .Xc
3483: Monitor for silence (no activity) in the window within
3484: .Ic interval
3485: seconds.
3486: Windows that have been silent for the interval are highlighted in the
3487: status line.
3488: An interval of zero disables the monitoring.
1.195 nicm 3489: .Pp
3490: .It Ic other-pane-height Ar height
3491: Set the height of the other panes (not the main pane) in the
3492: .Ic main-horizontal
3493: layout.
3494: If this option is set to 0 (the default), it will have no effect.
3495: If both the
3496: .Ic main-pane-height
3497: and
3498: .Ic other-pane-height
3499: options are set, the main pane will grow taller to make the other panes the
3500: specified height, but will never shrink to do so.
3501: .Pp
3502: .It Ic other-pane-width Ar width
3503: Like
3504: .Ic other-pane-height ,
3505: but set the width of other panes in the
3506: .Ic main-vertical
3507: layout.
1.243 nicm 3508: .Pp
1.413 nicm 3509: .It Ic pane-active-border-style Ar style
3510: Set the pane border style for the currently active pane.
3511: For how to specify
3512: .Ar style ,
3513: see the
1.623 nicm 3514: .Sx STYLES
3515: section.
1.413 nicm 3516: Attributes are ignored.
3517: .Pp
1.243 nicm 3518: .It Ic pane-base-index Ar index
3519: Like
3520: .Ic base-index ,
3521: but set the starting index for pane numbers.
1.484 nicm 3522: .Pp
3523: .It Ic pane-border-format Ar format
3524: Set the text shown in pane border status lines.
3525: .Pp
3526: .It Xo Ic pane-border-status
3527: .Op Ic off | top | bottom
3528: .Xc
3529: Turn pane border status lines off or set their position.
1.413 nicm 3530: .Pp
3531: .It Ic pane-border-style Ar style
3532: Set the pane border style for panes aside from the active pane.
3533: For how to specify
3534: .Ar style ,
3535: see the
1.623 nicm 3536: .Sx STYLES
3537: section.
1.413 nicm 3538: Attributes are ignored.
1.192 nicm 3539: .Pp
1.1 nicm 3540: .It Xo Ic remain-on-exit
1.56 jmc 3541: .Op Ic on | off
1.1 nicm 3542: .Xc
3543: A window with this flag set is not destroyed when the program running in it
3544: exits.
3545: The window may be reactivated with the
3546: .Ic respawn-window
3547: command.
1.56 jmc 3548: .Pp
1.99 nicm 3549: .It Xo Ic synchronize-panes
3550: .Op Ic on | off
3551: .Xc
1.164 nicm 3552: Duplicate input to any pane to all other panes in the same window (only
3553: for panes that are not in any special mode).
1.56 jmc 3554: .Pp
1.418 nicm 3555: .It Ic window-active-style Ar style
3556: Set the style for the window's active pane.
3557: For how to specify
3558: .Ar style ,
3559: see the
1.623 nicm 3560: .Sx STYLES
3561: section.
1.418 nicm 3562: .Pp
1.378 nicm 3563: .It Ic window-status-activity-style Ar style
3564: Set status line style for windows with an activity alert.
3565: For how to specify
3566: .Ar style ,
3567: see the
1.623 nicm 3568: .Sx STYLES
3569: section.
1.169 nicm 3570: .Pp
1.378 nicm 3571: .It Ic window-status-bell-style Ar style
3572: Set status line style for windows with a bell alert.
3573: For how to specify
3574: .Ar style ,
3575: see the
1.623 nicm 3576: .Sx STYLES
3577: section.
1.169 nicm 3578: .Pp
1.125 nicm 3579: .It Ic window-status-current-format Ar string
3580: Like
3581: .Ar window-status-format ,
3582: but is the format used when the window is the current window.
1.307 nicm 3583: .Pp
1.378 nicm 3584: .It Ic window-status-current-style Ar style
3585: Set status line style for the currently active window.
3586: For how to specify
3587: .Ar style ,
3588: see the
1.623 nicm 3589: .Sx STYLES
3590: section.
1.239 nicm 3591: .Pp
3592: .It Ic window-status-format Ar string
3593: Set the format in which the window is displayed in the status line window list.
3594: See the
1.623 nicm 3595: .Sx FORMATS
3596: and
3597: .Sx STYLES
3598: sections.
1.290 nicm 3599: .Pp
1.378 nicm 3600: .It Ic window-status-last-style Ar style
3601: Set status line style for the last active window.
3602: For how to specify
3603: .Ar style ,
3604: see the
1.623 nicm 3605: .Sx STYLES
3606: section.
1.378 nicm 3607: .Pp
1.290 nicm 3608: .It Ic window-status-separator Ar string
3609: Sets the separator drawn between windows in the status line.
3610: The default is a single space character.
1.125 nicm 3611: .Pp
1.378 nicm 3612: .It Ic window-status-style Ar style
3613: Set status line style for a single window.
1.418 nicm 3614: For how to specify
3615: .Ar style ,
3616: see the
1.623 nicm 3617: .Sx STYLES
3618: section.
1.418 nicm 3619: .Pp
1.642 nicm 3620: .It Xo Ic window-size
3621: .Ar largest | Ar smallest | Ar manual
3622: .Xc
3623: Configure how
3624: .Nm
3625: determines the window size.
3626: If set to
3627: .Ar largest ,
3628: the size of the largest attached session is used; if
3629: .Ar smallest ,
3630: the size of the smallest.
3631: If
3632: .Ar manual ,
3633: the size of a new window is set from the
3634: .Ic default-size
3635: option and windows are resized automatically.
3636: See also the
3637: .Ic resize-window
3638: command and the
3639: .Ic aggressive-resize
3640: option.
3641: .Pp
1.418 nicm 3642: .It Ic window-style Ar style
3643: Set the default window style.
1.378 nicm 3644: For how to specify
3645: .Ar style ,
3646: see the
1.623 nicm 3647: .Sx STYLES
3648: section.
1.629 nicm 3649: .Pp
1.512 nicm 3650: .It Xo Ic wrap-search
3651: .Op Ic on | off
3652: .Xc
3653: If this option is set, searches will wrap around the end of the pane contents.
3654: The default is on.
1.513 nicm 3655: .Pp
1.1 nicm 3656: .It Xo Ic xterm-keys
1.56 jmc 3657: .Op Ic on | off
1.1 nicm 3658: .Xc
3659: If this option is set,
3660: .Nm
3661: will generate
1.57 jmc 3662: .Xr xterm 1 -style
3663: function key sequences; these have a number included to indicate modifiers such
3664: as Shift, Alt or Ctrl.
3665: .El
3666: .It Xo Ic show-options
1.640 nicm 3667: .Op Fl gHqsvw
1.129 nicm 3668: .Op Fl t Ar target-session | Ar target-window
1.276 nicm 3669: .Op Ar option
1.57 jmc 3670: .Xc
3671: .D1 (alias: Ic show )
1.276 nicm 3672: Show the window options (or a single window option if given) with
1.129 nicm 3673: .Fl w
1.133 nicm 3674: (equivalent to
1.134 nicm 3675: .Ic show-window-options ) ,
1.133 nicm 3676: the server options with
3677: .Fl s ,
3678: otherwise the session options for
3679: .Ar target session .
1.637 nicm 3680: If
3681: .Ar option
3682: is given and is not a user option,
3683: .Fl w
3684: and
3685: .Fl s
3686: are unnecessary -
3687: .Nm
3688: will infer the type from the option name.
1.133 nicm 3689: Global session or window options are listed if
3690: .Fl g
3691: is used.
1.317 nicm 3692: .Fl v
3693: shows only the option value, not the name.
1.340 nicm 3694: If
3695: .Fl q
3696: is set, no error will be returned if
3697: .Ar option
3698: is unset.
1.640 nicm 3699: .Fl H
3700: includes hooks (omitted by default).
1.57 jmc 3701: .It Xo Ic show-window-options
1.317 nicm 3702: .Op Fl gv
1.57 jmc 3703: .Op Fl t Ar target-window
1.276 nicm 3704: .Op Ar option
1.57 jmc 3705: .Xc
3706: .D1 (alias: Ic showw )
1.276 nicm 3707: List the window options or a single option for
1.57 jmc 3708: .Ar target-window ,
3709: or the global window options if
3710: .Fl g
3711: is used.
1.317 nicm 3712: .Fl v
3713: shows only the option value, not the name.
1.63 nicm 3714: .El
1.469 nicm 3715: .Sh HOOKS
3716: .Nm
3717: allows commands to run on various triggers, called
3718: .Em hooks .
1.505 nicm 3719: Most
1.483 nicm 3720: .Nm
1.505 nicm 3721: commands have an
1.483 nicm 3722: .Em after
3723: hook and there are a number of hooks not associated with commands.
3724: .Pp
1.640 nicm 3725: Hooks are stored as array options, members of the array are executed in
3726: order when the hook is triggered.
3727: Hooks may be configured with the
3728: .Ic set-hook
3729: or
3730: .Ic set-option
3731: commands and displayed with
3732: .Ic show-hooks
3733: or
3734: .Ic show-options
3735: .Fl H .
3736: The following two commands are equivalent:
3737: .Bd -literal -offset indent.
3738: set-hook -g pane-mode-changed[42] 'set -g status-left-style bg=red'
3739: set-option -g pane-mode-changed[42] 'set -g status-left-style bg=red'
3740: .Ed
3741: .Pp
3742: Setting a hook without specifying an array index clears the hook and sets the
3743: first member of the array.
3744: .Pp
1.505 nicm 3745: A command's after
3746: hook is run after it completes, except when the command is run as part of a hook
1.483 nicm 3747: itself.
1.505 nicm 3748: They are named with an
1.483 nicm 3749: .Ql after-
3750: prefix.
3751: For example, the following command adds a hook to select the even-vertical
3752: layout after every
3753: .Ic split-window :
3754: .Bd -literal -offset indent
1.640 nicm 3755: set-hook -g after-split-window "selectl even-vertical"
1.483 nicm 3756: .Ed
3757: .Pp
1.584 nicm 3758: All the notifications listed in the
3759: .Sx CONTROL MODE
3760: section are hooks (without any arguments), except
3761: .Ic %exit .
3762: The following additional hooks are available:
1.560 nicm 3763: .Bl -tag -width "XXXXXXXXXXXXXXXXXXXXXX"
1.476 nicm 3764: .It alert-activity
3765: Run when a window has activity.
3766: See
3767: .Ic monitor-activity .
3768: .It alert-bell
3769: Run when a window has received a bell.
1.574 nicm 3770: See
3771: .Ic monitor-bell .
1.476 nicm 3772: .It alert-silence
3773: Run when a window has been silent.
3774: See
3775: .Ic monitor-silence .
1.469 nicm 3776: .It client-attached
3777: Run when a client is attached.
3778: .It client-detached
3779: Run when a client is detached
3780: .It client-resized
3781: Run when a client is resized.
1.511 nicm 3782: .It client-session-changed
3783: Run when a client's attached session is changed.
1.475 nicm 3784: .It pane-died
3785: Run when the program running in a pane exits, but
3786: .Ic remain-on-exit
3787: is on so the pane has not closed.
3788: .It pane-exited
3789: Run when the program running in a pane exits.
1.603 nicm 3790: .It pane-focus-in
3791: Run when the focus enters a pane, if the
3792: .Ic focus-events
3793: option is on.
3794: .It pane-focus-out
3795: Run when the focus exits a pane, if the
3796: .Ic focus-events
3797: option is on.
1.560 nicm 3798: .It pane-set-clipboard
3799: Run when the terminal clipboard is set using the
3800: .Xr xterm 1
3801: escape sequence.
1.510 nicm 3802: .It session-created
3803: Run when a new session created.
3804: .It session-closed
3805: Run when a session closed.
1.507 nicm 3806: .It session-renamed
3807: Run when a session is renamed.
1.511 nicm 3808: .It window-linked
3809: Run when a window is linked into a session.
1.507 nicm 3810: .It window-renamed
3811: Run when a window is renamed.
1.511 nicm 3812: .It window-unlinked
3813: Run when a window is unlinked from a session.
1.469 nicm 3814: .El
3815: .Pp
3816: Hooks are managed with these commands:
3817: .Bl -tag -width Ds
3818: .It Xo Ic set-hook
1.640 nicm 3819: .Op Fl agRu
1.469 nicm 3820: .Op Fl t Ar target-session
3821: .Ar hook-name
3822: .Ar command
3823: .Xc
1.604 nicm 3824: Without
1.605 jmc 3825: .Fl R ,
1.604 nicm 3826: sets (or with
1.496 nicm 3827: .Fl u
3828: unsets) hook
1.469 nicm 3829: .Ar hook-name
3830: to
3831: .Ar command .
3832: If
3833: .Fl g
3834: is given,
3835: .Em hook-name
3836: is added to the global list of hooks, otherwise it is added to the session
3837: hooks (for
3838: .Ar target-session
3839: with
3840: .Fl t ) .
1.640 nicm 3841: .Fl a
3842: appends to a hook.
1.469 nicm 3843: Like options, session hooks inherit from the global ones.
1.604 nicm 3844: .Pp
3845: With
3846: .Fl R ,
3847: run
3848: .Ar hook-name
3849: immediately.
1.469 nicm 3850: .It Xo Ic show-hooks
3851: .Op Fl g
3852: .Op Fl t Ar target-session
3853: .Xc
3854: Shows the global list of hooks with
3855: .Fl g ,
3856: otherwise the session hooks.
1.470 jmc 3857: .El
1.419 nicm 3858: .Sh MOUSE SUPPORT
3859: If the
3860: .Ic mouse
3861: option is on (the default is off),
3862: .Nm
3863: allows mouse events to be bound as keys.
3864: The name of each key is made up of a mouse event (such as
3865: .Ql MouseUp1 )
1.632 nicm 3866: and a location suffix, one of the following:
3867: .Bl -column "XXXXXXXXXXXXX" -offset indent
3868: .It Li "Pane" Ta "the contents of a pane"
3869: .It Li "Border" Ta "a pane border"
3870: .It Li "Status" Ta "the status line window list"
3871: .It Li "StatusLeft" Ta "the left part of the status line"
3872: .It Li "StatusRight" Ta "the right part of the status line"
3873: .It Li "StatusDefault" Ta "any other part of the status line"
3874: .El
3875: .Pp
1.419 nicm 3876: The following mouse events are available:
3877: .Bl -column "MouseDown1" "MouseDrag1" "WheelDown" -offset indent
1.498 nicm 3878: .It Li "WheelUp" Ta "WheelDown" Ta ""
1.481 nicm 3879: .It Li "MouseDown1" Ta "MouseUp1" Ta "MouseDrag1" Ta "MouseDragEnd1"
3880: .It Li "MouseDown2" Ta "MouseUp2" Ta "MouseDrag2" Ta "MouseDragEnd2"
3881: .It Li "MouseDown3" Ta "MouseUp3" Ta "MouseDrag3" Ta "MouseDragEnd3"
1.590 nicm 3882: .It Li "DoubleClick1" Ta "DoubleClick2" Ta "DoubleClick3"
3883: .It Li "TripleClick1" Ta "TripleClick2" Ta "TripleClick3"
1.419 nicm 3884: .El
3885: .Pp
3886: Each should be suffixed with a location, for example
3887: .Ql MouseDown1Status .
3888: .Pp
1.423 nicm 3889: The special token
3890: .Ql {mouse}
3891: or
1.419 nicm 3892: .Ql =
3893: may be used as
3894: .Ar target-window
3895: or
3896: .Ar target-pane
3897: in commands bound to mouse key bindings.
3898: It resolves to the window or pane over which the mouse event took place
3899: (for example, the window in the status line over which button 1 was released for a
3900: .Ql MouseUp1Status
3901: binding, or the pane over which the wheel was scrolled for a
3902: .Ql WheelDownPane
3903: binding).
3904: .Pp
3905: The
3906: .Ic send-keys
3907: .Fl M
3908: flag may be used to forward a mouse event to a pane.
3909: .Pp
3910: The default key bindings allow the mouse to be used to select and resize panes,
3911: to copy text and to change window using the status line.
3912: These take effect if the
3913: .Ic mouse
3914: option is turned on.
1.245 nicm 3915: .Sh FORMATS
1.294 nicm 3916: Certain commands accept the
1.245 nicm 3917: .Fl F
3918: flag with a
3919: .Ar format
3920: argument.
3921: This is a string which controls the output format of the command.
3922: Replacement variables are enclosed in
3923: .Ql #{
3924: and
3925: .Ql } ,
3926: for example
1.359 nicm 3927: .Ql #{session_name} .
1.409 nicm 3928: The possible variables are listed in the table below, or the name of a
3929: .Nm
3930: option may be used for an option's value.
3931: Some variables have a shorter alias such as
1.598 nicm 3932: .Ql #S ;
1.376 nicm 3933: .Ql ##
3934: is replaced by a single
1.598 nicm 3935: .Ql # ,
3936: .Ql #,
3937: by a
3938: .Ql \&,
3939: and
3940: .Ql #}
3941: by a
3942: .Ql } .
1.409 nicm 3943: .Pp
3944: Conditionals are available by prefixing with
1.246 jmc 3945: .Ql \&?
1.245 nicm 3946: and separating two alternatives with a comma;
3947: if the specified variable exists and is not zero, the first alternative
1.246 jmc 3948: is chosen, otherwise the second is used.
3949: For example
1.245 nicm 3950: .Ql #{?session_attached,attached,not attached}
3951: will include the string
3952: .Ql attached
3953: if the session is attached and the string
3954: .Ql not attached
1.409 nicm 3955: if it is unattached, or
3956: .Ql #{?automatic-rename,yes,no}
3957: will include
3958: .Ql yes
3959: if
3960: .Ic automatic-rename
3961: is enabled, or
3962: .Ql no
3963: if not.
1.599 nicm 3964: Conditionals can be nested arbitrarily.
3965: Inside a conditional,
3966: .Ql \&,
3967: and
3968: .Ql }
3969: must be escaped as
3970: .Ql #,
3971: and
3972: .Ql #} ,
3973: unless they are part of a
3974: .Ql #{...}
1.600 nicm 3975: replacement.
3976: For example:
1.599 nicm 3977: .Bd -literal -offset indent
3978: #{?pane_in_mode,#[fg=white#,bg=red],#[fg=red#,bg=white]}#W .
3979: .Ed
1.520 nicm 3980: .Pp
1.554 nicm 3981: Comparisons may be expressed by prefixing two comma-separated
1.520 nicm 3982: alternatives by
1.652 nicm 3983: .Ql == ,
3984: .Ql != ,
3985: .Ql < ,
3986: .Ql > ,
3987: .Ql <=
1.520 nicm 3988: or
1.652 nicm 3989: .Ql >=
1.520 nicm 3990: and a colon.
3991: For example
1.544 nicm 3992: .Ql #{==:#{host},myhost}
1.520 nicm 3993: will be replaced by
3994: .Ql 1
3995: if running on
3996: .Ql myhost ,
3997: otherwise by
1.554 nicm 3998: .Ql 0 .
1.553 nicm 3999: An
4000: .Ql m
1.554 nicm 4001: specifies an
1.553 nicm 4002: .Xr fnmatch 3
1.554 nicm 4003: comparison where the first argument is the pattern and the second the string to
4004: compare, for example
1.553 nicm 4005: .Ql #{m:*foo*,#{host}} .
1.554 nicm 4006: .Ql ||
4007: and
4008: .Ql &&
4009: evaluate to true if either or both of two comma-separated alternatives are
4010: true, for example
1.595 nicm 4011: .Ql #{||:#{pane_in_mode},#{alternate_on}} .
1.554 nicm 4012: A
4013: .Ql C
4014: performs a search for an
4015: .Xr fnmatch 3
4016: pattern in the pane content and evaluates to zero if not found, or a line
4017: number if found.
1.453 nicm 4018: .Pp
1.367 nicm 4019: A limit may be placed on the length of the resultant string by prefixing it
4020: by an
4021: .Ql = ,
1.479 nicm 4022: a number and a colon.
4023: Positive numbers count from the start of the string and negative from the end,
4024: so
4025: .Ql #{=5:pane_title}
1.653 nicm 4026: will include at most the first five characters of the pane title, or
1.479 nicm 4027: .Ql #{=-5:pane_title}
1.653 nicm 4028: the last five characters.
4029: A suffix or prefix may be given as a second argument - if provided then it is
4030: appended or prepended to the string if the length has been trimmed, for example
4031: .Ql #{=/5/...:pane_title}
4032: will append
4033: .Ql ...
4034: if the pane title is more than five characters.
4035: .Pp
1.453 nicm 4036: Prefixing a time variable with
4037: .Ql t:
4038: will convert it to a string, so if
4039: .Ql #{window_activity}
4040: gives
1.454 jmc 4041: .Ql 1445765102 ,
1.453 nicm 4042: .Ql #{t:window_activity}
4043: gives
4044: .Ql Sun Oct 25 09:25:02 2015 .
4045: The
4046: .Ql b:
4047: and
4048: .Ql d:
4049: prefixes are
4050: .Xr basename 3
4051: and
4052: .Xr dirname 3
4053: of the variable respectively.
1.610 nicm 4054: .Ql q:
4055: will escape
4056: .Xr sh 1
4057: special characters.
1.617 nicm 4058: .Ql E:
4059: will expand the format twice, for example
4060: .Ql #{E:status-left}
4061: is the result of expanding the content of the
4062: .Ic status-left
4063: option rather than the content itself.
1.620 nicm 4064: .Ql T:
4065: is like
4066: .Ql E:
4067: but also expands
4068: .Xr strftime 3
4069: specifiers.
1.618 nicm 4070: .Ql S: ,
4071: .Ql W:
4072: or
4073: .Ql P:
4074: will loop over each session, window or pane and insert the format once
1.619 nicm 4075: for each.
4076: For windows and panes, two comma-separated formats may be given:
4077: the second is used for the current window or active pane.
4078: For example, to get a list of windows formatted like the status line:
1.618 nicm 4079: .Bd -literal -offset indent
4080: #{W:#{E:window-status-format} ,#{E:window-status-current-format} }
4081: .Ed
1.625 nicm 4082: .Pp
1.461 nicm 4083: A prefix of the form
4084: .Ql s/foo/bar/:
4085: will substitute
4086: .Ql foo
4087: with
4088: .Ql bar
4089: throughout.
1.431 nicm 4090: .Pp
4091: In addition, the first line of a shell command's output may be inserted using
4092: .Ql #() .
4093: For example,
4094: .Ql #(uptime)
4095: will insert the system's uptime.
4096: When constructing formats,
4097: .Nm
4098: does not wait for
4099: .Ql #()
4100: commands to finish; instead, the previous result from running the same command is used,
4101: or a placeholder if the command has not been run before.
1.543 nicm 4102: If the command hasn't exited, the most recent line of output will be used, but the status
4103: line will not be updated more than once a second.
1.431 nicm 4104: Commands are executed with the
4105: .Nm
4106: global environment set (see the
1.644 schwarze 4107: .Sx GLOBAL AND SESSION ENVIRONMENT
1.431 nicm 4108: section).
1.245 nicm 4109: .Pp
4110: The following variables are available, where appropriate:
1.359 nicm 4111: .Bl -column "XXXXXXXXXXXXXXXXXXX" "XXXXX"
4112: .It Sy "Variable name" Ta Sy "Alias" Ta Sy "Replaced with"
4113: .It Li "alternate_on" Ta "" Ta "If pane is in alternate screen"
4114: .It Li "alternate_saved_x" Ta "" Ta "Saved cursor X in alternate screen"
4115: .It Li "alternate_saved_y" Ta "" Ta "Saved cursor Y in alternate screen"
1.572 nicm 4116: .It Li "buffer_created" Ta "" Ta "Time buffer created"
1.490 nicm 4117: .It Li "buffer_name" Ta "" Ta "Name of buffer"
1.386 nicm 4118: .It Li "buffer_sample" Ta "" Ta "Sample of start of buffer"
1.359 nicm 4119: .It Li "buffer_size" Ta "" Ta "Size of the specified buffer in bytes"
1.572 nicm 4120: .It Li "client_activity" Ta "" Ta "Time client last had activity"
1.646 nicm 4121: .It Li "client_control_mode" Ta "" Ta "1 if client is in control mode"
1.572 nicm 4122: .It Li "client_created" Ta "" Ta "Time client created"
1.542 nicm 4123: .It Li "client_discarded" Ta "" Ta "Bytes discarded when client behind"
1.359 nicm 4124: .It Li "client_height" Ta "" Ta "Height of client"
1.451 nicm 4125: .It Li "client_key_table" Ta "" Ta "Current key table"
1.359 nicm 4126: .It Li "client_last_session" Ta "" Ta "Name of the client's last session"
1.540 nicm 4127: .It Li "client_name" Ta "" Ta "Name of client"
1.437 nicm 4128: .It Li "client_pid" Ta "" Ta "PID of client process"
1.359 nicm 4129: .It Li "client_prefix" Ta "" Ta "1 if prefix key has been pressed"
4130: .It Li "client_readonly" Ta "" Ta "1 if client is readonly"
4131: .It Li "client_session" Ta "" Ta "Name of the client's session"
4132: .It Li "client_termname" Ta "" Ta "Terminal name of client"
1.524 nicm 4133: .It Li "client_termtype" Ta "" Ta "Terminal type of client"
1.359 nicm 4134: .It Li "client_tty" Ta "" Ta "Pseudo terminal of client"
4135: .It Li "client_utf8" Ta "" Ta "1 if client supports utf8"
4136: .It Li "client_width" Ta "" Ta "Width of client"
1.541 nicm 4137: .It Li "client_written" Ta "" Ta "Bytes written to client"
1.509 nicm 4138: .It Li "command" Ta "" Ta "Name of command in use, if any"
1.646 nicm 4139: .It Li "command_list_alias" Ta "" Ta "Command alias if listing commands"
1.489 nicm 4140: .It Li "command_list_name" Ta "" Ta "Command name if listing commands"
4141: .It Li "command_list_usage" Ta "" Ta "Command usage if listing commands"
1.646 nicm 4142: .It Li "cursor_character" Ta "" Ta "Character at cursor in pane"
1.359 nicm 4143: .It Li "cursor_flag" Ta "" Ta "Pane cursor flag"
4144: .It Li "cursor_x" Ta "" Ta "Cursor X position in pane"
4145: .It Li "cursor_y" Ta "" Ta "Cursor Y position in pane"
4146: .It Li "history_bytes" Ta "" Ta "Number of bytes in window history"
4147: .It Li "history_limit" Ta "" Ta "Maximum window history lines"
1.581 nicm 4148: .It Li "history_size" Ta "" Ta "Size of history in lines"
1.509 nicm 4149: .It Li "hook" Ta "" Ta "Name of running hook, if any"
1.511 nicm 4150: .It Li "hook_pane" Ta "" Ta "ID of pane where hook was run, if any"
1.510 nicm 4151: .It Li "hook_session" Ta "" Ta "ID of session where hook was run, if any"
4152: .It Li "hook_session_name" Ta "" Ta "Name of session where hook was run, if any"
4153: .It Li "hook_window" Ta "" Ta "ID of window where hook was run, if any"
4154: .It Li "hook_window_name" Ta "" Ta "Name of window where hook was run, if any"
1.359 nicm 4155: .It Li "host" Ta "#H" Ta "Hostname of local host"
4156: .It Li "host_short" Ta "#h" Ta "Hostname of local host (no domain name)"
4157: .It Li "insert_flag" Ta "" Ta "Pane insert flag"
4158: .It Li "keypad_cursor_flag" Ta "" Ta "Pane keypad cursor flag"
4159: .It Li "keypad_flag" Ta "" Ta "Pane keypad flag"
4160: .It Li "line" Ta "" Ta "Line number in the list"
1.646 nicm 4161: .It Li "mouse_all_flag" Ta "" Ta "Pane mouse all flag"
1.359 nicm 4162: .It Li "mouse_any_flag" Ta "" Ta "Pane mouse any flag"
4163: .It Li "mouse_button_flag" Ta "" Ta "Pane mouse button flag"
4164: .It Li "mouse_standard_flag" Ta "" Ta "Pane mouse standard flag"
1.654 nicm 4165: .It Li "mouse_x" Ta "" Ta "Mouse X position, if any"
4166: .It Li "mouse_y" Ta "" Ta "Mouse Y position, if any"
4167: .It Li "mouse_word" Ta "" Ta "Word under mouse, if any"
4168: .It Li "mouse_line" Ta "" Ta "Line under mouse, if any"
1.359 nicm 4169: .It Li "pane_active" Ta "" Ta "1 if active pane"
1.570 nicm 4170: .It Li "pane_at_bottom" Ta "" Ta "1 if pane is at the bottom of window"
4171: .It Li "pane_at_left" Ta "" Ta "1 if pane is at the left of window"
4172: .It Li "pane_at_right" Ta "" Ta "1 if pane is at the right of window"
4173: .It Li "pane_at_top" Ta "" Ta "1 if pane is at the top of window"
1.396 nicm 4174: .It Li "pane_bottom" Ta "" Ta "Bottom of pane"
1.359 nicm 4175: .It Li "pane_current_command" Ta "" Ta "Current command if available"
4176: .It Li "pane_dead" Ta "" Ta "1 if pane is dead"
1.411 nicm 4177: .It Li "pane_dead_status" Ta "" Ta "Exit status of process in dead pane"
1.572 nicm 4178: .It Li "pane_format" Ta "" Ta "1 if format is for a pane (not assuming the current)"
1.359 nicm 4179: .It Li "pane_height" Ta "" Ta "Height of pane"
4180: .It Li "pane_id" Ta "#D" Ta "Unique pane ID"
4181: .It Li "pane_in_mode" Ta "" Ta "If pane is in a mode"
1.646 nicm 4182: .It Li "pane_index" Ta "#P" Ta "Index of pane"
1.404 nicm 4183: .It Li "pane_input_off" Ta "" Ta "If input to pane is disabled"
1.396 nicm 4184: .It Li "pane_left" Ta "" Ta "Left of pane"
1.650 nicm 4185: .It Li "pane_marked" Ta "" Ta "1 if this is the marked pane"
4186: .It Li "pane_marked_set" Ta "" Ta "1 if a marked pane is set"
1.549 nicm 4187: .It Li "pane_mode" Ta "" Ta "Name of pane mode, if any."
1.359 nicm 4188: .It Li "pane_pid" Ta "" Ta "PID of first process in pane"
1.567 nicm 4189: .It Li "pane_pipe" Ta "" Ta "1 if pane is being piped"
1.396 nicm 4190: .It Li "pane_right" Ta "" Ta "Right of pane"
1.546 nicm 4191: .It Li "pane_search_string" Ta "" Ta "Last search string in copy mode"
1.359 nicm 4192: .It Li "pane_start_command" Ta "" Ta "Command pane started with"
1.396 nicm 4193: .It Li "pane_synchronized" Ta "" Ta "If pane is synchronized"
1.359 nicm 4194: .It Li "pane_tabs" Ta "" Ta "Pane tab positions"
4195: .It Li "pane_title" Ta "#T" Ta "Title of pane"
1.396 nicm 4196: .It Li "pane_top" Ta "" Ta "Top of pane"
1.359 nicm 4197: .It Li "pane_tty" Ta "" Ta "Pseudo terminal of pane"
4198: .It Li "pane_width" Ta "" Ta "Width of pane"
1.437 nicm 4199: .It Li "pid" Ta "" Ta "Server PID"
1.606 nicm 4200: .It Li "rectangle_toggle" Ta "" Ta "1 if rectangle selection is activated"
1.646 nicm 4201: .It Li "scroll_position" Ta "" Ta "Scroll position in copy mode"
1.359 nicm 4202: .It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane"
4203: .It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane"
1.571 nicm 4204: .It Li "selection_present" Ta "" Ta "1 if selection started in copy mode"
1.646 nicm 4205: .It Li "session_activity" Ta "" Ta "Time of session last activity"
1.430 nicm 4206: .It Li "session_alerts" Ta "" Ta "List of window indexes with alerts"
1.382 nicm 4207: .It Li "session_attached" Ta "" Ta "Number of clients session is attached to"
1.572 nicm 4208: .It Li "session_created" Ta "" Ta "Time session created"
4209: .It Li "session_format" Ta "" Ta "1 if format is for a session (not assuming the current)"
1.536 nicm 4210: .It Li "session_group" Ta "" Ta "Name of session group"
1.646 nicm 4211: .It Li "session_group_list" Ta "" Ta "List of sessions in group"
1.586 nicm 4212: .It Li "session_group_size" Ta "" Ta "Size of session group"
1.359 nicm 4213: .It Li "session_grouped" Ta "" Ta "1 if session in a group"
4214: .It Li "session_id" Ta "" Ta "Unique session ID"
1.646 nicm 4215: .It Li "session_last_attached" Ta "" Ta "Time session last attached"
1.382 nicm 4216: .It Li "session_many_attached" Ta "" Ta "1 if multiple clients attached"
1.359 nicm 4217: .It Li "session_name" Ta "#S" Ta "Name of session"
1.548 nicm 4218: .It Li "session_stack" Ta "" Ta "Window indexes in most recent order"
1.359 nicm 4219: .It Li "session_windows" Ta "" Ta "Number of windows in session"
1.487 nicm 4220: .It Li "socket_path" Ta "" Ta "Server socket path"
1.465 nicm 4221: .It Li "start_time" Ta "" Ta "Server start time"
1.646 nicm 4222: .It Li "window_active" Ta "" Ta "1 if window active"
1.572 nicm 4223: .It Li "window_activity" Ta "" Ta "Time of window last activity"
1.487 nicm 4224: .It Li "window_activity_flag" Ta "" Ta "1 if window has activity"
1.366 nicm 4225: .It Li "window_bell_flag" Ta "" Ta "1 if window has bell"
1.642 nicm 4226: .It Li "window_bigger" Ta "" Ta "1 if window is larger than client"
1.621 nicm 4227: .It Li "window_end_flag" Ta "" Ta "1 if window has the highest index"
1.359 nicm 4228: .It Li "window_flags" Ta "#F" Ta "Window flags"
1.572 nicm 4229: .It Li "window_format" Ta "" Ta "1 if format is for a window (not assuming the current)"
1.359 nicm 4230: .It Li "window_height" Ta "" Ta "Height of window"
4231: .It Li "window_id" Ta "" Ta "Unique window ID"
4232: .It Li "window_index" Ta "#I" Ta "Index of window"
1.400 nicm 4233: .It Li "window_last_flag" Ta "" Ta "1 if window is the last used"
1.460 nicm 4234: .It Li "window_layout" Ta "" Ta "Window layout description, ignoring zoomed window panes"
1.426 nicm 4235: .It Li "window_linked" Ta "" Ta "1 if window is linked across sessions"
1.359 nicm 4236: .It Li "window_name" Ta "#W" Ta "Name of window"
1.642 nicm 4237: .It Li "window_offset_x" Ta "" Ta "X offset into window if larger than client"
4238: .It Li "window_offset_y" Ta "" Ta "Y offset into window if larger than client"
1.359 nicm 4239: .It Li "window_panes" Ta "" Ta "Number of panes in window"
1.366 nicm 4240: .It Li "window_silence_flag" Ta "" Ta "1 if window has silence alert"
1.548 nicm 4241: .It Li "window_stack_index" Ta "" Ta "Index in session most recent stack"
1.621 nicm 4242: .It Li "window_start_flag" Ta "" Ta "1 if window has the lowest index"
1.460 nicm 4243: .It Li "window_visible_layout" Ta "" Ta "Window layout description, respecting zoomed window panes"
1.359 nicm 4244: .It Li "window_width" Ta "" Ta "Width of window"
1.400 nicm 4245: .It Li "window_zoomed_flag" Ta "" Ta "1 if window is zoomed"
1.359 nicm 4246: .It Li "wrap_flag" Ta "" Ta "Pane wrap flag"
1.245 nicm 4247: .El
1.623 nicm 4248: .Sh STYLES
4249: .Nm
4250: offers various options to specify the colour and attributes of aspects of the
4251: interface, for example
4252: .Ic status-style
4253: for the status line.
4254: In addition, embedded styles may be specified in format options, such as
4255: .Ic status-left-format ,
4256: by enclosing them in
4257: .Ql #[
4258: and
1.639 nicm 4259: .Ql \&] .
1.623 nicm 4260: .Pp
4261: A style may be the single term
4262: .Ql default
4263: to specify the default style (which may inherit from another option) or a space
1.630 nicm 4264: or comma separated list of the following:
1.623 nicm 4265: .Bl -tag -width Ds
4266: .It Ic fg=colour
4267: Set the foreground colour.
4268: The colour is one of:
4269: .Ic black ,
4270: .Ic red ,
4271: .Ic green ,
4272: .Ic yellow ,
4273: .Ic blue ,
4274: .Ic magenta ,
4275: .Ic cyan ,
4276: .Ic white ;
4277: if supported the bright variants
4278: .Ic brightred ,
4279: .Ic brightgreen ,
4280: .Ic brightyellow ;
4281: .Ic colour0
4282: to
4283: .Ic colour255
4284: from the 256-colour set;
4285: .Ic default
4286: for the default colour;
4287: .Ic terminal
4288: for the terminal default colour; or a hexadecimal RGB string such as
4289: .Ql #ffffff .
4290: .It Ic bg=colour
4291: Set the background colour.
4292: .It Ic none
4293: Set no attributes (turn off any active attributes).
1.625 nicm 4294: .It Xo Ic bright
4295: (or
4296: .Ic bold ) ,
1.623 nicm 4297: .Ic dim ,
4298: .Ic underscore ,
4299: .Ic blink ,
4300: .Ic reverse ,
4301: .Ic hidden ,
4302: .Ic italics ,
1.649 nicm 4303: .Ic overline ,
1.623 nicm 4304: .Ic strikethrough ,
4305: .Ic double-underscore ,
4306: .Ic curly-underscore ,
4307: .Ic dotted-underscore ,
4308: .Ic dashed-underscore
4309: .Xc
4310: Set an attribute.
4311: Any of the attributes may be prefixed with
4312: .Ql no
4313: to unset.
1.625 nicm 4314: .It Xo Ic align=left
4315: (or
4316: .Ic noalign ) ,
4317: .Ic align=centre ,
4318: .Ic align=right
4319: .Xc
4320: Align text to the left, centre or right of the available space if appropriate.
4321: .It Xo Ic list=on ,
4322: .Ic list=focus ,
4323: .Ic list=left-marker ,
4324: .Ic list=right=marker ,
4325: .Ic nolist
4326: .Xc
4327: Mark the position of the various window list components in the
4328: .Ic status-format
4329: option:
4330: .Ic list=on
4331: marks the start of the list;
4332: .Ic list=focus
4333: is the part of the list that should be kept in focus if the entire list won't fit
4334: in the available space (typically the current window);
4335: .Ic list=left-marker
4336: and
4337: .Ic list=right-marker
4338: mark the text to be used to mark that text has been trimmed from the left or
4339: right of the list if there is not enough space.
4340: .It Xo Ic range=left ,
4341: .Ic range=right ,
4342: .Ic range=window|X ,
4343: .Ic norange
4344: .Xc
4345: Mark a range in the
1.651 nicm 4346: .Ic status-format
1.625 nicm 4347: option.
4348: .Ic range=left
4349: and
4350: .Ic range=right
4351: are the text used for the
4352: .Ql StatusLeft
4353: and
4354: .Ql StatusRight
4355: mouse keys.
4356: .Ic range=window|X
4357: is the range for a window passed to the
4358: .Ql Status
4359: mouse key, where
4360: .Ql X
4361: is a window index.
1.623 nicm 4362: .El
4363: .Pp
4364: Examples are:
4365: .Bd -literal -offset indent
1.630 nicm 4366: fg=yellow bold underscore blink
1.623 nicm 4367: bg=black,fg=default,noreverse
4368: .Ed
1.261 nicm 4369: .Sh NAMES AND TITLES
4370: .Nm
4371: distinguishes between names and titles.
4372: Windows and sessions have names, which may be used to specify them in targets
4373: and are displayed in the status line and various lists: the name is the
4374: .Nm
4375: identifier for a window or session.
4376: Only panes have titles.
1.577 nicm 4377: A pane's title is typically set by the program running inside the pane using
4378: an escape sequence (like it would set the
1.261 nicm 4379: .Xr xterm 1
1.577 nicm 4380: window title in
1.578 nicm 4381: .Xr X 7 ) .
1.268 nicm 4382: Windows themselves do not have titles - a window's title is the title of its
1.261 nicm 4383: active pane.
4384: .Nm
4385: itself may set the title of the terminal in which the client is running, see
4386: the
4387: .Ic set-titles
4388: option.
4389: .Pp
4390: A session's name is set with the
4391: .Ic new-session
4392: and
4393: .Ic rename-session
4394: commands.
4395: A window's name is set with one of:
4396: .Bl -enum -width Ds
4397: .It
4398: A command argument (such as
4399: .Fl n
4400: for
4401: .Ic new-window
4402: or
4403: .Ic new-session ) .
4404: .It
1.597 nicm 4405: An escape sequence (if the
4406: .Ic allow-rename
4407: option is turned on):
1.261 nicm 4408: .Bd -literal -offset indent
4409: $ printf '\e033kWINDOW_NAME\e033\e\e'
4410: .Ed
4411: .It
4412: Automatic renaming, which sets the name to the active command in the window's
4413: active pane.
4414: See the
4415: .Ic automatic-rename
4416: option.
4417: .El
4418: .Pp
4419: When a pane is first created, its title is the hostname.
1.612 nicm 4420: A pane's title can be set via the title setting escape sequence, for example:
1.261 nicm 4421: .Bd -literal -offset indent
4422: $ printf '\e033]2;My Title\e033\e\e'
4423: .Ed
1.577 nicm 4424: .Pp
4425: It can also be modified with the
4426: .Ic select-pane
4427: .Fl T
4428: command.
1.644 schwarze 4429: .Sh GLOBAL AND SESSION ENVIRONMENT
1.63 nicm 4430: When the server is started,
4431: .Nm
4432: copies the environment into the
4433: .Em global environment ;
4434: in addition, each session has a
4435: .Em session environment .
1.193 nicm 4436: When a window is created, the session and global environments are merged.
4437: If a variable exists in both, the value from the session environment is used.
4438: The result is the initial environment passed to the new process.
1.63 nicm 4439: .Pp
4440: The
4441: .Ic update-environment
4442: session option may be used to update the session environment from the client
4443: when a new session is created or an old reattached.
4444: .Nm
4445: also initialises the
4446: .Ev TMUX
4447: variable with some internal information to allow commands to be executed
4448: from inside, and the
4449: .Ev TERM
4450: variable with the correct terminal setting of
4451: .Ql screen .
4452: .Pp
4453: Commands to alter and view the environment are:
4454: .Bl -tag -width Ds
4455: .It Xo Ic set-environment
4456: .Op Fl gru
4457: .Op Fl t Ar target-session
4458: .Ar name Op Ar value
4459: .Xc
1.115 nicm 4460: .D1 (alias: Ic setenv )
1.63 nicm 4461: Set or unset an environment variable.
4462: If
4463: .Fl g
4464: is used, the change is made in the global environment; otherwise, it is applied
4465: to the session environment for
4466: .Ar target-session .
4467: The
4468: .Fl u
4469: flag unsets a variable.
4470: .Fl r
4471: indicates the variable is to be removed from the environment before starting a
4472: new process.
4473: .It Xo Ic show-environment
1.442 nicm 4474: .Op Fl gs
1.63 nicm 4475: .Op Fl t Ar target-session
1.286 nicm 4476: .Op Ar variable
1.63 nicm 4477: .Xc
1.115 nicm 4478: .D1 (alias: Ic showenv )
1.63 nicm 4479: Display the environment for
4480: .Ar target-session
4481: or the global environment with
4482: .Fl g .
1.286 nicm 4483: If
4484: .Ar variable
4485: is omitted, all variables are shown.
1.63 nicm 4486: Variables removed from the environment are prefixed with
4487: .Ql - .
1.442 nicm 4488: If
4489: .Fl s
4490: is used, the output is formatted as a set of Bourne shell commands.
1.57 jmc 4491: .El
4492: .Sh STATUS LINE
4493: .Nm
4494: includes an optional status line which is displayed in the bottom line of each
4495: terminal.
1.626 nicm 4496: .Pp
4497: By default, the status line is enabled and one line in height (it may be
4498: disabled or made multiple lines with the
1.57 jmc 4499: .Ic status
4500: session option) and contains, from left-to-right: the name of the current
1.261 nicm 4501: session in square brackets; the window list; the title of the active pane
4502: in double quotes; and the time and date.
1.57 jmc 4503: .Pp
1.626 nicm 4504: Each line of the status line is configured with the
4505: .Ic status-format
4506: option.
4507: The default is made of three parts: configurable left and right sections (which
4508: may contain dynamic content such as the time or output from a shell command,
4509: see the
1.57 jmc 4510: .Ic status-left ,
4511: .Ic status-left-length ,
4512: .Ic status-right ,
4513: and
4514: .Ic status-right-length
4515: options below), and a central window list.
1.125 nicm 4516: By default, the window list shows the index, name and (if any) flag of the
4517: windows present in the current session in ascending numerical order.
4518: It may be customised with the
4519: .Ar window-status-format
4520: and
4521: .Ar window-status-current-format
4522: options.
1.57 jmc 4523: The flag is one of the following symbols appended to the window name:
4524: .Bl -column "Symbol" "Meaning" -offset indent
4525: .It Sy "Symbol" Ta Sy "Meaning"
4526: .It Li "*" Ta "Denotes the current window."
4527: .It Li "-" Ta "Marks the last window (previously selected)."
1.574 nicm 4528: .It Li "#" Ta "Window activity is monitored and activity has been detected."
4529: .It Li "\&!" Ta "Window bells are monitored and a bell has occurred in the window."
1.192 nicm 4530: .It Li "~" Ta "The window has been silent for the monitor-silence interval."
1.432 nicm 4531: .It Li "M" Ta "The window contains the marked pane."
1.349 nicm 4532: .It Li "Z" Ta "The window's active pane is zoomed."
1.57 jmc 4533: .El
4534: .Pp
4535: The # symbol relates to the
4536: .Ic monitor-activity
1.388 nicm 4537: window option.
1.57 jmc 4538: The window name is printed in inverted colours if an alert (bell, activity or
1.388 nicm 4539: silence) is present.
1.57 jmc 4540: .Pp
1.131 nicm 4541: The colour and attributes of the status line may be configured, the entire
4542: status line using the
1.378 nicm 4543: .Ic status-style
4544: session option and individual windows using the
4545: .Ic window-status-style
4546: window option.
1.57 jmc 4547: .Pp
1.131 nicm 4548: The status line is automatically refreshed at interval if it has changed, the
4549: interval may be controlled with the
1.57 jmc 4550: .Ic status-interval
4551: session option.
4552: .Pp
4553: Commands related to the status line are as follows:
4554: .Bl -tag -width Ds
4555: .It Xo Ic command-prompt
1.517 nicm 4556: .Op Fl 1i
1.235 nicm 4557: .Op Fl I Ar inputs
1.73 nicm 4558: .Op Fl p Ar prompts
1.57 jmc 4559: .Op Fl t Ar target-client
4560: .Op Ar template
4561: .Xc
4562: Open the command prompt in a client.
4563: This may be used from inside
4564: .Nm
4565: to execute commands interactively.
1.231 nicm 4566: .Pp
1.57 jmc 4567: If
4568: .Ar template
1.73 nicm 4569: is specified, it is used as the command.
1.235 nicm 4570: If present,
4571: .Fl I
4572: is a comma-separated list of the initial text for each prompt.
1.73 nicm 4573: If
4574: .Fl p
4575: is given,
4576: .Ar prompts
4577: is a comma-separated list of prompts which are displayed in order; otherwise
4578: a single prompt is displayed, constructed from
4579: .Ar template
4580: if it is present, or
4581: .Ql \&:
4582: if not.
1.231 nicm 4583: .Pp
1.73 nicm 4584: Before the command is executed, the first occurrence of the string
4585: .Ql %%
1.74 jmc 4586: and all occurrences of
1.73 nicm 4587: .Ql %1
1.492 nicm 4588: are replaced by the response to the first prompt, all
1.73 nicm 4589: .Ql %2
4590: are replaced with the response to the second prompt, and so on for further
1.74 jmc 4591: prompts.
4592: Up to nine prompt responses may be replaced
4593: .Po
4594: .Ql %1
1.73 nicm 4595: to
1.74 jmc 4596: .Ql %9
4597: .Pc .
1.513 nicm 4598: .Ql %%%
4599: is like
4600: .Ql %%
4601: but any quotation marks are escaped.
1.497 nicm 4602: .Pp
4603: .Fl 1
4604: makes the prompt only accept one key press, in this case the resulting input
4605: is a single character.
1.517 nicm 4606: .Fl i
4607: executes the command every time the prompt input changes instead of when the
4608: user exits the command prompt.
1.500 nicm 4609: .Pp
4610: The following keys have a special meaning in the command prompt, depending
4611: on the value of the
4612: .Ic status-keys
4613: option:
4614: .Bl -column "FunctionXXXXXXXXXXXXXXXXXXXXXXXXX" "viXXXX" "emacsX" -offset indent
4615: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
4616: .It Li "Cancel command prompt" Ta "Escape" Ta "Escape"
4617: .It Li "Delete current word" Ta "" Ta "C-w"
4618: .It Li "Delete entire command" Ta "d" Ta "C-u"
4619: .It Li "Delete from cursor to end" Ta "D" Ta "C-k"
4620: .It Li "Execute command" Ta "Enter" Ta "Enter"
4621: .It Li "Get next command from history" Ta "" Ta "Down"
4622: .It Li "Get previous command from history" Ta "" Ta "Up"
4623: .It Li "Insert top paste buffer" Ta "p" Ta "C-y"
4624: .It Li "Look for completions" Ta "Tab" Ta "Tab"
4625: .It Li "Move cursor left" Ta "h" Ta "Left"
4626: .It Li "Move cursor right" Ta "l" Ta "Right"
4627: .It Li "Move cursor to end" Ta "$" Ta "C-e"
4628: .It Li "Move cursor to next word" Ta "w" Ta "M-f"
4629: .It Li "Move cursor to previous word" Ta "b" Ta "M-b"
4630: .It Li "Move cursor to start" Ta "0" Ta "C-a"
4631: .It Li "Transpose characters" Ta "" Ta "C-t"
4632: .El
1.57 jmc 4633: .It Xo Ic confirm-before
1.238 nicm 4634: .Op Fl p Ar prompt
1.57 jmc 4635: .Op Fl t Ar target-client
4636: .Ar command
4637: .Xc
4638: .D1 (alias: Ic confirm )
4639: Ask for confirmation before executing
4640: .Ar command .
1.238 nicm 4641: If
4642: .Fl p
4643: is given,
4644: .Ar prompt
4645: is the prompt to display; otherwise a prompt is constructed from
4646: .Ar command .
4647: It may contain the special character sequences supported by the
4648: .Ic status-left
4649: option.
4650: .Pp
1.57 jmc 4651: This command works only from inside
4652: .Nm .
1.646 nicm 4653: .It Xo Ic display-menu
4654: .Op Fl c Ar target-client
4655: .Op Fl t Ar target-pane
4656: .Op Fl T Ar title
4657: .Op Fl x Ar position
4658: .Op Fl y Ar position
1.657 nicm 4659: .Ar name
4660: .Ar key
4661: .Ar command
4662: .Ar ...
1.646 nicm 4663: .Xc
1.651 nicm 4664: .D1 (alias: Ic menu )
1.646 nicm 4665: Display a menu on
4666: .Ar target-client .
4667: .Ar target-pane
4668: gives the target for any commands run from the menu.
4669: .Pp
1.657 nicm 4670: A menu is passed as a series of arguments: first the menu item name,
4671: second the key shortcut (or empty for none) and third the command
4672: to run when the menu item is chosen.
4673: The name and command are formats, see the
1.646 nicm 4674: .Sx FORMATS
4675: and
4676: .Sx STYLES
4677: sections.
1.658 nicm 4678: If the name begins with a hyphen (-), then the item is disabled (shown dim) and
4679: may not be chosen.
1.657 nicm 4680: The name may be empty for a separator line, in which case both the key and
4681: command should be omitted.
1.646 nicm 4682: .Pp
4683: .Fl T
4684: is a format for the menu title (see
4685: .Sx FORMATS ) .
4686: .Pp
4687: .Fl x
4688: and
4689: .Fl y
4690: give the position of the menu.
4691: Both may be a row or column number, or one of the following special values:
4692: .Bl -column "XXXXX" "XXXX" -offset indent
4693: .It Sy "Value" Ta Sy "Flag" Ta Sy "Meaning"
4694: .It Li "R" Ta Fl x Ta "The right side of the terminal"
4695: .It Li "P" Ta "Both" Ta "The bottom left of the pane"
4696: .It Li "M" Ta "Both" Ta "The mouse position"
4697: .It Li "W" Ta Fl x Ta "The window position on the status line"
4698: .It Li "S" Ta Fl y Ta "The line above or below the status line"
4699: .El
4700: .Pp
4701: Each menu consists of items followed by a key shortcut shown in brackets.
4702: If the menu is too large to fit on the terminal, it is not displayed.
4703: Pressing the key shortcut chooses the corresponding item.
4704: If the mouse is enabled and the menu is opened from a mouse key binding, releasing
4705: the mouse button with an item selected will choose that item.
4706: The following keys are also available:
4707: .Bl -column "Key" "Function" -offset indent
4708: .It Sy "Key" Ta Sy "Function"
4709: .It Li "Enter" Ta "Choose selected item"
4710: .It Li "Up" Ta "Select previous item"
4711: .It Li "Down" Ta "Select next item"
4712: .It Li "q" Ta "Exit menu"
4713: .El
1.57 jmc 4714: .It Xo Ic display-message
1.643 nicm 4715: .Op Fl aIpv
1.215 nicm 4716: .Op Fl c Ar target-client
4717: .Op Fl t Ar target-pane
1.57 jmc 4718: .Op Ar message
4719: .Xc
4720: .D1 (alias: Ic display )
1.127 nicm 4721: Display a message.
4722: If
4723: .Fl p
4724: is given, the output is printed to stdout, otherwise it is displayed in the
4725: .Ar target-client
4726: status line.
1.122 nicm 4727: The format of
1.124 jmc 4728: .Ar message
1.275 nicm 4729: is described in the
4730: .Sx FORMATS
4731: section; information is taken from
1.215 nicm 4732: .Ar target-pane
4733: if
4734: .Fl t
4735: is given, otherwise the active pane for the session attached to
4736: .Ar target-client .
1.622 nicm 4737: .Pp
1.624 nicm 4738: .Fl v
4739: prints verbose logging as the format is parsed and
4740: .Fl a
4741: lists the format variables and their values.
1.643 nicm 4742: .Pp
4743: .Fl I
4744: forwards any input read from stdin to the empty pane given by
4745: .Ar target-pane .
1.57 jmc 4746: .El
4747: .Sh BUFFERS
4748: .Nm
1.392 nicm 4749: maintains a set of named
1.199 nicm 4750: .Em paste buffers .
1.392 nicm 4751: Each buffer may be either explicitly or automatically named.
4752: Explicitly named buffers are named when created with the
4753: .Ic set-buffer
4754: or
4755: .Ic load-buffer
4756: commands, or by renaming an automatically named buffer with
4757: .Ic set-buffer
4758: .Fl n .
4759: Automatically named buffers are given a name such as
4760: .Ql buffer0001 ,
4761: .Ql buffer0002
4762: and so on.
4763: When the
4764: .Ic buffer-limit
4765: option is reached, the oldest automatically named buffer is deleted.
1.493 nicm 4766: Explicitly named buffers are not subject to
1.57 jmc 4767: .Ic buffer-limit
1.392 nicm 4768: and may be deleted with
4769: .Ic delete-buffer
4770: command.
4771: .Pp
1.57 jmc 4772: Buffers may be added using
4773: .Ic copy-mode
4774: or the
4775: .Ic set-buffer
1.392 nicm 4776: and
4777: .Ic load-buffer
4778: commands, and pasted into a window using the
1.57 jmc 4779: .Ic paste-buffer
4780: command.
1.392 nicm 4781: If a buffer command is used and no buffer is specified, the most
4782: recently added automatically named buffer is assumed.
1.57 jmc 4783: .Pp
4784: A configurable history buffer is also maintained for each window.
4785: By default, up to 2000 lines are kept; this can be altered with the
4786: .Ic history-limit
4787: option (see the
4788: .Ic set-option
4789: command above).
4790: .Pp
4791: The buffer commands are as follows:
4792: .Bl -tag -width Ds
1.178 nicm 4793: .It Xo
4794: .Ic choose-buffer
1.593 nicm 4795: .Op Fl NZ
1.572 nicm 4796: .Op Fl F Ar format
1.562 nicm 4797: .Op Fl f Ar filter
1.561 nicm 4798: .Op Fl O Ar sort-order
1.555 nicm 4799: .Op Fl t Ar target-pane
1.178 nicm 4800: .Op Ar template
4801: .Xc
1.555 nicm 4802: Put a pane into buffer mode, where a buffer may be chosen interactively from
4803: a list.
1.593 nicm 4804: .Fl Z
4805: zooms the pane.
1.555 nicm 4806: The following keys may be used in buffer mode:
4807: .Bl -column "Key" "Function" -offset indent
4808: .It Sy "Key" Ta Sy "Function"
1.582 nicm 4809: .It Li "Enter" Ta "Paste selected buffer"
1.555 nicm 4810: .It Li "Up" Ta "Select previous buffer"
4811: .It Li "Down" Ta "Select next buffer"
1.559 nicm 4812: .It Li "C-s" Ta "Search by name or content"
4813: .It Li "n" Ta "Repeat last search"
1.555 nicm 4814: .It Li "t" Ta "Toggle if buffer is tagged"
4815: .It Li "T" Ta "Tag no buffers"
4816: .It Li "C-t" Ta "Tag all buffers"
1.582 nicm 4817: .It Li "p" Ta "Paste selected buffer"
4818: .It Li "P" Ta "Paste tagged buffers"
1.555 nicm 4819: .It Li "d" Ta "Delete selected buffer"
4820: .It Li "D" Ta "Delete tagged buffers"
1.562 nicm 4821: .It Li "f" Ta "Enter a format to filter items"
1.555 nicm 4822: .It Li "O" Ta "Change sort order"
1.576 nicm 4823: .It Li "v" Ta "Toggle preview"
1.555 nicm 4824: .It Li "q" Ta "Exit mode"
4825: .El
4826: .Pp
4827: After a buffer is chosen,
1.178 nicm 4828: .Ql %%
1.392 nicm 4829: is replaced by the buffer name in
1.178 nicm 4830: .Ar template
4831: and the result executed as a command.
4832: If
4833: .Ar template
4834: is not given, "paste-buffer -b '%%'" is used.
1.555 nicm 4835: .Pp
1.561 nicm 4836: .Fl O
4837: specifies the initial sort order: one of
4838: .Ql time ,
4839: .Ql name
4840: or
4841: .Ql size .
1.562 nicm 4842: .Fl f
1.579 nicm 4843: specifies an initial filter: the filter is a format - if it evaluates to zero,
4844: the item in the list is not shown, otherwise it is shown.
4845: If a filter would lead to an empty list, it is ignored.
1.572 nicm 4846: .Fl F
4847: specifies the format for each item in the list.
1.576 nicm 4848: .Fl N
4849: starts without the preview.
1.314 nicm 4850: This command works only if at least one client is attached.
1.57 jmc 4851: .It Ic clear-history Op Fl t Ar target-pane
4852: .D1 (alias: Ic clearhist )
4853: Remove and free the history for the specified pane.
1.392 nicm 4854: .It Ic delete-buffer Op Fl b Ar buffer-name
1.57 jmc 4855: .D1 (alias: Ic deleteb )
1.392 nicm 4856: Delete the buffer named
4857: .Ar buffer-name ,
4858: or the most recently added automatically named buffer if not specified.
1.294 nicm 4859: .It Xo Ic list-buffers
4860: .Op Fl F Ar format
4861: .Xc
1.57 jmc 4862: .D1 (alias: Ic lsb )
1.198 nicm 4863: List the global buffers.
1.294 nicm 4864: For the meaning of the
4865: .Fl F
4866: flag, see the
4867: .Sx FORMATS
4868: section.
1.200 jmc 4869: .It Xo Ic load-buffer
1.392 nicm 4870: .Op Fl b Ar buffer-name
1.57 jmc 4871: .Ar path
4872: .Xc
4873: .D1 (alias: Ic loadb )
4874: Load the contents of the specified paste buffer from
4875: .Ar path .
4876: .It Xo Ic paste-buffer
1.278 nicm 4877: .Op Fl dpr
1.392 nicm 4878: .Op Fl b Ar buffer-name
1.170 nicm 4879: .Op Fl s Ar separator
1.158 nicm 4880: .Op Fl t Ar target-pane
1.57 jmc 4881: .Xc
4882: .D1 (alias: Ic pasteb )
1.158 nicm 4883: Insert the contents of a paste buffer into the specified pane.
4884: If not specified, paste into the current one.
1.57 jmc 4885: With
4886: .Fl d ,
1.392 nicm 4887: also delete the paste buffer.
1.57 jmc 4888: When output, any linefeed (LF) characters in the paste buffer are replaced with
1.170 nicm 4889: a separator, by default carriage return (CR).
4890: A custom separator may be specified using the
4891: .Fl s
4892: flag.
4893: The
1.57 jmc 4894: .Fl r
1.170 nicm 4895: flag means to do no replacement (equivalent to a separator of LF).
1.278 nicm 4896: If
4897: .Fl p
4898: is specified, paste bracket control codes are inserted around the
4899: buffer if the application has requested bracketed paste mode.
1.57 jmc 4900: .It Xo Ic save-buffer
4901: .Op Fl a
1.392 nicm 4902: .Op Fl b Ar buffer-name
1.57 jmc 4903: .Ar path
4904: .Xc
4905: .D1 (alias: Ic saveb )
4906: Save the contents of the specified paste buffer to
4907: .Ar path .
4908: The
4909: .Fl a
4910: option appends to rather than overwriting the file.
4911: .It Xo Ic set-buffer
1.383 nicm 4912: .Op Fl a
1.392 nicm 4913: .Op Fl b Ar buffer-name
4914: .Op Fl n Ar new-buffer-name
1.57 jmc 4915: .Ar data
4916: .Xc
4917: .D1 (alias: Ic setb )
4918: Set the contents of the specified buffer to
4919: .Ar data .
1.383 nicm 4920: The
4921: .Fl a
4922: option appends to rather than overwriting the buffer.
1.392 nicm 4923: The
4924: .Fl n
4925: option renames the buffer to
4926: .Ar new-buffer-name .
1.1 nicm 4927: .It Xo Ic show-buffer
1.392 nicm 4928: .Op Fl b Ar buffer-name
1.1 nicm 4929: .Xc
4930: .D1 (alias: Ic showb )
4931: Display the contents of the specified buffer.
1.57 jmc 4932: .El
4933: .Sh MISCELLANEOUS
4934: Miscellaneous commands are as follows:
4935: .Bl -tag -width Ds
1.72 nicm 4936: .It Ic clock-mode Op Fl t Ar target-pane
1.57 jmc 4937: Display a large clock.
1.334 nicm 4938: .It Xo Ic if-shell
1.410 nicm 4939: .Op Fl bF
1.334 nicm 4940: .Op Fl t Ar target-pane
4941: .Ar shell-command command
4942: .Op Ar command
4943: .Xc
1.57 jmc 4944: .D1 (alias: Ic if )
1.251 nicm 4945: Execute the first
1.57 jmc 4946: .Ar command
4947: if
4948: .Ar shell-command
1.251 nicm 4949: returns success or the second
4950: .Ar command
4951: otherwise.
1.410 nicm 4952: Before being executed,
4953: .Ar shell-command
4954: is expanded using the rules specified in the
1.334 nicm 4955: .Sx FORMATS
4956: section, including those relevant to
4957: .Ar target-pane .
1.335 nicm 4958: With
4959: .Fl b ,
4960: .Ar shell-command
4961: is run in the background.
1.410 nicm 4962: .Pp
4963: If
4964: .Fl F
4965: is given,
4966: .Ar shell-command
4967: is not executed but considered success if neither empty nor zero (after formats
4968: are expanded).
1.57 jmc 4969: .It Ic lock-server
4970: .D1 (alias: Ic lock )
1.90 nicm 4971: Lock each client individually by running the command specified by the
4972: .Ic lock-command
4973: option.
1.308 nicm 4974: .It Xo Ic run-shell
1.357 nicm 4975: .Op Fl b
1.308 nicm 4976: .Op Fl t Ar target-pane
4977: .Ar shell-command
4978: .Xc
1.87 nicm 4979: .D1 (alias: Ic run )
4980: Execute
1.153 nicm 4981: .Ar shell-command
1.106 nicm 4982: in the background without creating a window.
1.334 nicm 4983: Before being executed, shell-command is expanded using the rules specified in
4984: the
4985: .Sx FORMATS
4986: section.
1.335 nicm 4987: With
4988: .Fl b ,
4989: the command is run in the background.
1.308 nicm 4990: After it finishes, any output to stdout is displayed in copy mode (in the pane
4991: specified by
4992: .Fl t
4993: or the current pane if omitted).
1.153 nicm 4994: If the command doesn't return success, the exit status is also displayed.
1.342 nicm 4995: .It Xo Ic wait-for
1.370 nicm 4996: .Op Fl L | S | U
1.342 nicm 4997: .Ar channel
4998: .Xc
4999: .D1 (alias: Ic wait )
1.343 nicm 5000: When used without options, prevents the client from exiting until woken using
1.342 nicm 5001: .Ic wait-for
5002: .Fl S
5003: with the same channel.
1.343 nicm 5004: When
5005: .Fl L
5006: is used, the channel is locked and any clients that try to lock the same
5007: channel are made to wait until the channel is unlocked with
5008: .Ic wait-for
5009: .Fl U .
1.228 nicm 5010: .El
5011: .Sh TERMINFO EXTENSIONS
5012: .Nm
1.478 nicm 5013: understands some unofficial extensions to
1.228 nicm 5014: .Xr terminfo 5 :
5015: .Bl -tag -width Ds
1.360 nicm 5016: .It Em Cs , Cr
1.233 nicm 5017: Set the cursor colour.
1.232 jmc 5018: The first takes a single string argument and is used to set the colour;
5019: the second takes no arguments and restores the default cursor colour.
5020: If set, a sequence such as this may be used
5021: to change the cursor colour from inside
5022: .Nm :
5023: .Bd -literal -offset indent
5024: $ printf '\e033]12;red\e033\e\e'
5025: .Ed
1.649 nicm 5026: .It Em \&Smol
5027: Enable the overline attribute.
1.611 nicm 5028: .It Em \&Smulx
5029: Set a styled underline.
5030: The single parameter is one of: 0 for no underline, 1 for normal
5031: underline, 2 for double underline, 3 for curly underline, 4 for dotted
5032: underline and 5 for dashed underline.
1.361 jmc 5033: .It Em \&Ss , Se
1.403 nicm 5034: Set or reset the cursor style.
1.232 jmc 5035: If set, a sequence such as this may be used
5036: to change the cursor to an underline:
1.230 nicm 5037: .Bd -literal -offset indent
5038: $ printf '\e033[4 q'
5039: .Ed
5040: .Pp
5041: If
1.403 nicm 5042: .Em Se
5043: is not set, \&Ss with argument 0 will be used to reset the cursor style instead.
1.478 nicm 5044: .It Em \&Tc
5045: Indicate that the terminal supports the
5046: .Ql direct colour
5047: RGB escape sequence (for example, \ee[38;2;255;255;255m).
1.518 nicm 5048: .Pp
1.612 nicm 5049: If supported, this is used for the initialize colour escape sequence (which
1.518 nicm 5050: may be enabled by adding the
5051: .Ql initc
5052: and
5053: .Ql ccc
5054: capabilities to the
5055: .Nm
5056: .Xr terminfo 5
5057: entry).
1.232 jmc 5058: .It Em \&Ms
1.478 nicm 5059: Store the current buffer in the host terminal's selection (clipboard).
1.232 jmc 5060: See the
5061: .Em set-clipboard
5062: option above and the
5063: .Xr xterm 1
5064: man page.
1.345 nicm 5065: .El
5066: .Sh CONTROL MODE
5067: .Nm
5068: offers a textual interface called
5069: .Em control mode .
5070: This allows applications to communicate with
5071: .Nm
5072: using a simple text-only protocol.
5073: .Pp
5074: In control mode, a client sends
5075: .Nm
5076: commands or command sequences terminated by newlines on standard input.
5077: Each command will produce one block of output on standard output.
5078: An output block consists of a
5079: .Em %begin
5080: line followed by the output (which may be empty).
5081: The output block ends with a
5082: .Em %end
5083: or
5084: .Em %error .
5085: .Em %begin
5086: and matching
5087: .Em %end
5088: or
5089: .Em %error
5090: have two arguments: an integer time (as seconds from epoch) and command number.
5091: For example:
5092: .Bd -literal -offset indent
5093: %begin 1363006971 2
5094: 0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active)
5095: %end 1363006971 2
5096: .Ed
1.535 nicm 5097: .Pp
5098: The
5099: .Ic refresh-client
5100: .Fl C
5101: command may be used to set the size of a client in control mode.
1.345 nicm 5102: .Pp
5103: In control mode,
5104: .Nm
5105: outputs notifications.
5106: A notification will never occur inside an output block.
5107: .Pp
5108: The following notifications are defined:
5109: .Bl -tag -width Ds
1.547 nicm 5110: .It Ic %client-session-changed Ar client Ar session-id Ar name
5111: The client is now attached to the session with ID
5112: .Ar session-id ,
5113: which is named
5114: .Ar name .
1.345 nicm 5115: .It Ic %exit Op Ar reason
5116: The
5117: .Nm
5118: client is exiting immediately, either because it is not attached to any session
5119: or an error occurred.
5120: If present,
5121: .Ar reason
5122: describes why the client exited.
1.460 nicm 5123: .It Ic %layout-change Ar window-id Ar window-layout Ar window-visible-layout Ar window-flags
1.345 nicm 5124: The layout of a window with ID
5125: .Ar window-id
5126: changed.
5127: The new layout is
5128: .Ar window-layout .
1.460 nicm 5129: The window's visible layout is
5130: .Ar window-visible-layout
5131: and the window flags are
5132: .Ar window-flags .
1.347 nicm 5133: .It Ic %output Ar pane-id Ar value
5134: A window pane produced output.
1.345 nicm 5135: .Ar value
1.350 nicm 5136: escapes non-printable characters and backslash as octal \\xxx.
1.547 nicm 5137: .It Ic %pane-mode-changed Ar pane-id
5138: The pane with ID
5139: .Ar pane-id
5140: has changed mode.
1.345 nicm 5141: .It Ic %session-changed Ar session-id Ar name
5142: The client is now attached to the session with ID
5143: .Ar session-id ,
5144: which is named
5145: .Ar name .
5146: .It Ic %session-renamed Ar name
5147: The current session was renamed to
5148: .Ar name .
1.547 nicm 5149: .It Ic %session-window-changed Ar session-id Ar window-id
5150: The session with ID
5151: .Ar session-id
5152: changed its active window to the window with ID
5153: .Ar window-id .
1.345 nicm 5154: .It Ic %sessions-changed
5155: A session was created or destroyed.
5156: .It Ic %unlinked-window-add Ar window-id
5157: The window with ID
5158: .Ar window-id
5159: was created but is not linked to the current session.
5160: .It Ic %window-add Ar window-id
5161: The window with ID
5162: .Ar window-id
5163: was linked to the current session.
5164: .It Ic %window-close Ar window-id
5165: The window with ID
5166: .Ar window-id
5167: closed.
1.547 nicm 5168: .It Ic %window-pane-changed Ar window-id Ar pane-id
5169: The active pane in the window with ID
5170: .Ar window-id
5171: changed to the pane with ID
5172: .Ar pane-id .
1.345 nicm 5173: .It Ic %window-renamed Ar window-id Ar name
5174: The window with ID
5175: .Ar window-id
5176: was renamed to
5177: .Ar name .
1.644 schwarze 5178: .El
5179: .Sh ENVIRONMENT
5180: When
5181: .Nm
5182: is started, it inspects the following environment variables:
5183: .Bl -tag -width LC_CTYPE
5184: .It Ev EDITOR
5185: If the command specified in this variable contains the string
5186: .Ql vi
5187: and
5188: .Ev VISUAL
5189: is unset, use vi-style key bindings.
5190: Overridden by the
5191: .Ic mode-keys
5192: and
5193: .Ic status-keys
5194: options.
5195: .It Ev HOME
5196: The user's login directory.
5197: If unset, the
5198: .Xr passwd 5
5199: database is consulted.
5200: .It Ev LC_CTYPE
5201: The character encoding
5202: .Xr locale 1 .
5203: It is used for two separate purposes.
5204: For output to the terminal, UTF-8 is used if the
5205: .Fl u
5206: option is given or if
5207: .Ev LC_CTYPE
5208: contains
5209: .Qq UTF-8
5210: or
5211: .Qq UTF8 .
5212: Otherwise, only ASCII characters are written and non-ASCII characters
5213: are replaced with underscores
5214: .Pq Ql _ .
5215: For input,
5216: .Nm
5217: always runs with a UTF-8 locale.
5218: If en_US.UTF-8 is provided by the operating system it is used and
5219: .Ev LC_CTYPE
5220: is ignored for input.
5221: Otherwise,
5222: .Ev LC_CTYPE
5223: tells
5224: .Nm
5225: what the UTF-8 locale is called on the current system.
5226: If the locale specified by
5227: .Ev LC_CTYPE
5228: is not available or is not a UTF-8 locale,
5229: .Nm
5230: exits with an error message.
5231: .It Ev LC_TIME
5232: The date and time format
5233: .Xr locale 1 .
5234: It is used for locale-dependent
5235: .Xr strftime 3
5236: format specifiers.
5237: .It Ev PWD
5238: The current working directory to be set in the global environment.
5239: This may be useful if it contains symbolic links.
5240: If the value of the variable does not match the current working
5241: directory, the variable is ignored and the result of
5242: .Xr getcwd 3
5243: is used instead.
5244: .It Ev SHELL
5245: The absolute path to the default shell for new windows.
5246: See the
5247: .Ic default-shell
5248: option for details.
5249: .It Ev TMUX_TMPDIR
5250: The parent directory of the directory containing the server sockets.
5251: See the
5252: .Fl L
5253: option for details.
5254: .It Ev VISUAL
5255: If the command specified in this variable contains the string
5256: .Ql vi ,
5257: use vi-style key bindings.
5258: Overridden by the
5259: .Ic mode-keys
5260: and
5261: .Ic status-keys
5262: options.
1.1 nicm 5263: .El
5264: .Sh FILES
1.26 nicm 5265: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1 nicm 5266: .It Pa ~/.tmux.conf
1.6 jmc 5267: Default
1.1 nicm 5268: .Nm
1.6 jmc 5269: configuration file.
1.26 nicm 5270: .It Pa /etc/tmux.conf
5271: System-wide configuration file.
1.1 nicm 5272: .El
1.57 jmc 5273: .Sh EXAMPLES
5274: To create a new
5275: .Nm
5276: session running
5277: .Xr vi 1 :
5278: .Pp
5279: .Dl $ tmux new-session vi
5280: .Pp
5281: Most commands have a shorter form, known as an alias.
5282: For new-session, this is
5283: .Ic new :
5284: .Pp
5285: .Dl $ tmux new vi
5286: .Pp
5287: Alternatively, the shortest unambiguous form of a command is accepted.
5288: If there are several options, they are listed:
5289: .Bd -literal -offset indent
5290: $ tmux n
5291: ambiguous command: n, could be: new-session, new-window, next-window
5292: .Ed
5293: .Pp
5294: Within an active session, a new window may be created by typing
5295: .Ql C-b c
5296: (Ctrl
5297: followed by the
5298: .Ql b
5299: key
5300: followed by the
5301: .Ql c
5302: key).
5303: .Pp
5304: Windows may be navigated with:
5305: .Ql C-b 0
5306: (to select window 0),
5307: .Ql C-b 1
5308: (to select window 1), and so on;
5309: .Ql C-b n
5310: to select the next window; and
5311: .Ql C-b p
5312: to select the previous window.
5313: .Pp
5314: A session may be detached using
5315: .Ql C-b d
1.64 nicm 5316: (or by an external event such as
5317: .Xr ssh 1
5318: disconnection) and reattached with:
1.57 jmc 5319: .Pp
5320: .Dl $ tmux attach-session
5321: .Pp
5322: Typing
5323: .Ql C-b \&?
5324: lists the current key bindings in the current window; up and down may be used
5325: to navigate the list or
5326: .Ql q
5327: to exit from it.
5328: .Pp
5329: Commands to be run when the
5330: .Nm
5331: server is started may be placed in the
5332: .Pa ~/.tmux.conf
5333: configuration file.
5334: Common examples include:
5335: .Pp
5336: Changing the default prefix key:
5337: .Bd -literal -offset indent
5338: set-option -g prefix C-a
5339: unbind-key C-b
5340: bind-key C-a send-prefix
5341: .Ed
5342: .Pp
5343: Turning the status line off, or changing its colour:
5344: .Bd -literal -offset indent
5345: set-option -g status off
1.378 nicm 5346: set-option -g status-style bg=blue
1.57 jmc 5347: .Ed
5348: .Pp
5349: Setting other options, such as the default command,
5350: or locking after 30 minutes of inactivity:
5351: .Bd -literal -offset indent
5352: set-option -g default-command "exec /bin/ksh"
5353: set-option -g lock-after-time 1800
5354: .Ed
5355: .Pp
5356: Creating new key bindings:
5357: .Bd -literal -offset indent
5358: bind-key b set-option status
5359: bind-key / command-prompt "split-window 'exec man %%'"
1.73 nicm 5360: bind-key S command-prompt "new-window -n %1 'ssh %1'"
1.57 jmc 5361: .Ed
1.1 nicm 5362: .Sh SEE ALSO
5363: .Xr pty 4
5364: .Sh AUTHORS
1.477 nicm 5365: .An Nicholas Marriott Aq Mt nicholas.marriott@gmail.com