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