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