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