Annotation of src/usr.bin/tmux/tmux.1, Revision 1.267
1.267 ! nicm 1: .\" $OpenBSD: tmux.1,v 1.266 2012/01/21 08:23:12 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.266 nicm 17: .Dd $Mdocdate: January 21 2012 $
1.1 nicm 18: .Dt TMUX 1
19: .Os
20: .Sh NAME
21: .Nm tmux
1.6 jmc 22: .Nd terminal multiplexer
1.1 nicm 23: .Sh SYNOPSIS
24: .Nm tmux
25: .Bk -words
1.114 nicm 26: .Op Fl 28lquv
1.91 nicm 27: .Op Fl c Ar shell-command
1.1 nicm 28: .Op Fl f Ar file
29: .Op Fl L Ar socket-name
30: .Op Fl S Ar socket-path
31: .Op Ar command Op Ar flags
32: .Ek
33: .Sh DESCRIPTION
34: .Nm
1.59 jmc 35: is a terminal multiplexer:
36: it enables a number of terminals to be created, accessed, and
37: controlled from a single screen.
1.67 jmc 38: .Nm
39: may be detached from a screen
40: and continue running in the background,
41: then later reattached.
1.1 nicm 42: .Pp
1.60 nicm 43: When
44: .Nm
45: is started it creates a new
46: .Em session
47: with a single
48: .Em window
49: and displays it on screen.
50: A status line at the bottom of the screen
51: shows information on the current session
52: and is used to enter interactive commands.
53: .Pp
54: A session is a single collection of
55: .Em pseudo terminals
56: under the management of
57: .Nm .
58: Each session has one or more
59: windows linked to it.
60: A window occupies the entire screen
61: and may be split into rectangular panes,
62: each of which is a separate pseudo terminal
63: (the
64: .Xr pty 4
65: manual page documents the technical details of pseudo terminals).
66: Any number of
67: .Nm
68: instances may connect to the same session,
69: and any number of windows may be present in the same session.
70: Once all sessions are killed,
71: .Nm
72: exits.
73: .Pp
1.64 nicm 74: Each session is persistent and will survive accidental disconnection
1.66 jmc 75: (such as
1.64 nicm 76: .Xr ssh 1
1.67 jmc 77: connection timeout) or intentional detaching (with the
1.64 nicm 78: .Ql C-b d
79: key strokes).
80: .Nm
81: may be reattached using:
82: .Pp
83: .Dl $ tmux attach
1.60 nicm 84: .Pp
1.64 nicm 85: In
86: .Nm ,
87: a session is displayed on screen by a
88: .Em client
89: and all sessions are managed by a single
90: .Em server .
91: The server and each client are separate processes which communicate through a
92: socket in
93: .Pa /tmp .
1.65 nicm 94: .Pp
1.1 nicm 95: The options are as follows:
96: .Bl -tag -width "XXXXXXXXXXXX"
97: .It Fl 2
98: Force
99: .Nm
100: to assume the terminal supports 256 colours.
101: .It Fl 8
102: Like
103: .Fl 2 ,
1.6 jmc 104: but indicates that the terminal supports 88 colours.
1.91 nicm 105: .It Fl c Ar shell-command
106: Execute
107: .Ar shell-command
108: using the default shell.
109: If necessary, the
110: .Nm
111: server will be started to retrieve the
112: .Ic default-shell
113: option.
1.153 nicm 114: This option is for compatibility with
115: .Xr sh 1
116: when
117: .Nm
118: is used as a login shell.
1.1 nicm 119: .It Fl f Ar file
120: Specify an alternative configuration file.
121: By default,
122: .Nm
1.26 nicm 123: loads the system configuration file from
124: .Pa /etc/tmux.conf ,
125: if present, then looks for a user configuration file at
1.1 nicm 126: .Pa ~/.tmux.conf .
127: The configuration file is a set of
128: .Nm
129: commands which are executed in sequence when the server is first started.
1.61 nicm 130: .Pp
131: If a command in the configuration file fails,
132: .Nm
133: will report an error and exit without executing further commands.
1.1 nicm 134: .It Fl L Ar socket-name
135: .Nm
136: stores the server socket in a directory under
1.208 nicm 137: .Pa /tmp
138: (or
139: .Ev TMPDIR
140: if set);
1.1 nicm 141: the default socket is named
142: .Em default .
143: This option allows a different socket name to be specified, allowing several
144: independent
145: .Nm
146: servers to be run.
147: Unlike
148: .Fl S
149: a full path is not necessary: the sockets are all created in the same
150: directory.
1.2 nicm 151: .Pp
152: If the socket is accidentally removed, the
1.6 jmc 153: .Dv SIGUSR1
1.2 nicm 154: signal may be sent to the
155: .Nm
156: server process to recreate it.
1.166 sobrado 157: .It Fl l
158: Behave as a login shell.
159: This flag currently has no effect and is for compatibility with other shells
160: when using tmux as a login shell.
1.4 sobrado 161: .It Fl q
1.133 nicm 162: Set the
163: .Ic quiet
164: server option to prevent the server sending various informational messages.
1.1 nicm 165: .It Fl S Ar socket-path
166: Specify a full alternative path to the server socket.
167: If
168: .Fl S
169: is specified, the default socket directory is not used and any
170: .Fl L
171: flag is ignored.
172: .It Fl u
173: .Nm
1.14 nicm 174: attempts to guess if the terminal is likely to support UTF-8 by checking the
175: first of the
176: .Ev LC_ALL ,
177: .Ev LC_CTYPE
178: and
1.2 nicm 179: .Ev LANG
1.14 nicm 180: environment variables to be set for the string "UTF-8".
1.5 nicm 181: This is not always correct: the
1.2 nicm 182: .Fl u
183: flag explicitly informs
184: .Nm
1.6 jmc 185: that UTF-8 is supported.
1.33 nicm 186: .Pp
187: If the server is started from a client passed
188: .Fl u
189: or where UTF-8 is detected, the
190: .Ic utf8
191: and
192: .Ic status-utf8
193: options are enabled in the global window and session options respectively.
1.1 nicm 194: .It Fl v
195: Request verbose logging.
196: This option may be specified multiple times for increasing verbosity.
197: Log messages will be saved into
198: .Pa tmux-client-PID.log
199: and
200: .Pa tmux-server-PID.log
201: files in the current directory, where
202: .Em PID
1.6 jmc 203: is the PID of the server or client process.
1.1 nicm 204: .It Ar command Op Ar flags
205: This specifies one of a set of commands used to control
206: .Nm ,
1.6 jmc 207: as described in the following sections.
1.59 jmc 208: If no commands are specified, the
1.1 nicm 209: .Ic new-session
210: command is assumed.
1.57 jmc 211: .El
1.64 nicm 212: .Sh KEY BINDINGS
213: .Nm
214: may be controlled from an attached client by using a key combination of a
215: prefix key,
216: .Ql C-b
217: (Ctrl-b) by default, followed by a command key.
218: .Pp
1.172 nicm 219: The default command key bindings are:
1.64 nicm 220: .Pp
1.171 nicm 221: .Bl -tag -width "XXXXXXXXXX" -offset indent -compact
222: .It C-b
223: Send the prefix key (C-b) through to the application.
224: .It C-o
225: Rotate the panes in the current window forwards.
226: .It C-z
227: Suspend the
228: .Nm
229: client.
230: .It !
231: Break the current pane out of the window.
232: .It \&"
233: Split the current pane into two, top and bottom.
234: .It #
235: List all paste buffers.
1.236 nicm 236: .It $
237: Rename the current session.
1.171 nicm 238: .It %
239: Split the current pane into two, left and right.
240: .It &
241: Kill the current window.
242: .It '
243: Prompt for a window index to select.
244: .It ,
245: Rename the current window.
246: .It -
247: Delete the most recently copied buffer of text.
248: .It .
249: Prompt for an index to move the current window.
250: .It 0 to 9
251: Select windows 0 to 9.
252: .It :
253: Enter the
254: .Nm
255: command prompt.
1.187 nicm 256: .It ;
257: Move to the previously active pane.
1.178 nicm 258: .It =
259: Choose which buffer to paste interactively from a list.
1.171 nicm 260: .It \&?
261: List all key bindings.
262: .It D
263: Choose a client to detach.
1.182 jmc 264: .It \&[
1.171 nicm 265: Enter copy mode to copy text or view the history.
1.182 jmc 266: .It \&]
1.171 nicm 267: Paste the most recently copied buffer of text.
1.64 nicm 268: .It c
1.65 nicm 269: Create a new window.
1.64 nicm 270: .It d
1.65 nicm 271: Detach the current client.
1.171 nicm 272: .It f
273: Prompt to search for text in open windows.
274: .It i
275: Display some information about the current window.
1.64 nicm 276: .It l
1.65 nicm 277: Move to the previously selected window.
1.64 nicm 278: .It n
1.65 nicm 279: Change to the next window.
1.171 nicm 280: .It o
281: Select the next pane in the current window.
1.64 nicm 282: .It p
1.65 nicm 283: Change to the previous window.
1.171 nicm 284: .It q
285: Briefly display pane indexes.
286: .It r
287: Force redraw of the attached client.
288: .It s
289: Select a new session for the attached client interactively.
1.194 nicm 290: .It L
291: Switch the attached client back to the last session.
1.171 nicm 292: .It t
293: Show the time.
294: .It w
295: Choose the current window interactively.
296: .It x
297: Kill the current pane.
298: .It {
299: Swap the current pane with the previous pane.
300: .It }
301: Swap the current pane with the next pane.
302: .It ~
303: Show previous messages from
304: .Nm ,
305: if any.
306: .It Page Up
307: Enter copy mode and scroll one page up.
308: .It Up, Down
309: .It Left, Right
310: Change to the pane above, below, to the left, or to the right of the current
311: pane.
312: .It M-1 to M-5
313: Arrange panes in one of the five preset layouts: even-horizontal,
314: even-vertical, main-horizontal, main-vertical, or tiled.
315: .It M-n
316: Move to the next window with a bell or activity marker.
317: .It M-o
318: Rotate the panes in the current window backwards.
319: .It M-p
320: Move to the previous window with a bell or activity marker.
321: .It C-Up, C-Down
322: .It C-Left, C-Right
323: Resize the current pane in steps of one cell.
324: .It M-Up, M-Down
325: .It M-Left, M-Right
326: Resize the current pane in steps of five cells.
1.64 nicm 327: .El
328: .Pp
329: Key bindings may be changed with the
330: .Ic bind-key
331: and
332: .Ic unbind-key
333: commands.
1.57 jmc 334: .Sh COMMANDS
335: This section contains a list of the commands supported by
336: .Nm .
337: Most commands accept the optional
338: .Fl t
339: argument with one of
340: .Ar target-client ,
341: .Ar target-session
342: .Ar target-window ,
343: or
344: .Ar target-pane .
345: These specify the client, session, window or pane which a command should affect.
346: .Ar target-client
347: is the name of the
348: .Xr pty 4
349: file to which the client is connected, for example either of
350: .Pa /dev/ttyp1
351: or
352: .Pa ttyp1
353: for the client attached to
354: .Pa /dev/ttyp1 .
355: If no client is specified, the current client is chosen, if possible, or an
356: error is reported.
357: Clients may be listed with the
358: .Ic list-clients
359: command.
1.1 nicm 360: .Pp
1.57 jmc 361: .Ar target-session
362: is either the name of a session (as listed by the
363: .Ic list-sessions
364: command) or the name of a client with the same syntax as
365: .Ar target-client ,
366: in which case the session attached to the client is used.
367: When looking for the session name,
368: .Nm
369: initially searches for an exact match; if none is found, the session names
370: are checked for any for which
371: .Ar target-session
372: is a prefix or for which it matches as an
373: .Xr fnmatch 3
374: pattern.
375: If a single match is found, it is used as the target session; multiple matches
376: produce an error.
377: If a session is omitted, the current session is used if available; if no
1.117 nicm 378: current session is available, the most recently used is chosen.
1.1 nicm 379: .Pp
1.57 jmc 380: .Ar target-window
381: specifies a window in the form
382: .Em session Ns \&: Ns Em window .
383: .Em session
384: follows the same rules as for
385: .Ar target-session ,
386: and
387: .Em window
388: is looked for in order: as a window index, for example mysession:1; as an exact
389: window name, such as mysession:mywindow; then as an
390: .Xr fnmatch 3
391: pattern or the start of a window name, such as mysession:mywin* or
392: mysession:mywin.
393: An empty window name specifies the next unused index if appropriate (for
394: example the
395: .Ic new-window
396: and
397: .Ic link-window
398: commands)
399: otherwise the current window in
400: .Em session
401: is chosen.
1.140 nicm 402: The special character
403: .Ql \&!
404: uses the last (previously current) window, or
405: .Ql +
406: and
407: .Ql -
408: are the next window or the previous window by number.
1.57 jmc 409: When the argument does not contain a colon,
410: .Nm
411: first attempts to parse it as window; if that fails, an attempt is made to
412: match a session.
1.1 nicm 413: .Pp
1.57 jmc 414: .Ar target-pane
415: takes a similar form to
416: .Ar target-window
417: but with the optional addition of a period followed by a pane index, for
418: example: mysession:mywindow.1.
419: If the pane index is omitted, the currently active pane in the specified
420: window is used.
421: If neither a colon nor period appears,
1.13 nicm 422: .Nm
1.57 jmc 423: first attempts to use the argument as a pane index; if that fails, it is looked
424: up as for
425: .Ar target-window .
1.156 nicm 426: A
427: .Ql +
428: or
429: .Ql -
430: indicate the next or previous pane index, respectively.
1.132 nicm 431: One of the strings
432: .Em top ,
433: .Em bottom ,
434: .Em left ,
435: .Em right ,
436: .Em top-left ,
437: .Em top-right ,
1.216 nicm 438: .Em bottom-left
439: or
1.132 nicm 440: .Em bottom-right
441: may be used instead of a pane index.
1.177 nicm 442: .Pp
443: The special characters
444: .Ql +
445: and
446: .Ql -
447: may be followed by an offset, for example:
448: .Bd -literal -offset indent
449: select-window -t:+2
450: .Ed
451: .Pp
452: When dealing with a session that doesn't contain sequential window indexes,
453: they will be correctly skipped.
1.212 nicm 454: .Pp
455: .Nm
456: also gives each pane created in a server an identifier consisting of a
457: .Ql %
458: and a number, starting from zero.
459: A pane's identifier is unique for the life of the
460: .Nm
461: server and is passed to the child process of the pane in the
462: .Ev TMUX_PANE
463: environment variable.
464: It may be used alone to target a pane or the window containing it.
1.15 jmc 465: .Pp
1.153 nicm 466: .Ar shell-command
467: arguments are
468: .Xr sh 1
469: commands.
470: These must be passed as a single item, which typically means quoting them, for
471: example:
472: .Bd -literal -offset indent
473: new-window 'vi /etc/passwd'
474: .Ed
475: .Pp
476: .Ar command
477: .Op Ar arguments
478: refers to a
479: .Nm
480: command, passed with the command and arguments separately, for example:
481: .Bd -literal -offset indent
482: bind-key F1 set-window-option force-width 81
483: .Ed
484: .Pp
485: Or if using
486: .Xr sh 1 :
487: .Bd -literal -offset indent
488: $ tmux bind-key F1 set-window-option force-width 81
489: .Ed
490: .Pp
1.57 jmc 491: Multiple commands may be specified together as part of a
492: .Em command sequence .
493: Each command should be separated by spaces and a semicolon;
1.244 nicm 494: commands are executed sequentially from left to right and
495: lines ending with a backslash continue on to the next line.
1.57 jmc 496: A literal semicolon may be included by escaping it with a backslash (for
497: example, when specifying a command sequence to
498: .Ic bind-key ) .
1.13 nicm 499: .Pp
1.153 nicm 500: Example
501: .Nm
502: commands include:
1.13 nicm 503: .Bd -literal -offset indent
1.57 jmc 504: refresh-client -t/dev/ttyp2
505:
506: rename-session -tfirst newname
507:
508: set-window-option -t:0 monitor-activity on
509:
510: new-window ; split-window -d
1.244 nicm 511:
512: bind-key R source-file ~/.tmux.conf \e; \e
513: display-message "source-file done"
1.13 nicm 514: .Ed
1.153 nicm 515: .Pp
516: Or from
517: .Xr sh 1 :
518: .Bd -literal -offset indent
519: $ tmux kill-window -t :1
520:
1.159 jmc 521: $ tmux new-window \e; split-window -d
1.153 nicm 522:
1.159 jmc 523: $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
1.153 nicm 524: .Ed
1.57 jmc 525: .Sh CLIENTS AND SESSIONS
1.153 nicm 526: The
527: .Nm
528: server manages clients, sessions, windows and panes.
529: Clients are attached to sessions to interact with them, either
530: when they are created with the
531: .Ic new-session
532: command, or later with the
533: .Ic attach-session
534: command.
1.188 nicm 535: Each session has one or more windows
1.153 nicm 536: .Em linked
537: into it.
538: Windows may be linked to multiple sessions and are made up of one or
539: more panes,
540: each of which contains a pseudo terminal.
541: Commands for creating, linking and otherwise manipulating windows
542: are covered
543: in the
544: .Sx WINDOWS AND PANES
545: section.
546: .Pp
547: The following commands are available to manage clients and sessions:
1.57 jmc 548: .Bl -tag -width Ds
549: .It Xo Ic attach-session
1.148 nicm 550: .Op Fl dr
1.57 jmc 551: .Op Fl t Ar target-session
552: .Xc
553: .D1 (alias: Ic attach )
554: If run from outside
555: .Nm ,
556: create a new client in the current terminal and attach it to
557: .Ar target-session .
558: If used from inside, switch the current client.
559: If
560: .Fl d
561: is specified, any other clients attached to the session are detached.
1.148 nicm 562: .Fl r
563: signifies the client is read-only (only keys bound to the
564: .Ic detach-client
1.242 nicm 565: or
566: .Ic switch-client
567: commands have any effect)
1.13 nicm 568: .Pp
1.57 jmc 569: If no server is started,
570: .Ic attach-session
571: will attempt to start it; this will fail unless sessions are created in the
572: configuration file.
1.217 nicm 573: .Pp
574: The
575: .Ar target-session
576: rules for
577: .Ic attach-session
578: are slightly adjusted: if
579: .Nm
580: needs to select the most recently used session, it will prefer the most
581: recently used
582: .Em unattached
583: session.
1.211 nicm 584: .It Xo Ic detach-client
585: .Op Fl P
1.219 nicm 586: .Op Fl s Ar target-session
1.211 nicm 587: .Op Fl t Ar target-client
588: .Xc
1.57 jmc 589: .D1 (alias: Ic detach )
1.218 nicm 590: Detach the current client if bound to a key, the client specified with
591: .Fl t ,
1.258 jmc 592: or all clients currently attached to the session specified by
1.218 nicm 593: .Fl s .
1.211 nicm 594: If
595: .Fl P
596: is given, send SIGHUP to the parent process of the client, typically causing it
597: to exit.
1.57 jmc 598: .It Ic has-session Op Fl t Ar target-session
599: .D1 (alias: Ic has )
600: Report an error and exit with 1 if the specified session does not exist.
601: If it does exist, exit with 0.
602: .It Ic kill-server
603: Kill the
1.1 nicm 604: .Nm
1.57 jmc 605: server and clients and destroy all sessions.
606: .It Ic kill-session Op Fl t Ar target-session
607: Destroy the given session, closing any windows linked to it and no other
608: sessions, and detaching all clients attached to it.
1.250 nicm 609: .It Xo Ic list-clients
610: .Op Fl F Ar format
611: .Op Fl t Ar target-session
612: .Xc
1.57 jmc 613: .D1 (alias: Ic lsc )
1.221 jmc 614: List all clients attached to the server.
1.250 nicm 615: For the meaning of the
616: .Fl F
617: flag, see the
1.252 jmc 618: .Sx FORMATS
619: section.
1.221 jmc 620: If
1.220 nicm 621: .Ar target-session
622: is specified, list only clients connected to that session.
1.57 jmc 623: .It Ic list-commands
624: .D1 (alias: Ic lscm )
625: List the syntax of all commands supported by
626: .Nm .
1.247 nicm 627: .It Ic list-sessions Op Fl F Ar format
1.57 jmc 628: .D1 (alias: Ic ls )
629: List all sessions managed by the server.
1.247 nicm 630: For the meaning of the
631: .Fl F
632: flag, see the
633: .Sx FORMATS
634: section.
1.175 nicm 635: .It Ic lock-client Op Fl t Ar target-client
636: .D1 (alias: Ic lockc )
1.92 nicm 637: Lock
638: .Ar target-client ,
639: see the
640: .Ic lock-server
641: command.
1.175 nicm 642: .It Ic lock-session Op Fl t Ar target-session
643: .D1 (alias: Ic locks )
1.92 nicm 644: Lock all clients attached to
645: .Ar target-session .
1.57 jmc 646: .It Xo Ic new-session
647: .Op Fl d
648: .Op Fl n Ar window-name
649: .Op Fl s Ar session-name
1.101 nicm 650: .Op Fl t Ar target-session
1.210 nicm 651: .Op Fl x Ar width
652: .Op Fl y Ar height
1.153 nicm 653: .Op Ar shell-command
1.57 jmc 654: .Xc
655: .D1 (alias: Ic new )
656: Create a new session with name
657: .Ar session-name .
1.153 nicm 658: .Pp
1.57 jmc 659: The new session is attached to the current terminal unless
660: .Fl d
661: is given.
662: .Ar window-name
1.1 nicm 663: and
1.153 nicm 664: .Ar shell-command
665: are the name of and shell command to execute in the initial window.
1.210 nicm 666: If
667: .Fl d
668: is used,
669: .Fl x
670: and
671: .Fl y
672: specify the size of the initial window (80 by 24 if not given).
1.68 nicm 673: .Pp
674: If run from a terminal, any
675: .Xr termios 4
676: special characters are saved and used for new windows in the new session.
1.101 nicm 677: .Pp
678: If
679: .Fl t
680: is given, the new session is
681: .Em grouped
682: with
683: .Ar target-session .
684: This means they share the same set of windows - all windows from
685: .Ar target-session
686: are linked to the new session and any subsequent new windows or windows being
687: closed are applied to both sessions.
688: The current and previous window and any session options remain independent and
689: either session may be killed without affecting the other.
690: Giving
691: .Fl n
692: or
1.153 nicm 693: .Ar shell-command
1.101 nicm 694: are invalid if
695: .Fl t
696: is used.
1.248 nicm 697: .It Xo Ic refresh-client
698: .Op Fl S
699: .Op Fl t Ar target-client
700: .Xc
1.57 jmc 701: .D1 (alias: Ic refresh )
702: Refresh the current client if bound to a key, or a single client if one is given
703: with
704: .Fl t .
1.248 nicm 705: If
706: .Fl S
707: is specified, only update the client's status bar.
1.57 jmc 708: .It Xo Ic rename-session
709: .Op Fl t Ar target-session
710: .Ar new-name
711: .Xc
712: .D1 (alias: Ic rename )
713: Rename the session to
714: .Ar new-name .
1.121 nicm 715: .It Xo Ic show-messages
1.120 nicm 716: .Op Fl t Ar target-client
717: .Xc
718: .D1 (alias: Ic showmsgs )
719: Any messages displayed on the status line are saved in a per-client message
720: log, up to a maximum of the limit set by the
721: .Ar message-limit
722: session option for the session attached to that client.
723: This command displays the log for
724: .Ar target-client .
1.57 jmc 725: .It Ic source-file Ar path
726: .D1 (alias: Ic source )
727: Execute commands from
728: .Ar path .
729: .It Ic start-server
730: .D1 (alias: Ic start )
731: Start the
1.1 nicm 732: .Nm
1.57 jmc 733: server, if not already running, without creating any sessions.
734: .It Xo Ic suspend-client
1.202 nicm 735: .Op Fl t Ar target-client
1.57 jmc 736: .Xc
737: .D1 (alias: Ic suspendc )
738: Suspend a client by sending
739: .Dv SIGTSTP
740: (tty stop).
741: .It Xo Ic switch-client
1.242 nicm 742: .Op Fl lnpr
1.57 jmc 743: .Op Fl c Ar target-client
744: .Op Fl t Ar target-session
745: .Xc
746: .D1 (alias: Ic switchc )
747: Switch the current session for client
748: .Ar target-client
749: to
750: .Ar target-session .
1.183 nicm 751: If
1.197 jmc 752: .Fl l ,
1.183 nicm 753: .Fl n
754: or
755: .Fl p
1.194 nicm 756: is used, the client is moved to the last, next or previous session
757: respectively.
1.242 nicm 758: .Fl r
759: toggles whether a client is read-only (see the
760: .Ic attach-session
761: command).
1.57 jmc 762: .El
763: .Sh WINDOWS AND PANES
1.1 nicm 764: A
765: .Nm
766: window may be in one of several modes.
767: The default permits direct access to the terminal attached to the window.
1.164 nicm 768: The other is copy mode, which permits a section of a window or its
769: history to be copied to a
1.1 nicm 770: .Em paste buffer
771: for later insertion into another window.
772: This mode is entered with the
773: .Ic copy-mode
774: command, bound to
1.113 nicm 775: .Ql \&[
1.1 nicm 776: by default.
1.164 nicm 777: It is also entered when a command that produces output, such as
778: .Ic list-keys ,
779: is executed from a key binding.
1.1 nicm 780: .Pp
1.6 jmc 781: The keys available depend on whether emacs or vi mode is selected
782: (see the
1.1 nicm 783: .Ic mode-keys
784: option).
785: The following keys are supported as appropriate for the mode:
1.157 nicm 786: .Bl -column "FunctionXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
1.1 nicm 787: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
1.27 nicm 788: .It Li "Back to indentation" Ta "^" Ta "M-m"
1.142 nicm 789: .It Li "Bottom of history" Ta "G" Ta "M-<"
1.1 nicm 790: .It Li "Clear selection" Ta "Escape" Ta "C-g"
791: .It Li "Copy selection" Ta "Enter" Ta "M-w"
792: .It Li "Cursor down" Ta "j" Ta "Down"
1.70 nicm 793: .It Li "Cursor left" Ta "h" Ta "Left"
794: .It Li "Cursor right" Ta "l" Ta "Right"
1.116 nicm 795: .It Li "Cursor to bottom line" Ta "L" Ta ""
796: .It Li "Cursor to middle line" Ta "M" Ta "M-r"
797: .It Li "Cursor to top line" Ta "H" Ta "M-R"
1.70 nicm 798: .It Li "Cursor up" Ta "k" Ta "Up"
1.71 nicm 799: .It Li "Delete entire line" Ta "d" Ta "C-u"
1.227 nicm 800: .It Li "Delete/Copy to end of line" Ta "D" Ta "C-k"
1.1 nicm 801: .It Li "End of line" Ta "$" Ta "C-e"
1.142 nicm 802: .It Li "Go to line" Ta ":" Ta "g"
1.116 nicm 803: .It Li "Half page down" Ta "C-d" Ta "M-Down"
804: .It Li "Half page up" Ta "C-u" Ta "M-Up"
1.157 nicm 805: .It Li "Jump forward" Ta "f" Ta "f"
1.256 nicm 806: .It Li "Jump to forward" Ta "t" Ta ""
1.157 nicm 807: .It Li "Jump backward" Ta "F" Ta "F"
1.256 nicm 808: .It Li "Jump to backward" Ta "T" Ta ""
1.157 nicm 809: .It Li "Jump again" Ta ";" Ta ";"
810: .It Li "Jump again in reverse" Ta "," Ta ","
1.1 nicm 811: .It Li "Next page" Ta "C-f" Ta "Page down"
1.146 nicm 812: .It Li "Next space" Ta "W" Ta ""
813: .It Li "Next space, end of word" Ta "E" Ta ""
1.143 nicm 814: .It Li "Next word" Ta "w" Ta ""
815: .It Li "Next word end" Ta "e" Ta "M-f"
1.70 nicm 816: .It Li "Paste buffer" Ta "p" Ta "C-y"
1.116 nicm 817: .It Li "Previous page" Ta "C-b" Ta "Page up"
1.1 nicm 818: .It Li "Previous word" Ta "b" Ta "M-b"
1.146 nicm 819: .It Li "Previous space" Ta "B" Ta ""
1.1 nicm 820: .It Li "Quit mode" Ta "q" Ta "Escape"
1.147 nicm 821: .It Li "Rectangle toggle" Ta "v" Ta "R"
1.141 nicm 822: .It Li "Scroll down" Ta "C-Down or C-e" Ta "C-Down"
823: .It Li "Scroll up" Ta "C-Up or C-y" Ta "C-Up"
1.70 nicm 824: .It Li "Search again" Ta "n" Ta "n"
1.152 nicm 825: .It Li "Search again in reverse" Ta "N" Ta "N"
1.70 nicm 826: .It Li "Search backward" Ta "?" Ta "C-r"
827: .It Li "Search forward" Ta "/" Ta "C-s"
828: .It Li "Start of line" Ta "0" Ta "C-a"
1.1 nicm 829: .It Li "Start selection" Ta "Space" Ta "C-Space"
1.142 nicm 830: .It Li "Top of history" Ta "g" Ta "M->"
1.80 nicm 831: .It Li "Transpose chars" Ta "" Ta "C-t"
1.1 nicm 832: .El
1.146 nicm 833: .Pp
834: The next and previous word keys use space and the
835: .Ql - ,
1.154 nicm 836: .Ql _
1.146 nicm 837: and
838: .Ql @
1.154 nicm 839: characters as word delimiters by default, but this can be adjusted by
840: setting the
841: .Em word-separators
1.255 nicm 842: session option.
1.146 nicm 843: Next word moves to the start of the next word, next word end to the end of the
844: next word and previous word to the start of the previous word.
845: The three next and previous space keys work similarly but use a space alone as
846: the word separator.
1.157 nicm 847: .Pp
848: The jump commands enable quick movement within a line.
849: For instance, typing
850: .Ql f
851: followed by
852: .Ql /
853: will move the cursor to the next
854: .Ql /
855: character on the current line.
856: A
857: .Ql \&;
858: will then jump to the next occurrence.
1.1 nicm 859: .Pp
1.155 nicm 860: Commands in copy mode may be prefaced by an optional repeat count.
861: With vi key bindings, a prefix is entered using the number keys; with
862: emacs, the Alt (meta) key and a number begins prefix entry.
863: For example, to move the cursor forward by ten words, use
864: .Ql M-1 0 M-f
865: in emacs mode, and
866: .Ql 10w
867: in vi.
868: .Pp
1.254 nicm 869: When copying the selection, the repeat count indicates the buffer index to
870: replace, if used.
871: .Pp
1.155 nicm 872: Mode key bindings are defined in a set of named tables:
1.48 nicm 873: .Em vi-edit
874: and
875: .Em emacs-edit
876: for keys used when line editing at the command prompt;
877: .Em vi-choice
878: and
879: .Em emacs-choice
880: for keys used when choosing from lists (such as produced by the
1.144 nicm 881: .Ic choose-window
1.164 nicm 882: command); and
1.48 nicm 883: .Em vi-copy
884: and
885: .Em emacs-copy
1.97 nicm 886: used in copy mode.
1.48 nicm 887: The tables may be viewed with the
888: .Ic list-keys
1.49 nicm 889: command and keys modified or removed with
890: .Ic bind-key
891: and
892: .Ic unbind-key .
1.48 nicm 893: .Pp
1.2 nicm 894: The paste buffer key pastes the first line from the top paste buffer on the
895: stack.
1.57 jmc 896: .Pp
1.164 nicm 897: The synopsis for the
898: .Ic copy-mode
899: command is:
1.57 jmc 900: .Bl -tag -width Ds
901: .It Xo Ic copy-mode
902: .Op Fl u
1.72 nicm 903: .Op Fl t Ar target-pane
1.57 jmc 904: .Xc
905: Enter copy mode.
906: The
907: .Fl u
908: option scrolls one page up.
909: .El
1.18 nicm 910: .Pp
1.1 nicm 911: Each window displayed by
912: .Nm
913: may be split into one or more
914: .Em panes ;
915: each pane takes up a certain area of the display and is a separate terminal.
916: A window may be split into panes using the
917: .Ic split-window
918: command.
1.38 nicm 919: Windows may be split horizontally (with the
920: .Fl h
921: flag) or vertically.
922: Panes may be resized with the
923: .Ic resize-pane
1.1 nicm 924: command (bound to
1.38 nicm 925: .Ql C-up ,
926: .Ql C-down
927: .Ql C-left
928: and
929: .Ql C-right
1.1 nicm 930: by default), the current pane may be changed with the
1.156 nicm 931: .Ic select-pane
932: command and the
1.1 nicm 933: .Ic rotate-window
934: and
935: .Ic swap-pane
1.38 nicm 936: commands may be used to swap panes without changing their position.
937: Panes are numbered beginning from zero in the order they are created.
938: .Pp
939: A number of preset
940: .Em layouts
941: are available.
942: These may be selected with the
943: .Ic select-layout
944: command or cycled with
945: .Ic next-layout
946: (bound to
1.149 nicm 947: .Ql Space
1.131 nicm 948: by default); once a layout is chosen, panes within it may be moved and resized
949: as normal.
1.1 nicm 950: .Pp
951: The following layouts are supported:
952: .Bl -tag -width Ds
953: .It Ic even-horizontal
954: Panes are spread out evenly from left to right across the window.
955: .It Ic even-vertical
956: Panes are spread evenly from top to bottom.
1.2 nicm 957: .It Ic main-horizontal
1.131 nicm 958: A large (main) pane is shown at the top of the window and the remaining panes
959: are spread from left to right in the leftover space at the bottom.
1.2 nicm 960: Use the
961: .Em main-pane-height
962: window option to specify the height of the top pane.
1.1 nicm 963: .It Ic main-vertical
1.2 nicm 964: Similar to
965: .Ic main-horizontal
966: but the large pane is placed on the left and the others spread from top to
967: bottom along the right.
968: See the
969: .Em main-pane-width
970: window option.
1.165 nicm 971: .It Ic tiled
972: Panes are spread out as evenly as possible over the window in both rows and
973: columns.
1.1 nicm 974: .El
1.8 nicm 975: .Pp
1.181 nicm 976: In addition,
977: .Ic select-layout
978: may be used to apply a previously used layout - the
979: .Ic list-windows
980: command displays the layout of each window in a form suitable for use with
981: .Ic select-layout .
982: For example:
983: .Bd -literal -offset indent
984: $ tmux list-windows
985: 0: ksh [159x48]
986: layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
987: $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
988: .Ed
1.196 nicm 989: .Pp
1.181 nicm 990: .Nm
991: automatically adjusts the size of the layout for the current window size.
992: Note that a layout cannot be applied to a window with more panes than that
993: from which the layout was originally defined.
994: .Pp
1.57 jmc 995: Commands related to windows and panes are as follows:
996: .Bl -tag -width Ds
997: .It Xo Ic break-pane
998: .Op Fl d
999: .Op Fl t Ar target-pane
1000: .Xc
1001: .D1 (alias: Ic breakp )
1002: Break
1003: .Ar target-pane
1004: off from its containing window to make it the only pane in a new window.
1005: If
1006: .Fl d
1007: is given, the new window does not become the current window.
1.128 nicm 1008: .It Xo Ic capture-pane
1009: .Op Fl b Ar buffer-index
1.213 nicm 1010: .Op Fl E Ar end-line
1011: .Op Fl S Ar start-line
1.128 nicm 1012: .Op Fl t Ar target-pane
1013: .Xc
1014: .D1 (alias: Ic capturep )
1015: Capture the contents of a pane to the specified buffer, or a new buffer if none
1016: is specified.
1.213 nicm 1017: .Pp
1018: .Fl S
1019: and
1020: .Fl E
1021: specify the starting and ending line numbers, zero is the first line of the
1022: visible pane and negative numbers are lines in the history.
1023: The default is to capture only the visible contents of the pane.
1.76 nicm 1024: .It Xo
1025: .Ic choose-client
1026: .Op Fl t Ar target-window
1027: .Op Ar template
1028: .Xc
1029: Put a window into client choice mode, allowing a client to be selected
1030: interactively from a list.
1031: After a client is chosen,
1032: .Ql %%
1033: is replaced by the client
1034: .Xr pty 4
1035: path in
1036: .Ar template
1037: and the result executed as a command.
1038: If
1039: .Ar template
1040: is not given, "detach-client -t '%%'" is used.
1.57 jmc 1041: This command works only from inside
1042: .Nm .
1.76 nicm 1043: .It Xo
1044: .Ic choose-session
1045: .Op Fl t Ar target-window
1046: .Op Ar template
1047: .Xc
1048: Put a window into session choice mode, where a session may be selected
1049: interactively from a list.
1050: When one is chosen,
1051: .Ql %%
1052: is replaced by the session name in
1053: .Ar template
1054: and the result executed as a command.
1055: If
1056: .Ar template
1057: is not given, "switch-client -t '%%'" is used.
1058: This command works only from inside
1059: .Nm .
1060: .It Xo
1061: .Ic choose-window
1062: .Op Fl t Ar target-window
1063: .Op Ar template
1064: .Xc
1065: Put a window into window choice mode, where a window may be chosen
1066: interactively from a list.
1067: After a window is selected,
1068: .Ql %%
1069: is replaced by the session name and window index in
1070: .Ar template
1071: and the result executed as a command.
1072: If
1073: .Ar template
1074: is not given, "select-window -t '%%'" is used.
1.57 jmc 1075: This command works only from inside
1076: .Nm .
1.78 nicm 1077: .It Ic display-panes Op Fl t Ar target-client
1078: .D1 (alias: Ic displayp)
1079: Display a visible indicator of each pane shown by
1080: .Ar target-client .
1081: See the
1.145 nicm 1082: .Ic display-panes-time ,
1083: .Ic display-panes-colour ,
1.78 nicm 1084: and
1.145 nicm 1085: .Ic display-panes-active-colour
1.78 nicm 1086: session options.
1.84 nicm 1087: While the indicator is on screen, a pane may be selected with the
1088: .Ql 0
1089: to
1090: .Ql 9
1091: keys.
1.57 jmc 1092: .It Xo Ic find-window
1093: .Op Fl t Ar target-window
1094: .Ar match-string
1095: .Xc
1096: .D1 (alias: Ic findw )
1097: Search for the
1098: .Xr fnmatch 3
1099: pattern
1100: .Ar match-string
1101: in window names, titles, and visible content (but not history).
1102: If only one window is matched, it'll be automatically selected, otherwise a
1103: choice list is shown.
1104: This command only works from inside
1.1 nicm 1105: .Nm .
1.137 nicm 1106: .It Xo Ic join-pane
1107: .Op Fl dhv
1108: .Oo Fl l
1109: .Ar size |
1110: .Fl p Ar percentage Oc
1111: .Op Fl s Ar src-pane
1112: .Op Fl t Ar dst-pane
1113: .Xc
1114: .D1 (alias: Ic joinp )
1115: Like
1116: .Ic split-window ,
1117: but instead of splitting
1118: .Ar dst-pane
1119: and creating a new pane, split it and move
1120: .Ar src-pane
1121: into the space.
1122: This can be used to reverse
1123: .Ic break-pane .
1.112 nicm 1124: .It Xo Ic kill-pane
1125: .Op Fl a
1126: .Op Fl t Ar target-pane
1127: .Xc
1.57 jmc 1128: .D1 (alias: Ic killp )
1129: Destroy the given pane.
1130: If no panes remain in the containing window, it is also destroyed.
1.112 nicm 1131: The
1132: .Fl a
1133: option kills all but the pane given with
1134: .Fl t .
1.57 jmc 1135: .It Ic kill-window Op Fl t Ar target-window
1136: .D1 (alias: Ic killw )
1137: Kill the current window or the window at
1138: .Ar target-window ,
1.1 nicm 1139: removing it from any sessions to which it is linked.
1.187 nicm 1140: .It Ic last-pane Op Fl t Ar target-window
1141: .D1 (alias: Ic lastp )
1142: Select the last (previously selected) pane.
1.56 jmc 1143: .It Ic last-window Op Fl t Ar target-session
1.1 nicm 1144: .D1 (alias: Ic last )
1145: Select the last (previously selected) window.
1146: If no
1147: .Ar target-session
1148: is specified, select the last window of the current session.
1149: .It Xo Ic link-window
1150: .Op Fl dk
1151: .Op Fl s Ar src-window
1152: .Op Fl t Ar dst-window
1153: .Xc
1154: .D1 (alias: Ic linkw )
1155: Link the window at
1156: .Ar src-window
1157: to the specified
1158: .Ar dst-window .
1159: If
1160: .Ar dst-window
1161: is specified and no such window exists, the
1162: .Ar src-window
1163: is linked there.
1164: If
1165: .Fl k
1166: is given and
1167: .Ar dst-window
1168: exists, it is killed, otherwise an error is generated.
1169: If
1170: .Fl d
1171: is given, the newly linked window is not selected.
1.214 nicm 1172: .It Xo Ic list-panes
1173: .Op Fl as
1.245 nicm 1174: .Op Fl F Ar format
1.214 nicm 1175: .Op Fl t Ar target
1176: .Xc
1.104 nicm 1177: .D1 (alias: Ic lsp )
1.214 nicm 1178: If
1179: .Fl a
1180: is given,
1181: .Ar target
1182: is ignored and all panes on the server are listed.
1183: If
1184: .Fl s
1185: is given,
1186: .Ar target
1187: is a session (or the current session).
1188: If neither is given,
1189: .Ar target
1190: is a window (or the current window).
1.247 nicm 1191: For the meaning of the
1192: .Fl F
1193: flag, see the
1194: .Sx FORMATS
1195: section.
1.214 nicm 1196: .It Xo Ic list-windows
1197: .Op Fl a
1.245 nicm 1198: .Op Fl F Ar format
1.214 nicm 1199: .Op Fl t Ar target-session
1200: .Xc
1.1 nicm 1201: .D1 (alias: Ic lsw )
1.214 nicm 1202: If
1203: .Fl a
1204: is given, list all windows on the server.
1205: Otherwise, list windows in the current session or in
1.1 nicm 1206: .Ar target-session .
1.245 nicm 1207: For the meaning of the
1208: .Fl F
1209: flag, see the
1210: .Sx FORMATS
1211: section.
1.1 nicm 1212: .It Xo Ic move-window
1.175 nicm 1213: .Op Fl dk
1.1 nicm 1214: .Op Fl s Ar src-window
1215: .Op Fl t Ar dst-window
1216: .Xc
1217: .D1 (alias: Ic movew )
1218: This is similar to
1219: .Ic link-window ,
1220: except the window at
1221: .Ar src-window
1222: is moved to
1223: .Ar dst-window .
1224: .It Xo Ic new-window
1.201 nicm 1225: .Op Fl adkP
1.1 nicm 1226: .Op Fl n Ar window-name
1227: .Op Fl t Ar target-window
1.153 nicm 1228: .Op Ar shell-command
1.1 nicm 1229: .Xc
1230: .D1 (alias: Ic neww )
1231: Create a new window.
1.160 nicm 1232: With
1233: .Fl a ,
1234: the new window is inserted at the next index up from the specified
1235: .Ar target-window ,
1236: moving windows up if necessary,
1237: otherwise
1238: .Ar target-window
1239: is the new window location.
1240: .Pp
1.1 nicm 1241: If
1242: .Fl d
1243: is given, the session does not make the new window the current window.
1244: .Ar target-window
1.28 nicm 1245: represents the window to be created; if the target already exists an error is
1246: shown, unless the
1247: .Fl k
1248: flag is used, in which case it is destroyed.
1.153 nicm 1249: .Ar shell-command
1.1 nicm 1250: is the command to execute.
1251: If
1.153 nicm 1252: .Ar shell-command
1253: is not specified, the value of the
1254: .Ic default-command
1255: option is used.
1256: .Pp
1257: When the shell command completes, the window closes.
1258: See the
1259: .Ic remain-on-exit
1260: option to change this behaviour.
1.1 nicm 1261: .Pp
1262: The
1263: .Ev TERM
1264: environment variable must be set to
1265: .Dq screen
1266: for all programs running
1267: .Em inside
1268: .Nm .
1269: New windows will automatically have
1270: .Dq TERM=screen
1271: added to their environment, but care must be taken not to reset this in shell
1272: start-up files.
1.201 nicm 1273: .Pp
1274: The
1275: .Fl P
1276: option prints the location of the new window after it has been created.
1.56 jmc 1277: .It Ic next-layout Op Fl t Ar target-window
1.1 nicm 1278: .D1 (alias: Ic nextl )
1279: Move a window to the next layout and rearrange the panes to fit.
1280: .It Xo Ic next-window
1.9 nicm 1281: .Op Fl a
1.1 nicm 1282: .Op Fl t Ar target-session
1283: .Xc
1284: .D1 (alias: Ic next )
1285: Move to the next window in the session.
1.9 nicm 1286: If
1.12 jmc 1287: .Fl a
1.9 nicm 1288: is used, move to the next window with a bell, activity or content alert.
1.107 nicm 1289: .It Xo Ic pipe-pane
1290: .Op Fl o
1291: .Op Fl t Ar target-pane
1.153 nicm 1292: .Op Ar shell-command
1.107 nicm 1293: .Xc
1294: .D1 (alias: Ic pipep )
1295: Pipe any output sent by the program in
1296: .Ar target-pane
1297: to a shell command.
1298: A pane may only be piped to one command at a time, any existing pipe is
1299: closed before
1.153 nicm 1300: .Ar shell-command
1.107 nicm 1301: is executed.
1.174 nicm 1302: The
1303: .Ar shell-command
1304: string may contain the special character sequences supported by the
1305: .Ic status-left
1.231 nicm 1306: option.
1.107 nicm 1307: If no
1.153 nicm 1308: .Ar shell-command
1.107 nicm 1309: is given, the current pipe (if any) is closed.
1310: .Pp
1311: The
1312: .Fl o
1313: option only opens a new pipe if no previous pipe exists, allowing a pipe to
1314: be toggled with a single key, for example:
1315: .Bd -literal -offset indent
1.174 nicm 1316: bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1.107 nicm 1317: .Ed
1.176 nicm 1318: .It Xo Ic previous-layout
1319: .Op Fl t Ar target-window
1320: .Xc
1321: .D1 (alias: Ic prevl )
1322: Move to the previous layout in the session.
1.1 nicm 1323: .It Xo Ic previous-window
1.9 nicm 1324: .Op Fl a
1.1 nicm 1325: .Op Fl t Ar target-session
1326: .Xc
1327: .D1 (alias: Ic prev )
1328: Move to the previous window in the session.
1.9 nicm 1329: With
1330: .Fl a ,
1331: move to the previous window with a bell, activity or content alert.
1.1 nicm 1332: .It Xo Ic rename-window
1333: .Op Fl t Ar target-window
1334: .Ar new-name
1335: .Xc
1336: .D1 (alias: Ic renamew )
1337: Rename the current window, or the window at
1338: .Ar target-window
1339: if specified, to
1340: .Ar new-name .
1341: .It Xo Ic resize-pane
1.39 jmc 1342: .Op Fl DLRU
1.52 nicm 1343: .Op Fl t Ar target-pane
1.1 nicm 1344: .Op Ar adjustment
1345: .Xc
1346: .D1 (alias: Ic resizep )
1.57 jmc 1347: Resize a pane, upward with
1348: .Fl U
1349: (the default), downward with
1350: .Fl D ,
1351: to the left with
1352: .Fl L
1353: and to the right with
1354: .Fl R .
1355: The
1356: .Ar adjustment
1357: is given in lines or cells (the default is 1).
1.234 nicm 1358: .It Xo Ic respawn-pane
1359: .Op Fl k
1360: .Op Fl t Ar target-pane
1361: .Op Ar shell-command
1362: .Xc
1363: .D1 (alias: Ic respawnp )
1364: Reactivate a pane in which the command has exited (see the
1365: .Ic remain-on-exit
1366: window option).
1367: If
1368: .Ar shell-command
1369: is not given, the command used when the pane was created is executed.
1370: The pane must be already inactive, unless
1371: .Fl k
1372: is given, in which case any existing command is killed.
1.57 jmc 1373: .It Xo Ic respawn-window
1374: .Op Fl k
1375: .Op Fl t Ar target-window
1.153 nicm 1376: .Op Ar shell-command
1.57 jmc 1377: .Xc
1378: .D1 (alias: Ic respawnw )
1.153 nicm 1379: Reactivate a window in which the command has exited (see the
1.57 jmc 1380: .Ic remain-on-exit
1381: window option).
1382: If
1.153 nicm 1383: .Ar shell-command
1.57 jmc 1384: is not given, the command used when the window was created is executed.
1385: The window must be already inactive, unless
1386: .Fl k
1387: is given, in which case any existing command is killed.
1388: .It Xo Ic rotate-window
1389: .Op Fl DU
1390: .Op Fl t Ar target-window
1391: .Xc
1392: .D1 (alias: Ic rotatew )
1393: Rotate the positions of the panes within a window, either upward (numerically
1394: lower) with
1395: .Fl U
1396: or downward (numerically higher).
1397: .It Xo Ic select-layout
1.204 nicm 1398: .Op Fl np
1.57 jmc 1399: .Op Fl t Ar target-window
1400: .Op Ar layout-name
1401: .Xc
1.176 nicm 1402: .D1 (alias: Ic selectl )
1.57 jmc 1403: Choose a specific layout for a window.
1404: If
1405: .Ar layout-name
1.181 nicm 1406: is not given, the last preset layout used (if any) is reapplied.
1.204 nicm 1407: .Fl n
1408: and
1409: .Fl p
1410: are equivalent to the
1411: .Ic next-layout
1412: and
1413: .Ic previous-layout
1414: commands.
1.156 nicm 1415: .It Xo Ic select-pane
1.204 nicm 1416: .Op Fl lDLRU
1.156 nicm 1417: .Op Fl t Ar target-pane
1418: .Xc
1.57 jmc 1419: .D1 (alias: Ic selectp )
1420: Make pane
1421: .Ar target-pane
1422: the active pane in window
1423: .Ar target-window .
1.156 nicm 1424: If one of
1425: .Fl D ,
1426: .Fl L ,
1427: .Fl R ,
1428: or
1429: .Fl U
1430: is used, respectively the pane below, to the left, to the right, or above the
1431: target pane is used.
1.204 nicm 1432: .Fl l
1433: is the same as using the
1434: .Ic last-pane
1435: command.
1436: .It Xo Ic select-window
1437: .Op Fl lnp
1438: .Op Fl t Ar target-window
1439: .Xc
1.57 jmc 1440: .D1 (alias: Ic selectw )
1441: Select the window at
1442: .Ar target-window .
1.204 nicm 1443: .Fl l ,
1444: .Fl n
1445: and
1446: .Fl p
1447: are equivalent to the
1448: .Ic last-window ,
1449: .Ic next-window
1450: and
1451: .Ic previous-window
1452: commands.
1.57 jmc 1453: .It Xo Ic split-window
1.201 nicm 1454: .Op Fl dhvP
1.57 jmc 1455: .Oo Fl l
1456: .Ar size |
1457: .Fl p Ar percentage Oc
1.136 nicm 1458: .Op Fl t Ar target-pane
1.153 nicm 1459: .Op Ar shell-command
1.57 jmc 1460: .Xc
1.176 nicm 1461: .D1 (alias: Ic splitw )
1.136 nicm 1462: Create a new pane by splitting
1463: .Ar target-pane :
1.57 jmc 1464: .Fl h
1465: does a horizontal split and
1466: .Fl v
1467: a vertical split; if neither is specified,
1468: .Fl v
1469: is assumed.
1470: The
1471: .Fl l
1472: and
1473: .Fl p
1.136 nicm 1474: options specify the size of the new pane in lines (for vertical split) or in
1.57 jmc 1475: cells (for horizontal split), or as a percentage, respectively.
1.136 nicm 1476: All other options have the same meaning as for the
1.57 jmc 1477: .Ic new-window
1478: command.
1479: .It Xo Ic swap-pane
1480: .Op Fl dDU
1481: .Op Fl s Ar src-pane
1482: .Op Fl t Ar dst-pane
1483: .Xc
1484: .D1 (alias: Ic swapp )
1485: Swap two panes.
1486: If
1487: .Fl U
1488: is used and no source pane is specified with
1489: .Fl s ,
1490: .Ar dst-pane
1491: is swapped with the previous pane (before it numerically);
1492: .Fl D
1493: swaps with the next pane (after it numerically).
1.138 nicm 1494: .Fl d
1495: instructs
1496: .Nm
1497: not to change the active pane.
1.57 jmc 1498: .It Xo Ic swap-window
1499: .Op Fl d
1500: .Op Fl s Ar src-window
1501: .Op Fl t Ar dst-window
1502: .Xc
1503: .D1 (alias: Ic swapw )
1504: This is similar to
1505: .Ic link-window ,
1506: except the source and destination windows are swapped.
1507: It is an error if no window exists at
1508: .Ar src-window .
1509: .It Xo Ic unlink-window
1.1 nicm 1510: .Op Fl k
1511: .Op Fl t Ar target-window
1512: .Xc
1.57 jmc 1513: .D1 (alias: Ic unlinkw )
1514: Unlink
1515: .Ar target-window .
1516: Unless
1517: .Fl k
1518: is given, a window may be unlinked only if it is linked to multiple sessions -
1519: windows may not be linked to no sessions;
1520: if
1.1 nicm 1521: .Fl k
1.57 jmc 1522: is specified and the window is linked to only one session, it is unlinked and
1523: destroyed.
1524: .El
1525: .Sh KEY BINDINGS
1.93 nicm 1526: .Nm
1527: allows a command to be bound to most keys, with or without a prefix key.
1528: When specifying keys, most represent themselves (for example
1529: .Ql A
1530: to
1.95 jmc 1531: .Ql Z ) .
1.93 nicm 1532: Ctrl keys may be prefixed with
1533: .Ql C-
1534: or
1.95 jmc 1535: .Ql ^ ,
1536: and Alt (meta) with
1.93 nicm 1537: .Ql M- .
1538: In addition, the following special key names are accepted:
1.126 nicm 1539: .Em Up ,
1540: .Em Down ,
1541: .Em Left ,
1542: .Em Right ,
1.93 nicm 1543: .Em BSpace ,
1544: .Em BTab ,
1545: .Em DC
1546: (Delete),
1547: .Em End ,
1548: .Em Enter ,
1549: .Em Escape ,
1550: .Em F1
1551: to
1552: .Em F20 ,
1553: .Em Home ,
1554: .Em IC
1555: (Insert),
1.254 nicm 1556: .Em NPage/PageDown/PgDn ,
1557: .Em PPage/PageUp/PgUp ,
1.93 nicm 1558: .Em Space ,
1559: and
1560: .Em Tab .
1561: Note that to bind the
1562: .Ql \&"
1563: or
1564: .Ql '
1565: keys, quotation marks are necessary, for example:
1566: .Bd -literal -offset indent
1567: bind-key '"' split-window
1.167 nicm 1568: bind-key "'" new-window
1.93 nicm 1569: .Ed
1570: .Pp
1.57 jmc 1571: Commands related to key bindings are as follows:
1572: .Bl -tag -width Ds
1573: .It Xo Ic bind-key
1574: .Op Fl cnr
1575: .Op Fl t Ar key-table
1576: .Ar key Ar command Op Ar arguments
1.1 nicm 1577: .Xc
1.57 jmc 1578: .D1 (alias: Ic bind )
1579: Bind key
1580: .Ar key
1581: to
1582: .Ar command .
1583: By default (without
1584: .Fl t )
1585: the primary key bindings are modified (those normally activated with the prefix
1586: key); in this case, if
1587: .Fl n
1588: is specified, it is not necessary to use the prefix key,
1589: .Ar command
1590: is bound to
1591: .Ar key
1592: alone.
1.1 nicm 1593: The
1.57 jmc 1594: .Fl r
1595: flag indicates this key may repeat, see the
1596: .Ic repeat-time
1597: option.
1598: .Pp
1599: If
1600: .Fl t
1601: is present,
1602: .Ar key
1603: is bound in
1604: .Ar key-table :
1605: the binding for command mode with
1606: .Fl c
1607: or for normal mode without.
1608: To view the default bindings and possible commands, see the
1609: .Ic list-keys
1610: command.
1611: .It Ic list-keys Op Fl t Ar key-table
1612: .D1 (alias: Ic lsk )
1613: List all key bindings.
1614: Without
1615: .Fl t
1616: the primary key bindings - those executed when preceded by the prefix key -
1617: are printed.
1618: Keys bound without the prefix key (see
1619: .Ic bind-key
1620: .Fl n )
1.119 nicm 1621: are marked with
1622: .Ql (no prefix) .
1.57 jmc 1623: .Pp
1624: With
1625: .Fl t ,
1626: the key bindings in
1627: .Ar key-table
1628: are listed; this may be one of:
1629: .Em vi-edit ,
1630: .Em emacs-edit ,
1631: .Em vi-choice ,
1632: .Em emacs-choice ,
1633: .Em vi-copy
1634: or
1635: .Em emacs-copy .
1636: .It Xo Ic send-keys
1.265 nicm 1637: .Fl R
1.72 nicm 1638: .Op Fl t Ar target-pane
1.57 jmc 1639: .Ar key Ar ...
1.1 nicm 1640: .Xc
1.57 jmc 1641: .D1 (alias: Ic send )
1642: Send a key or keys to a window.
1643: Each argument
1644: .Ar key
1645: is the name of the key (such as
1646: .Ql C-a
1647: or
1648: .Ql npage
1649: ) to send; if the string is not recognised as a key, it is sent as a series of
1650: characters.
1651: All arguments are sent sequentially from first to last.
1.265 nicm 1652: The
1653: .Fl R
1654: flag causes the terminal state to be reset.
1.267 ! nicm 1655: .It Xo Ic send-prefix
! 1656: .Op Fl 2
! 1657: .Op Fl t Ar target-pane
! 1658: .Xc
! 1659: Send the prefix key, or with
! 1660: .Fl 2
! 1661: the secondary prefix key, to a window as if it was pressed.
1.57 jmc 1662: .It Xo Ic unbind-key
1.189 nicm 1663: .Op Fl acn
1.57 jmc 1664: .Op Fl t Ar key-table
1665: .Ar key
1.2 nicm 1666: .Xc
1.57 jmc 1667: .D1 (alias: Ic unbind )
1668: Unbind the command bound to
1669: .Ar key .
1670: Without
1671: .Fl t
1672: the primary key bindings are modified; in this case, if
1673: .Fl n
1674: is specified, the command bound to
1675: .Ar key
1676: without a prefix (if any) is removed.
1.189 nicm 1677: If
1678: .Fl a
1679: is present, all key bindings are removed.
1.57 jmc 1680: .Pp
1.47 nicm 1681: If
1.57 jmc 1682: .Fl t
1683: is present,
1684: .Ar key
1685: in
1686: .Ar key-table
1687: is unbound: the binding for command mode with
1688: .Fl c
1689: or for normal mode without.
1690: .El
1691: .Sh OPTIONS
1692: The appearance and behaviour of
1693: .Nm
1694: may be modified by changing the value of various options.
1.133 nicm 1695: There are three types of option:
1696: .Em server options ,
1.57 jmc 1697: .Em session options
1698: and
1699: .Em window options .
1700: .Pp
1.133 nicm 1701: The
1702: .Nm
1703: server has a set of global options which do not apply to any particular
1704: window or session.
1705: These are altered with the
1706: .Ic set-option
1707: .Fl s
1708: command, or displayed with the
1709: .Ic show-options
1710: .Fl s
1711: command.
1712: .Pp
1713: In addition, each individual session may have a set of session options, and
1714: there is a separate set of global session options.
1.57 jmc 1715: Sessions which do not have a particular option configured inherit the value
1716: from the global session options.
1717: Session options are set or unset with the
1718: .Ic set-option
1719: command and may be listed with the
1720: .Ic show-options
1721: command.
1.133 nicm 1722: The available server and session options are listed under the
1.57 jmc 1723: .Ic set-option
1724: command.
1725: .Pp
1726: Similarly, a set of window options is attached to each window, and there is
1727: a set of global window options from which any unset options are inherited.
1728: Window options are altered with the
1729: .Ic set-window-option
1730: command and can be listed with the
1731: .Ic show-window-options
1732: command.
1733: All window options are documented with the
1734: .Ic set-window-option
1735: command.
1736: .Pp
1737: Commands which set options are as follows:
1738: .Bl -tag -width Ds
1.1 nicm 1739: .It Xo Ic set-option
1.133 nicm 1740: .Op Fl agsuw
1.129 nicm 1741: .Op Fl t Ar target-session | Ar target-window
1.1 nicm 1742: .Ar option Ar value
1743: .Xc
1744: .D1 (alias: Ic set )
1.133 nicm 1745: Set a window option with
1746: .Fl w
1747: (equivalent to the
1748: .Ic set-window-option
1749: command),
1750: a server option with
1751: .Fl s ,
1752: otherwise a session option.
1753: .Pp
1754: If
1755: .Fl g
1756: is specified, the global session or window option is set.
1.58 nicm 1757: With
1758: .Fl a ,
1759: and if the option expects a string,
1760: .Ar value
1761: is appended to the existing setting.
1.1 nicm 1762: The
1763: .Fl u
1764: flag unsets an option, so a session inherits the option from the global
1.133 nicm 1765: options.
1766: It is not possible to unset a global option.
1.1 nicm 1767: .Pp
1.133 nicm 1768: Available window options are listed under
1769: .Ic set-window-option .
1770: .Pp
1771: Available server options are:
1772: .Bl -tag -width Ds
1.198 nicm 1773: .It Ic buffer-limit Ar number
1774: Set the number of buffers; as new buffers are added to the top of the stack,
1775: old ones are removed from the bottom if necessary to maintain this maximum
1776: length.
1.239 nicm 1777: .It Ic escape-time Ar time
1778: Set the time in milliseconds for which
1779: .Nm
1780: waits after an escape is input to determine if it is part of a function or meta
1781: key sequences.
1782: The default is 500 milliseconds.
1783: .It Xo Ic exit-unattached
1784: .Op Ic on | off
1785: .Xc
1786: If enabled, the server will exit when there are no attached clients.
1787: .It Xo Ic quiet
1788: .Op Ic on | off
1789: .Xc
1790: Enable or disable the display of various informational messages (see also the
1791: .Fl q
1792: command line flag).
1.228 nicm 1793: .It Xo Ic set-clipboard
1794: .Op Ic on | off
1795: .Xc
1796: Attempt to set the terminal clipboard content using the
1797: \ee]52;...\e007
1798: .Xr xterm 1
1799: escape sequences.
1800: This option is on by default if there is an
1801: .Em \&Ms
1802: entry in the
1803: .Xr terminfo 5
1804: description for the client terminal.
1805: Note that this feature needs to be enabled in
1806: .Xr xterm 1
1807: by setting the resource:
1808: .Bd -literal -offset indent
1809: disallowedWindowOps: 20,21,SetXprop
1810: .Ed
1811: .Pp
1812: Or changing this property from the
1813: .Xr xterm 1
1814: interactive menu when required.
1.133 nicm 1815: .El
1.129 nicm 1816: .Pp
1.18 nicm 1817: Available session options are:
1.1 nicm 1818: .Bl -tag -width Ds
1.69 nicm 1819: .It Ic base-index Ar index
1820: Set the base index from which an unused index should be searched when a new
1821: window is created.
1822: The default is zero.
1.1 nicm 1823: .It Xo Ic bell-action
1.56 jmc 1824: .Op Ic any | none | current
1.1 nicm 1825: .Xc
1826: Set action on window bell.
1827: .Ic any
1828: means a bell in any window linked to a session causes a bell in the current
1829: window of that session,
1830: .Ic none
1831: means all bells are ignored and
1832: .Ic current
1833: means only bell in windows other than the current window are ignored.
1.237 nicm 1834: .It Xo Ic bell-on-alert
1835: .Op Ic on | off
1836: .Xc
1837: If on, ring the terminal bell when an activity, content or silence alert
1838: occurs.
1.153 nicm 1839: .It Ic default-command Ar shell-command
1.1 nicm 1840: Set the command used for new windows (if not specified when the window is
1841: created) to
1.153 nicm 1842: .Ar shell-command ,
1.79 nicm 1843: which may be any
1844: .Xr sh 1
1845: command.
1.19 nicm 1846: The default is an empty string, which instructs
1847: .Nm
1.79 nicm 1848: to create a login shell using the value of the
1849: .Ic default-shell
1850: option.
1.196 nicm 1851: .It Ic default-path Ar path
1.257 nicm 1852: Set the default working directory for new panes.
1853: If empty (the default), the working directory is determined from the process
1854: running in the active pane, from the command line environment or from the
1855: working directory where the session was created.
1.259 stsp 1856: If
1857: .Ar path
1858: is "$HOME" or "~", the value of the
1859: .Ev HOME
1860: environment variable is used.
1.260 sthen 1861: If
1862: .Ar path
1863: is ".", the working directory when
1864: .Nm
1865: was started is used.
1.79 nicm 1866: .It Ic default-shell Ar path
1867: Specify the default shell.
1868: This is used as the login shell for new windows when the
1869: .Ic default-command
1870: option is set to empty, and must be the full path of the executable.
1871: When started
1872: .Nm
1873: tries to set a default value from the first suitable of the
1.19 nicm 1874: .Ev SHELL
1.79 nicm 1875: environment variable, the shell returned by
1876: .Xr getpwuid 3 ,
1877: or
1878: .Pa /bin/sh .
1879: This option should be configured when
1880: .Nm
1881: is used as a login shell.
1.22 nicm 1882: .It Ic default-terminal Ar terminal
1883: Set the default terminal for new windows created in this session - the
1884: default value of the
1885: .Ev TERM
1886: environment variable.
1887: For
1888: .Nm
1889: to work correctly, this
1890: .Em must
1891: be set to
1892: .Ql screen
1893: or a derivative of it.
1.206 nicm 1894: .It Xo Ic destroy-unattached
1895: .Op Ic on | off
1896: .Xc
1.185 nicm 1897: If enabled and the session is no longer attached to any clients, it is
1898: destroyed.
1.206 nicm 1899: .It Xo Ic detach-on-destroy
1900: .Op Ic on | off
1901: .Xc
1.184 nicm 1902: If on (the default), the client is detached when the session it is attached to
1903: is destroyed.
1904: If off, the client is switched to the most recently active of the remaining
1905: sessions.
1.145 nicm 1906: .It Ic display-panes-active-colour Ar colour
1907: Set the colour used by the
1908: .Ic display-panes
1909: command to show the indicator for the active pane.
1.78 nicm 1910: .It Ic display-panes-colour Ar colour
1.145 nicm 1911: Set the colour used by the
1.78 nicm 1912: .Ic display-panes
1.145 nicm 1913: command to show the indicators for inactive panes.
1.78 nicm 1914: .It Ic display-panes-time Ar time
1915: Set the time in milliseconds for which the indicators shown by the
1916: .Ic display-panes
1917: command appear.
1.21 nicm 1918: .It Ic display-time Ar time
1.78 nicm 1919: Set the amount of time for which status line messages and other on-screen
1920: indicators are displayed.
1.21 nicm 1921: .Ar time
1922: is in milliseconds.
1.1 nicm 1923: .It Ic history-limit Ar lines
1924: Set the maximum number of lines held in window history.
1925: This setting applies only to new windows - existing window histories are not
1926: resized and retain the limit at the point they were created.
1927: .It Ic lock-after-time Ar number
1.100 nicm 1928: Lock the session (like the
1929: .Ic lock-session
1.90 nicm 1930: command) after
1.1 nicm 1931: .Ar number
1.100 nicm 1932: seconds of inactivity, or the entire server (all sessions) if the
1933: .Ic lock-server
1934: option is set.
1935: The default is not to lock (set to 0).
1.153 nicm 1936: .It Ic lock-command Ar shell-command
1.90 nicm 1937: Command to run when locking each client.
1938: The default is to run
1939: .Xr lock 1
1940: with
1941: .Fl np .
1.100 nicm 1942: .It Xo Ic lock-server
1943: .Op Ic on | off
1944: .Xc
1945: If this option is
1.102 nicm 1946: .Ic on
1.100 nicm 1947: (the default),
1948: instead of each session locking individually as each has been
1949: idle for
1.108 jmc 1950: .Ic lock-after-time ,
1951: the entire server will lock after
1.100 nicm 1952: .Em all
1953: sessions would have locked.
1954: This has no effect as a session option; it must be set as a global option.
1.1 nicm 1955: .It Ic message-attr Ar attributes
1956: Set status line message attributes, where
1957: .Ar attributes
1958: is either
1.168 nicm 1959: .Ic none
1.1 nicm 1960: or a comma-delimited list of one or more of:
1961: .Ic bright
1962: (or
1963: .Ic bold ) ,
1964: .Ic dim ,
1965: .Ic underscore ,
1966: .Ic blink ,
1967: .Ic reverse ,
1968: .Ic hidden ,
1969: or
1970: .Ic italics .
1971: .It Ic message-bg Ar colour
1972: Set status line message background colour, where
1973: .Ar colour
1974: is one of:
1975: .Ic black ,
1976: .Ic red ,
1977: .Ic green ,
1978: .Ic yellow ,
1979: .Ic blue ,
1980: .Ic magenta ,
1981: .Ic cyan ,
1.85 nicm 1982: .Ic white ,
1.266 nicm 1983: aixterm bright variants (if supported:
1984: .Ic brightred ,
1985: .Ic brightgreen ,
1986: and so on),
1.85 nicm 1987: .Ic colour0
1988: to
1989: .Ic colour255
1.205 nicm 1990: from the 256-colour set,
1991: .Ic default ,
1992: or a hexadecimal RGB string such as
1993: .Ql #ffffff ,
1994: which chooses the closest match from the default 256-colour set.
1.253 nicm 1995: .It Ic message-command-attr Ar attributes
1996: Set status line message attributes when in command mode.
1997: .It Ic message-command-bg Ar colour
1998: Set status line message background colour when in command mode.
1999: .It Ic message-command-fg Ar colour
2000: Set status line message foreground colour when in command mode.
1.1 nicm 2001: .It Ic message-fg Ar colour
2002: Set status line message foreground colour.
1.120 nicm 2003: .It Ic message-limit Ar number
2004: Set the number of error or information messages to save in the message log for
2005: each client.
2006: The default is 20.
1.226 nicm 2007: .It Xo Ic mouse-resize-pane
2008: .Op Ic on | off
2009: .Xc
2010: If on,
2011: .Nm
2012: captures the mouse and allows panes to be resized by dragging on their borders.
1.102 nicm 2013: .It Xo Ic mouse-select-pane
2014: .Op Ic on | off
2015: .Xc
2016: If on,
2017: .Nm
2018: captures the mouse and when a window is split into multiple panes the mouse may
2019: be used to select the current pane.
2020: The mouse click is also passed through to the application as normal.
1.222 nicm 2021: .It Xo Ic mouse-select-window
2022: .Op Ic on | off
2023: .Xc
2024: If on, clicking the mouse on a window name in the status line will select that
2025: window.
1.239 nicm 2026: .It Xo Ic mouse-utf8
2027: .Op Ic on | off
2028: .Xc
2029: If enabled, request mouse input as UTF-8 on UTF-8 terminals.
1.196 nicm 2030: .It Ic pane-active-border-bg Ar colour
2031: .It Ic pane-active-border-fg Ar colour
2032: Set the pane border colour for the currently active pane.
2033: .It Ic pane-border-bg Ar colour
1.135 nicm 2034: .It Ic pane-border-fg Ar colour
2035: Set the pane border colour for panes aside from the active pane.
1.267 ! nicm 2036: .It Ic prefix Ar key
! 2037: Set the key accepted as a prefix key.
! 2038: .It Ic prefix2 Ar key
! 2039: Set a secondary key accepted as a prefix key.
1.21 nicm 2040: .It Ic repeat-time Ar time
1.1 nicm 2041: Allow multiple commands to be entered without pressing the prefix-key again
2042: in the specified
1.21 nicm 2043: .Ar time
1.1 nicm 2044: milliseconds (the default is 500).
2045: Whether a key repeats may be set when it is bound using the
2046: .Fl r
2047: flag to
2048: .Ic bind-key .
1.52 nicm 2049: Repeat is enabled for the default keys bound to the
2050: .Ic resize-pane
2051: command.
1.1 nicm 2052: .It Xo Ic set-remain-on-exit
1.56 jmc 2053: .Op Ic on | off
1.1 nicm 2054: .Xc
2055: Set the
2056: .Ic remain-on-exit
2057: window option for any windows first created in this session.
1.153 nicm 2058: When this option is true, windows in which the running program has
2059: exited do not close, instead remaining open but inactivate.
2060: Use the
2061: .Ic respawn-window
2062: command to reactivate such a window, or the
2063: .Ic kill-window
2064: command to destroy it.
1.1 nicm 2065: .It Xo Ic set-titles
1.56 jmc 2066: .Op Ic on | off
1.1 nicm 2067: .Xc
1.261 nicm 2068: Attempt to set the client terminal title using the
2069: .Em tsl
2070: and
2071: .Em fsl
2072: .Xr terminfo 5
2073: entries if they exist.
2074: .Nm
2075: automatically sets these to the \ee]2;...\e007 sequence if
1.1 nicm 2076: the terminal appears to be an xterm.
1.11 nicm 2077: This option is off by default.
1.6 jmc 2078: Note that elinks
1.1 nicm 2079: will only attempt to set the window title if the STY environment
2080: variable is set.
1.86 nicm 2081: .It Ic set-titles-string Ar string
2082: String used to set the window title if
2083: .Ic set-titles
2084: is on.
2085: Character sequences are replaced as for the
2086: .Ic status-left
2087: option.
1.1 nicm 2088: .It Xo Ic status
1.56 jmc 2089: .Op Ic on | off
1.1 nicm 2090: .Xc
2091: Show or hide the status line.
2092: .It Ic status-attr Ar attributes
2093: Set status line attributes.
2094: .It Ic status-bg Ar colour
2095: Set status line background colour.
2096: .It Ic status-fg Ar colour
2097: Set status line foreground colour.
2098: .It Ic status-interval Ar interval
2099: Update the status bar every
2100: .Ar interval
2101: seconds.
2102: By default, updates will occur every 15 seconds.
2103: A setting of zero disables redrawing at interval.
1.41 nicm 2104: .It Xo Ic status-justify
1.56 jmc 2105: .Op Ic left | centre | right
1.41 nicm 2106: .Xc
2107: Set the position of the window list component of the status line: left, centre
2108: or right justified.
1.1 nicm 2109: .It Xo Ic status-keys
1.56 jmc 2110: .Op Ic vi | emacs
1.1 nicm 2111: .Xc
1.6 jmc 2112: Use vi or emacs-style
1.1 nicm 2113: key bindings in the status line, for example at the command prompt.
1.191 nicm 2114: The default is emacs, unless the
2115: .Ev VISUAL
2116: or
2117: .Ev EDITOR
2118: environment variables are set and contain the string
2119: .Ql vi .
1.1 nicm 2120: .It Ic status-left Ar string
2121: Display
2122: .Ar string
2123: to the left of the status bar.
2124: .Ar string
2125: will be passed through
2126: .Xr strftime 3
2127: before being used.
2128: By default, the session name is shown.
2129: .Ar string
1.83 nicm 2130: may contain any of the following special character sequences:
1.1 nicm 2131: .Bl -column "Character pair" "Replaced with" -offset indent
2132: .It Sy "Character pair" Ta Sy "Replaced with"
1.153 nicm 2133: .It Li "#(shell-command)" Ta "First line of the command's output"
1.83 nicm 2134: .It Li "#[attributes]" Ta "Colour or attribute change"
1.1 nicm 2135: .It Li "#H" Ta "Hostname of local host"
1.224 nicm 2136: .It Li "#h" Ta "Hostname of local host without the domain name"
1.125 nicm 2137: .It Li "#F" Ta "Current window flag"
1.35 nicm 2138: .It Li "#I" Ta "Current window index"
2139: .It Li "#P" Ta "Current pane index"
1.1 nicm 2140: .It Li "#S" Ta "Session name"
1.261 nicm 2141: .It Li "#T" Ta "Current pane title"
1.35 nicm 2142: .It Li "#W" Ta "Current window name"
1.1 nicm 2143: .It Li "##" Ta "A literal" Ql #
2144: .El
1.83 nicm 2145: .Pp
1.153 nicm 2146: The #(shell-command) form executes
2147: .Ql shell-command
2148: and inserts the first line of its output.
1.103 nicm 2149: Note that shell commands are only executed once at the interval specified by
2150: the
2151: .Ic status-interval
2152: option: if the status line is redrawn in the meantime, the previous result is
2153: used.
1.161 nicm 2154: Shell commands are executed with the
2155: .Nm
2156: global environment set (see the
1.162 jmc 2157: .Sx ENVIRONMENT
2158: section).
1.163 nicm 2159: .Pp
1.263 nicm 2160: For details on how the names and titles can be set see the
1.261 nicm 2161: .Sx "NAMES AND TITLES"
2162: section.
1.109 nicm 2163: .Pp
1.83 nicm 2164: #[attributes] allows a comma-separated list of attributes to be specified,
2165: these may be
2166: .Ql fg=colour
2167: to set the foreground colour,
2168: .Ql bg=colour
1.131 nicm 2169: to set the background colour, the name of one of the attributes (listed under
2170: the
1.83 nicm 2171: .Ic message-attr
1.109 nicm 2172: option) to turn an attribute on, or an attribute prefixed with
2173: .Ql no
2174: to turn one off, for example
2175: .Ic nobright .
1.83 nicm 2176: Examples are:
2177: .Bd -literal -offset indent
2178: #(sysctl vm.loadavg)
2179: #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
2180: .Ed
1.1 nicm 2181: .Pp
1.109 nicm 2182: Where appropriate, special character sequences may be prefixed with a number to
2183: specify the maximum length, for example
1.1 nicm 2184: .Ql #24T .
1.10 nicm 2185: .Pp
1.12 jmc 2186: By default, UTF-8 in
1.10 nicm 2187: .Ar string
2188: is not interpreted, to enable UTF-8, use the
2189: .Ic status-utf8
2190: option.
1.62 nicm 2191: .It Ic status-left-attr Ar attributes
1.66 jmc 2192: Set the attribute of the left part of the status line.
1.196 nicm 2193: .It Ic status-left-bg Ar colour
2194: Set the background colour of the left part of the status line.
1.62 nicm 2195: .It Ic status-left-fg Ar colour
2196: Set the foreground colour of the left part of the status line.
1.1 nicm 2197: .It Ic status-left-length Ar length
2198: Set the maximum
2199: .Ar length
2200: of the left component of the status bar.
2201: The default is 10.
2202: .It Ic status-right Ar string
2203: Display
2204: .Ar string
2205: to the right of the status bar.
1.151 nicm 2206: By default, the current window title in double quotes, the date and the time
2207: are shown.
1.1 nicm 2208: As with
2209: .Ic status-left ,
2210: .Ar string
2211: will be passed to
1.10 nicm 2212: .Xr strftime 3 ,
2213: character pairs are replaced, and UTF-8 is dependent on the
2214: .Ic status-utf8
2215: option.
1.62 nicm 2216: .It Ic status-right-attr Ar attributes
1.66 jmc 2217: Set the attribute of the right part of the status line.
1.196 nicm 2218: .It Ic status-right-bg Ar colour
2219: Set the background colour of the right part of the status line.
1.62 nicm 2220: .It Ic status-right-fg Ar colour
2221: Set the foreground colour of the right part of the status line.
1.1 nicm 2222: .It Ic status-right-length Ar length
2223: Set the maximum
2224: .Ar length
2225: of the right component of the status bar.
2226: The default is 40.
1.10 nicm 2227: .It Xo Ic status-utf8
1.56 jmc 2228: .Op Ic on | off
1.10 nicm 2229: .Xc
2230: Instruct
2231: .Nm
2232: to treat top-bit-set characters in the
2233: .Ic status-left
2234: and
2235: .Ic status-right
2236: strings as UTF-8; notably, this is important for wide characters.
2237: This option defaults to off.
1.55 jmc 2238: .It Ic terminal-overrides Ar string
1.54 nicm 2239: Contains a list of entries which override terminal descriptions read using
2240: .Xr terminfo 5 .
2241: .Ar string
2242: is a comma-separated list of items each a colon-separated string made up of a
2243: terminal type pattern (matched using
2244: .Xr fnmatch 3 )
2245: and a set of
2246: .Em name=value
2247: entries.
2248: .Pp
2249: For example, to set the
2250: .Ql clear
2251: .Xr terminfo 5
2252: entry to
2253: .Ql \ee[H\ee[2J
2254: for all terminal types and the
2255: .Ql dch1
2256: entry to
2257: .Ql \ee[P
1.55 jmc 2258: for the
1.54 nicm 2259: .Ql rxvt
2260: terminal type, the option could be set to the string:
2261: .Bd -literal -offset indent
2262: "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
2263: .Ed
2264: .Pp
2265: The terminal entry value is passed through
2266: .Xr strunvis 3
2267: before interpretation.
2268: The default value forcibly corrects the
2269: .Ql colors
2270: entry for terminals which support 88 or 256 colours:
2271: .Bd -literal -offset indent
1.225 nicm 2272: "*88col*:colors=88,*256col*:colors=256,xterm*:XT"
1.54 nicm 2273: .Ed
1.63 nicm 2274: .It Ic update-environment Ar variables
2275: Set a space-separated string containing a list of environment variables to be
2276: copied into the session environment when a new session is created or an
2277: existing session is attached.
2278: Any variables that do not exist in the source environment are set to be
2279: removed from the session environment (as if
2280: .Fl r
2281: was given to the
2282: .Ic set-environment
2283: command).
2284: The default is
1.190 nicm 2285: "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID
2286: XAUTHORITY".
1.37 nicm 2287: .It Xo Ic visual-activity
1.56 jmc 2288: .Op Ic on | off
1.37 nicm 2289: .Xc
2290: If on, display a status line message when activity occurs in a window
1.39 jmc 2291: for which the
1.37 nicm 2292: .Ic monitor-activity
2293: window option is enabled.
2294: .It Xo Ic visual-bell
1.56 jmc 2295: .Op Ic on | off
1.37 nicm 2296: .Xc
2297: If this option is on, a message is shown on a bell instead of it being passed
2298: through to the terminal (which normally makes a sound).
2299: Also see the
2300: .Ic bell-action
2301: option.
2302: .It Xo Ic visual-content
1.56 jmc 2303: .Op Ic on | off
1.37 nicm 2304: .Xc
2305: Like
2306: .Ic visual-activity ,
2307: display a message when content is present in a window
1.39 jmc 2308: for which the
1.37 nicm 2309: .Ic monitor-content
2310: window option is enabled.
1.192 nicm 2311: .It Xo Ic visual-silence
2312: .Op Ic on | off
2313: .Xc
2314: If
2315: .Ic monitor-silence
2316: is enabled, prints a message after the interval has expired on a given window.
1.255 nicm 2317: .It Ic word-separators Ar string
2318: Sets the session's conception of what characters are considered word
2319: separators, for the purposes of the next and previous word commands in
2320: copy mode.
2321: The default is
2322: .Ql \ -_@ .
1.1 nicm 2323: .El
2324: .It Xo Ic set-window-option
1.58 nicm 2325: .Op Fl agu
1.1 nicm 2326: .Op Fl t Ar target-window
2327: .Ar option Ar value
2328: .Xc
2329: .D1 (alias: Ic setw )
1.18 nicm 2330: Set a window option.
1.1 nicm 2331: The
1.58 nicm 2332: .Fl a ,
1.1 nicm 2333: .Fl g
2334: and
2335: .Fl u
2336: flags work similarly to the
2337: .Ic set-option
2338: command.
2339: .Pp
1.18 nicm 2340: Supported window options are:
1.56 jmc 2341: .Pp
2342: .Bl -tag -width Ds -compact
1.1 nicm 2343: .It Xo Ic aggressive-resize
1.56 jmc 2344: .Op Ic on | off
1.1 nicm 2345: .Xc
2346: Aggressively resize the chosen window.
2347: This means that
2348: .Nm
2349: will resize the window to the size of the smallest session for which it is the
2350: current window, rather than the smallest session to which it is attached.
2351: The window may resize when the current window is changed on another sessions;
1.6 jmc 2352: this option is good for full-screen programs which support
2353: .Dv SIGWINCH
2354: and poor for interactive programs such as shells.
1.262 nicm 2355: .Pp
2356: .It Xo Ic allow-rename
2357: .Op Ic on | off
2358: .Xc
2359: Allow programs to change the window name using a terminal escape
2360: sequence (\\033k...\\033\\\\).
2361: The default is on.
1.56 jmc 2362: .Pp
1.196 nicm 2363: .It Xo Ic alternate-screen
2364: .Op Ic on | off
2365: .Xc
2366: This option configures whether programs running inside
2367: .Nm
2368: may use the terminal alternate screen feature, which allows the
2369: .Em smcup
2370: and
2371: .Em rmcup
2372: .Xr terminfo 5
1.209 nicm 2373: capabilities.
2374: The alternate screen feature preserves the contents of the window when an
2375: interactive application starts and restores it on exit, so that any output
2376: visible before the application starts reappears unchanged after it exits.
2377: The default is on.
1.196 nicm 2378: .Pp
1.1 nicm 2379: .It Xo Ic automatic-rename
1.56 jmc 2380: .Op Ic on | off
1.1 nicm 2381: .Xc
2382: Control automatic window renaming.
2383: When this setting is enabled,
2384: .Nm
2385: will attempt - on supported platforms - to rename the window to reflect the
2386: command currently running in it.
2387: This flag is automatically disabled for an individual window when a name
2388: is specified at creation with
1.186 nicm 2389: .Ic new-window
2390: or
1.1 nicm 2391: .Ic new-session ,
2392: or later with
1.261 nicm 2393: .Ic rename-window ,
2394: or with a terminal escape sequence.
1.1 nicm 2395: It may be switched off globally with:
2396: .Bd -literal -offset indent
2397: set-window-option -g automatic-rename off
2398: .Ed
1.56 jmc 2399: .Pp
1.1 nicm 2400: .It Ic clock-mode-colour Ar colour
2401: Set clock colour.
1.56 jmc 2402: .Pp
1.1 nicm 2403: .It Xo Ic clock-mode-style
1.56 jmc 2404: .Op Ic 12 | 24
1.1 nicm 2405: .Xc
2406: Set clock hour format.
1.56 jmc 2407: .Pp
1.1 nicm 2408: .It Ic force-height Ar height
2409: .It Ic force-width Ar width
2410: Prevent
2411: .Nm
2412: from resizing a window to greater than
2413: .Ar width
2414: or
2415: .Ar height .
2416: A value of zero restores the default unlimited setting.
1.56 jmc 2417: .Pp
1.196 nicm 2418: .It Ic main-pane-height Ar height
1.2 nicm 2419: .It Ic main-pane-width Ar width
2420: Set the width or height of the main (left or top) pane in the
2421: .Ic main-horizontal
2422: or
2423: .Ic main-vertical
2424: layouts.
1.56 jmc 2425: .Pp
1.1 nicm 2426: .It Ic mode-attr Ar attributes
2427: Set window modes attributes.
1.56 jmc 2428: .Pp
1.1 nicm 2429: .It Ic mode-bg Ar colour
2430: Set window modes background colour.
1.56 jmc 2431: .Pp
1.1 nicm 2432: .It Ic mode-fg Ar colour
2433: Set window modes foreground colour.
1.56 jmc 2434: .Pp
1.1 nicm 2435: .It Xo Ic mode-keys
1.56 jmc 2436: .Op Ic vi | emacs
1.1 nicm 2437: .Xc
1.105 nicm 2438: Use vi or emacs-style key bindings in copy and choice modes.
1.191 nicm 2439: As with the
2440: .Ic status-keys
2441: option, the default is emacs, unless
2442: .Ev VISUAL
2443: or
2444: .Ev EDITOR
2445: contains
2446: .Ql vi .
1.56 jmc 2447: .Pp
1.50 nicm 2448: .It Xo Ic mode-mouse
1.240 nicm 2449: .Op Ic on | off | copy-mode
1.50 nicm 2450: .Xc
1.51 jmc 2451: Mouse state in modes.
1.223 nicm 2452: If on, the mouse may be used to enter copy mode and copy a selection by
2453: dragging, to enter copy mode and scroll with the mouse wheel, or to select an
2454: option in choice mode.
1.240 nicm 2455: If set to
1.241 jmc 2456: .Em copy-mode ,
1.240 nicm 2457: the mouse behaves as set to on, but cannot be used to enter copy
2458: mode.
1.56 jmc 2459: .Pp
1.1 nicm 2460: .It Xo Ic monitor-activity
1.56 jmc 2461: .Op Ic on | off
1.1 nicm 2462: .Xc
2463: Monitor for activity in the window.
2464: Windows with activity are highlighted in the status line.
1.56 jmc 2465: .Pp
2466: .It Ic monitor-content Ar match-string
1.6 jmc 2467: Monitor content in the window.
2468: When
1.16 nicm 2469: .Xr fnmatch 3
2470: pattern
1.1 nicm 2471: .Ar match-string
2472: appears in the window, it is highlighted in the status line.
1.56 jmc 2473: .Pp
1.192 nicm 2474: .It Xo Ic monitor-silence
2475: .Op Ic interval
2476: .Xc
2477: Monitor for silence (no activity) in the window within
2478: .Ic interval
2479: seconds.
2480: Windows that have been silent for the interval are highlighted in the
2481: status line.
2482: An interval of zero disables the monitoring.
1.195 nicm 2483: .Pp
2484: .It Ic other-pane-height Ar height
2485: Set the height of the other panes (not the main pane) in the
2486: .Ic main-horizontal
2487: layout.
2488: If this option is set to 0 (the default), it will have no effect.
2489: If both the
2490: .Ic main-pane-height
2491: and
2492: .Ic other-pane-height
2493: options are set, the main pane will grow taller to make the other panes the
2494: specified height, but will never shrink to do so.
2495: .Pp
2496: .It Ic other-pane-width Ar width
2497: Like
2498: .Ic other-pane-height ,
2499: but set the width of other panes in the
2500: .Ic main-vertical
2501: layout.
1.243 nicm 2502: .Pp
2503: .It Ic pane-base-index Ar index
2504: Like
2505: .Ic base-index ,
2506: but set the starting index for pane numbers.
1.192 nicm 2507: .Pp
1.1 nicm 2508: .It Xo Ic remain-on-exit
1.56 jmc 2509: .Op Ic on | off
1.1 nicm 2510: .Xc
2511: A window with this flag set is not destroyed when the program running in it
2512: exits.
2513: The window may be reactivated with the
2514: .Ic respawn-window
2515: command.
1.56 jmc 2516: .Pp
1.99 nicm 2517: .It Xo Ic synchronize-panes
2518: .Op Ic on | off
2519: .Xc
1.164 nicm 2520: Duplicate input to any pane to all other panes in the same window (only
2521: for panes that are not in any special mode).
1.139 nicm 2522: .Pp
1.1 nicm 2523: .It Xo Ic utf8
1.56 jmc 2524: .Op Ic on | off
1.1 nicm 2525: .Xc
2526: Instructs
2527: .Nm
2528: to expect UTF-8 sequences to appear in this window.
1.56 jmc 2529: .Pp
1.264 nicm 2530: .It Ic window-status-bell-attr Ar attributes
2531: Set status line attributes for windows which have a bell alert.
1.169 nicm 2532: .Pp
1.264 nicm 2533: .It Ic window-status-bell-bg Ar colour
2534: Set status line background colour for windows with a bell alert.
1.169 nicm 2535: .Pp
1.264 nicm 2536: .It Ic window-status-bell-fg Ar colour
2537: Set status line foreground colour for windows with a bell alert.
2538: .Pp
2539: .It Ic window-status-content-attr Ar attributes
2540: Set status line attributes for windows which have a content alert.
2541: .Pp
2542: .It Ic window-status-content-bg Ar colour
2543: Set status line background colour for windows with a content alert.
2544: .Pp
2545: .It Ic window-status-content-fg Ar colour
2546: Set status line foreground colour for windows with a content alert.
2547: .Pp
2548: .It Ic window-status-activity-attr Ar attributes
2549: Set status line attributes for windows which have an activity (or silence) alert.
2550: .Pp
2551: .It Ic window-status-activity-bg Ar colour
2552: Set status line background colour for windows with an activity alert.
2553: .Pp
2554: .It Ic window-status-activity-fg Ar colour
2555: Set status line foreground colour for windows with an activity alert.
1.125 nicm 2556: .Pp
1.239 nicm 2557: .It Ic window-status-attr Ar attributes
2558: Set status line attributes for a single window.
2559: .Pp
2560: .It Ic window-status-bg Ar colour
2561: Set status line background colour for a single window.
2562: .Pp
1.40 nicm 2563: .It Ic window-status-current-attr Ar attributes
2564: Set status line attributes for the currently active window.
1.56 jmc 2565: .Pp
1.40 nicm 2566: .It Ic window-status-current-bg Ar colour
2567: Set status line background colour for the currently active window.
1.56 jmc 2568: .Pp
1.40 nicm 2569: .It Ic window-status-current-fg Ar colour
2570: Set status line foreground colour for the currently active window.
1.56 jmc 2571: .Pp
1.125 nicm 2572: .It Ic window-status-current-format Ar string
2573: Like
2574: .Ar window-status-format ,
2575: but is the format used when the window is the current window.
1.239 nicm 2576: .Pp
2577: .It Ic window-status-fg Ar colour
2578: Set status line foreground colour for a single window.
2579: .Pp
2580: .It Ic window-status-format Ar string
2581: Set the format in which the window is displayed in the status line window list.
2582: See the
2583: .Ar status-left
2584: option for details of special character sequences available.
2585: The default is
2586: .Ql #I:#W#F .
1.125 nicm 2587: .Pp
1.1 nicm 2588: .It Xo Ic xterm-keys
1.56 jmc 2589: .Op Ic on | off
1.1 nicm 2590: .Xc
2591: If this option is set,
2592: .Nm
2593: will generate
1.57 jmc 2594: .Xr xterm 1 -style
2595: function key sequences; these have a number included to indicate modifiers such
2596: as Shift, Alt or Ctrl.
1.123 nicm 2597: The default is off.
1.57 jmc 2598: .El
2599: .It Xo Ic show-options
1.133 nicm 2600: .Op Fl gsw
1.129 nicm 2601: .Op Fl t Ar target-session | Ar target-window
1.57 jmc 2602: .Xc
2603: .D1 (alias: Ic show )
1.133 nicm 2604: Show the window options with
1.129 nicm 2605: .Fl w
1.133 nicm 2606: (equivalent to
1.134 nicm 2607: .Ic show-window-options ) ,
1.133 nicm 2608: the server options with
2609: .Fl s ,
2610: otherwise the session options for
2611: .Ar target session .
2612: Global session or window options are listed if
2613: .Fl g
2614: is used.
1.57 jmc 2615: .It Xo Ic show-window-options
2616: .Op Fl g
2617: .Op Fl t Ar target-window
2618: .Xc
2619: .D1 (alias: Ic showw )
2620: List the window options for
2621: .Ar target-window ,
2622: or the global window options if
2623: .Fl g
2624: is used.
1.63 nicm 2625: .El
1.245 nicm 2626: .Sh FORMATS
2627: The
1.250 nicm 2628: .Ic list-clients ,
1.245 nicm 2629: .Ic list-sessions ,
2630: .Ic list-windows
2631: and
2632: .Ic list-panes
2633: commands accept the
2634: .Fl F
2635: flag with a
2636: .Ar format
2637: argument.
2638: This is a string which controls the output format of the command.
2639: Special character sequences are replaced as documented under the
2640: .Ic status-left
2641: option and an additional long form is accepted.
2642: Replacement variables are enclosed in
2643: .Ql #{
2644: and
2645: .Ql } ,
2646: for example
2647: .Ql #{session_name}
2648: is equivalent to
2649: .Ql #S .
2650: Conditionals are also accepted by prefixing with
1.246 jmc 2651: .Ql \&?
1.245 nicm 2652: and separating two alternatives with a comma;
2653: if the specified variable exists and is not zero, the first alternative
1.246 jmc 2654: is chosen, otherwise the second is used.
2655: For example
1.245 nicm 2656: .Ql #{?session_attached,attached,not attached}
2657: will include the string
2658: .Ql attached
2659: if the session is attached and the string
2660: .Ql not attached
2661: if it is unattached.
2662: .Pp
2663: The following variables are available, where appropriate:
2664: .Bl -column "session_created_string" "Replaced with" -offset indent
2665: .It Sy "Variable name" Ta Sy "Replaced with"
1.250 nicm 2666: .It Li "client_activity" Ta "Integer time client last had activity"
2667: .It Li "client_activity_string" Ta "String time client last had activity"
2668: .It Li "client_created" Ta "Integer time client created"
2669: .It Li "client_created_string" Ta "String time client created"
2670: .It Li "client_cwd" Ta "Working directory of client"
2671: .It Li "client_height" Ta "Height of client"
2672: .It Li "client_readonly" Ta "1 if client is readonly"
2673: .It Li "client_termname" Ta "Terminal name of client"
2674: .It Li "client_tty" Ta "Pseudo terminal of client"
2675: .It Li "client_utf8" Ta "1 if client supports utf8"
2676: .It Li "client_width" Ta "Width of client"
1.245 nicm 2677: .It Li "host" Ta "Hostname of local host"
2678: .It Li "line" Ta "Line number in the list"
2679: .It Li "pane_active" Ta "1 if active pane"
2680: .It Li "pane_dead" Ta "1 if pane is dead"
2681: .It Li "pane_height" Ta "Height of pane"
2682: .It Li "pane_id" Ta "Unique pane id"
1.249 nicm 2683: .It Li "pane_pid" Ta "PID of first process in pane"
2684: .It Li "pane_start_command" Ta "Command pane started with"
2685: .It Li "pane_start_path" Ta "Path pane started with"
1.245 nicm 2686: .It Li "pane_title" Ta "Title of pane"
1.249 nicm 2687: .It Li "pane_tty" Ta "Pseudo terminal of pane"
1.245 nicm 2688: .It Li "pane_width" Ta "Width of pane"
2689: .It Li "session_attached" Ta "1 if session attached"
2690: .It Li "session_created" Ta "Integer time session created"
2691: .It Li "session_created_string" Ta "String time session created"
2692: .It Li "session_group" Ta "Number of session group"
2693: .It Li "session_grouped" Ta "1 if session in a group"
2694: .It Li "session_height" Ta "Height of session"
2695: .It Li "session_name" Ta "Name of session"
2696: .It Li "session_width" Ta "Width of session"
2697: .It Li "session_windows" Ta "Number of windows in session"
2698: .It Li "window_active" Ta "1 if window active"
2699: .It Li "window_flags" Ta "Window flags"
2700: .It Li "window_height" Ta "Height of window"
2701: .It Li "window_index" Ta "Index of window"
2702: .It Li "window_layout" Ta "Window layout description"
2703: .It Li "window_name" Ta "Name of window"
2704: .It Li "window_width" Ta "Width of window"
2705: .El
1.261 nicm 2706: .Sh NAMES AND TITLES
2707: .Nm
2708: distinguishes between names and titles.
2709: Windows and sessions have names, which may be used to specify them in targets
2710: and are displayed in the status line and various lists: the name is the
2711: .Nm
2712: identifier for a window or session.
2713: Only panes have titles.
2714: A pane's title is typically set by the program running inside the pane and
2715: is not modified by
2716: .Nm .
2717: It is the same mechanism used to set for example the
2718: .Xr xterm 1
2719: window title in an
2720: .Xr X 7
2721: window manager.
2722: Windows themselves do not have titles - a window's title is the title of it's
2723: active pane.
2724: .Nm
2725: itself may set the title of the terminal in which the client is running, see
2726: the
2727: .Ic set-titles
2728: option.
2729: .Pp
2730: A session's name is set with the
2731: .Ic new-session
2732: and
2733: .Ic rename-session
2734: commands.
2735: A window's name is set with one of:
2736: .Bl -enum -width Ds
2737: .It
2738: A command argument (such as
2739: .Fl n
2740: for
2741: .Ic new-window
2742: or
2743: .Ic new-session ) .
2744: .It
2745: An escape sequence:
2746: .Bd -literal -offset indent
2747: $ printf '\e033kWINDOW_NAME\e033\e\e'
2748: .Ed
2749: .It
2750: Automatic renaming, which sets the name to the active command in the window's
2751: active pane.
2752: See the
2753: .Ic automatic-rename
2754: option.
2755: .El
2756: .Pp
2757: When a pane is first created, its title is the hostname.
2758: A pane's title can be set via the OSC title setting sequence, for example:
2759: .Bd -literal -offset indent
2760: $ printf '\e033]2;My Title\e033\e\e'
2761: .Ed
1.63 nicm 2762: .Sh ENVIRONMENT
2763: When the server is started,
2764: .Nm
2765: copies the environment into the
2766: .Em global environment ;
2767: in addition, each session has a
2768: .Em session environment .
1.193 nicm 2769: When a window is created, the session and global environments are merged.
2770: If a variable exists in both, the value from the session environment is used.
2771: The result is the initial environment passed to the new process.
1.63 nicm 2772: .Pp
2773: The
2774: .Ic update-environment
2775: session option may be used to update the session environment from the client
2776: when a new session is created or an old reattached.
2777: .Nm
2778: also initialises the
2779: .Ev TMUX
2780: variable with some internal information to allow commands to be executed
2781: from inside, and the
2782: .Ev TERM
2783: variable with the correct terminal setting of
2784: .Ql screen .
2785: .Pp
2786: Commands to alter and view the environment are:
2787: .Bl -tag -width Ds
2788: .It Xo Ic set-environment
2789: .Op Fl gru
2790: .Op Fl t Ar target-session
2791: .Ar name Op Ar value
2792: .Xc
1.115 nicm 2793: .D1 (alias: Ic setenv )
1.63 nicm 2794: Set or unset an environment variable.
2795: If
2796: .Fl g
2797: is used, the change is made in the global environment; otherwise, it is applied
2798: to the session environment for
2799: .Ar target-session .
2800: The
2801: .Fl u
2802: flag unsets a variable.
2803: .Fl r
2804: indicates the variable is to be removed from the environment before starting a
2805: new process.
2806: .It Xo Ic show-environment
2807: .Op Fl g
2808: .Op Fl t Ar target-session
2809: .Xc
1.115 nicm 2810: .D1 (alias: Ic showenv )
1.63 nicm 2811: Display the environment for
2812: .Ar target-session
2813: or the global environment with
2814: .Fl g .
2815: Variables removed from the environment are prefixed with
2816: .Ql - .
1.57 jmc 2817: .El
2818: .Sh STATUS LINE
2819: .Nm
2820: includes an optional status line which is displayed in the bottom line of each
2821: terminal.
2822: By default, the status line is enabled (it may be disabled with the
2823: .Ic status
2824: session option) and contains, from left-to-right: the name of the current
1.261 nicm 2825: session in square brackets; the window list; the title of the active pane
2826: in double quotes; and the time and date.
1.57 jmc 2827: .Pp
2828: The status line is made of three parts: configurable left and right sections
2829: (which may contain dynamic content such as the time or output from a shell
2830: command, see the
2831: .Ic status-left ,
2832: .Ic status-left-length ,
2833: .Ic status-right ,
2834: and
2835: .Ic status-right-length
2836: options below), and a central window list.
1.125 nicm 2837: By default, the window list shows the index, name and (if any) flag of the
2838: windows present in the current session in ascending numerical order.
2839: It may be customised with the
2840: .Ar window-status-format
2841: and
2842: .Ar window-status-current-format
2843: options.
1.57 jmc 2844: The flag is one of the following symbols appended to the window name:
2845: .Bl -column "Symbol" "Meaning" -offset indent
2846: .It Sy "Symbol" Ta Sy "Meaning"
2847: .It Li "*" Ta "Denotes the current window."
2848: .It Li "-" Ta "Marks the last window (previously selected)."
2849: .It Li "#" Ta "Window is monitored and activity has been detected."
2850: .It Li "!" Ta "A bell has occurred in the window."
2851: .It Li "+" Ta "Window is monitored for content and it has appeared."
1.192 nicm 2852: .It Li "~" Ta "The window has been silent for the monitor-silence interval."
1.57 jmc 2853: .El
2854: .Pp
2855: The # symbol relates to the
2856: .Ic monitor-activity
2857: and + to the
2858: .Ic monitor-content
2859: window options.
2860: The window name is printed in inverted colours if an alert (bell, activity or
2861: content) is present.
2862: .Pp
1.131 nicm 2863: The colour and attributes of the status line may be configured, the entire
2864: status line using the
1.57 jmc 2865: .Ic status-attr ,
2866: .Ic status-fg
2867: and
2868: .Ic status-bg
2869: session options and individual windows using the
2870: .Ic window-status-attr ,
2871: .Ic window-status-fg
2872: and
2873: .Ic window-status-bg
2874: window options.
2875: .Pp
1.131 nicm 2876: The status line is automatically refreshed at interval if it has changed, the
2877: interval may be controlled with the
1.57 jmc 2878: .Ic status-interval
2879: session option.
2880: .Pp
2881: Commands related to the status line are as follows:
2882: .Bl -tag -width Ds
2883: .It Xo Ic command-prompt
1.235 nicm 2884: .Op Fl I Ar inputs
1.73 nicm 2885: .Op Fl p Ar prompts
1.57 jmc 2886: .Op Fl t Ar target-client
2887: .Op Ar template
2888: .Xc
2889: Open the command prompt in a client.
2890: This may be used from inside
2891: .Nm
2892: to execute commands interactively.
1.231 nicm 2893: .Pp
1.57 jmc 2894: If
2895: .Ar template
1.73 nicm 2896: is specified, it is used as the command.
1.235 nicm 2897: If present,
2898: .Fl I
2899: is a comma-separated list of the initial text for each prompt.
1.73 nicm 2900: If
2901: .Fl p
2902: is given,
2903: .Ar prompts
2904: is a comma-separated list of prompts which are displayed in order; otherwise
2905: a single prompt is displayed, constructed from
2906: .Ar template
2907: if it is present, or
2908: .Ql \&:
2909: if not.
1.235 nicm 2910: .Pp
2911: Both
2912: .Ar inputs
2913: and
1.231 nicm 2914: .Ar prompts
2915: may contain the special character sequences supported by the
2916: .Ic status-left
2917: option.
2918: .Pp
1.73 nicm 2919: Before the command is executed, the first occurrence of the string
2920: .Ql %%
1.74 jmc 2921: and all occurrences of
1.73 nicm 2922: .Ql %1
2923: are replaced by the response to the first prompt, the second
2924: .Ql %%
2925: and all
2926: .Ql %2
2927: are replaced with the response to the second prompt, and so on for further
1.74 jmc 2928: prompts.
2929: Up to nine prompt responses may be replaced
2930: .Po
2931: .Ql %1
1.73 nicm 2932: to
1.74 jmc 2933: .Ql %9
2934: .Pc .
1.57 jmc 2935: .It Xo Ic confirm-before
1.238 nicm 2936: .Op Fl p Ar prompt
1.57 jmc 2937: .Op Fl t Ar target-client
2938: .Ar command
2939: .Xc
2940: .D1 (alias: Ic confirm )
2941: Ask for confirmation before executing
2942: .Ar command .
1.238 nicm 2943: If
2944: .Fl p
2945: is given,
2946: .Ar prompt
2947: is the prompt to display; otherwise a prompt is constructed from
2948: .Ar command .
2949: It may contain the special character sequences supported by the
2950: .Ic status-left
2951: option.
2952: .Pp
1.57 jmc 2953: This command works only from inside
2954: .Nm .
2955: .It Xo Ic display-message
1.127 nicm 2956: .Op Fl p
1.215 nicm 2957: .Op Fl c Ar target-client
2958: .Op Fl t Ar target-pane
1.57 jmc 2959: .Op Ar message
2960: .Xc
2961: .D1 (alias: Ic display )
1.127 nicm 2962: Display a message.
2963: If
2964: .Fl p
2965: is given, the output is printed to stdout, otherwise it is displayed in the
2966: .Ar target-client
2967: status line.
1.122 nicm 2968: The format of
1.124 jmc 2969: .Ar message
2970: is as for
1.122 nicm 2971: .Ic status-left ,
1.215 nicm 2972: with the exception that #() are not handled; information is taken from
2973: .Ar target-pane
2974: if
2975: .Fl t
2976: is given, otherwise the active pane for the session attached to
2977: .Ar target-client .
1.57 jmc 2978: .El
2979: .Sh BUFFERS
2980: .Nm
2981: maintains a stack of
1.199 nicm 2982: .Em paste buffers .
1.57 jmc 2983: Up to the value of the
2984: .Ic buffer-limit
2985: option are kept; when a new buffer is added, the buffer at the bottom of the
2986: stack is removed.
2987: Buffers may be added using
2988: .Ic copy-mode
2989: or the
2990: .Ic set-buffer
2991: command, and pasted into a window using the
2992: .Ic paste-buffer
2993: command.
2994: .Pp
2995: A configurable history buffer is also maintained for each window.
2996: By default, up to 2000 lines are kept; this can be altered with the
2997: .Ic history-limit
2998: option (see the
2999: .Ic set-option
3000: command above).
3001: .Pp
3002: The buffer commands are as follows:
3003: .Bl -tag -width Ds
1.178 nicm 3004: .It Xo
3005: .Ic choose-buffer
3006: .Op Fl t Ar target-window
3007: .Op Ar template
3008: .Xc
3009: Put a window into buffer choice mode, where a buffer may be chosen
3010: interactively from a list.
3011: After a buffer is selected,
3012: .Ql %%
3013: is replaced by the buffer index in
3014: .Ar template
3015: and the result executed as a command.
3016: If
3017: .Ar template
3018: is not given, "paste-buffer -b '%%'" is used.
3019: This command works only from inside
3020: .Nm .
1.57 jmc 3021: .It Ic clear-history Op Fl t Ar target-pane
3022: .D1 (alias: Ic clearhist )
3023: Remove and free the history for the specified pane.
1.198 nicm 3024: .It Ic delete-buffer Op Fl b Ar buffer-index
1.57 jmc 3025: .D1 (alias: Ic deleteb )
3026: Delete the buffer at
3027: .Ar buffer-index ,
3028: or the top buffer if not specified.
1.198 nicm 3029: .It Ic list-buffers
1.57 jmc 3030: .D1 (alias: Ic lsb )
1.198 nicm 3031: List the global buffers.
1.200 jmc 3032: .It Xo Ic load-buffer
1.57 jmc 3033: .Op Fl b Ar buffer-index
3034: .Ar path
3035: .Xc
3036: .D1 (alias: Ic loadb )
3037: Load the contents of the specified paste buffer from
3038: .Ar path .
3039: .It Xo Ic paste-buffer
3040: .Op Fl dr
3041: .Op Fl b Ar buffer-index
1.170 nicm 3042: .Op Fl s Ar separator
1.158 nicm 3043: .Op Fl t Ar target-pane
1.57 jmc 3044: .Xc
3045: .D1 (alias: Ic pasteb )
1.158 nicm 3046: Insert the contents of a paste buffer into the specified pane.
3047: If not specified, paste into the current one.
1.57 jmc 3048: With
3049: .Fl d ,
3050: also delete the paste buffer from the stack.
3051: When output, any linefeed (LF) characters in the paste buffer are replaced with
1.170 nicm 3052: a separator, by default carriage return (CR).
3053: A custom separator may be specified using the
3054: .Fl s
3055: flag.
3056: The
1.57 jmc 3057: .Fl r
1.170 nicm 3058: flag means to do no replacement (equivalent to a separator of LF).
1.57 jmc 3059: .It Xo Ic save-buffer
3060: .Op Fl a
3061: .Op Fl b Ar buffer-index
3062: .Ar path
3063: .Xc
3064: .D1 (alias: Ic saveb )
3065: Save the contents of the specified paste buffer to
3066: .Ar path .
3067: The
3068: .Fl a
3069: option appends to rather than overwriting the file.
3070: .It Xo Ic set-buffer
3071: .Op Fl b Ar buffer-index
3072: .Ar data
3073: .Xc
3074: .D1 (alias: Ic setb )
3075: Set the contents of the specified buffer to
3076: .Ar data .
1.1 nicm 3077: .It Xo Ic show-buffer
3078: .Op Fl b Ar buffer-index
3079: .Xc
3080: .D1 (alias: Ic showb )
3081: Display the contents of the specified buffer.
1.57 jmc 3082: .El
3083: .Sh MISCELLANEOUS
3084: Miscellaneous commands are as follows:
3085: .Bl -tag -width Ds
1.72 nicm 3086: .It Ic clock-mode Op Fl t Ar target-pane
1.57 jmc 3087: Display a large clock.
1.251 nicm 3088: .It Ic if-shell Ar shell-command command Op Ar command
1.57 jmc 3089: .D1 (alias: Ic if )
1.251 nicm 3090: Execute the first
1.57 jmc 3091: .Ar command
3092: if
3093: .Ar shell-command
1.251 nicm 3094: returns success or the second
3095: .Ar command
3096: otherwise.
1.57 jmc 3097: .It Ic lock-server
3098: .D1 (alias: Ic lock )
1.90 nicm 3099: Lock each client individually by running the command specified by the
3100: .Ic lock-command
3101: option.
1.153 nicm 3102: .It Ic run-shell Ar shell-command
1.87 nicm 3103: .D1 (alias: Ic run )
3104: Execute
1.153 nicm 3105: .Ar shell-command
1.106 nicm 3106: in the background without creating a window.
1.164 nicm 3107: After it finishes, any output to stdout is displayed in copy mode.
1.153 nicm 3108: If the command doesn't return success, the exit status is also displayed.
1.57 jmc 3109: .It Ic server-info
3110: .D1 (alias: Ic info )
3111: Show server information and terminal details.
1.228 nicm 3112: .El
3113: .Sh TERMINFO EXTENSIONS
3114: .Nm
3115: understands some extensions to
3116: .Xr terminfo 5 :
3117: .Bl -tag -width Ds
1.232 jmc 3118: .It Em Cc , Cr
1.233 nicm 3119: Set the cursor colour.
1.232 jmc 3120: The first takes a single string argument and is used to set the colour;
3121: the second takes no arguments and restores the default cursor colour.
3122: If set, a sequence such as this may be used
3123: to change the cursor colour from inside
3124: .Nm :
3125: .Bd -literal -offset indent
3126: $ printf '\e033]12;red\e033\e\e'
3127: .Ed
3128: .It Em Cs , Csr
1.230 nicm 3129: Change the cursor style.
1.232 jmc 3130: If set, a sequence such as this may be used
3131: to change the cursor to an underline:
1.230 nicm 3132: .Bd -literal -offset indent
3133: $ printf '\e033[4 q'
3134: .Ed
3135: .Pp
3136: If
3137: .Em Csr
3138: is set, it will be used to reset the cursor style instead
3139: of
3140: .Em Cs .
1.232 jmc 3141: .It Em \&Ms
3142: This sequence can be used by
3143: .Nm
3144: to store the current buffer in the host terminal's selection (clipboard).
3145: See the
3146: .Em set-clipboard
3147: option above and the
3148: .Xr xterm 1
3149: man page.
1.1 nicm 3150: .El
3151: .Sh FILES
1.26 nicm 3152: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1 nicm 3153: .It Pa ~/.tmux.conf
1.6 jmc 3154: Default
1.1 nicm 3155: .Nm
1.6 jmc 3156: configuration file.
1.26 nicm 3157: .It Pa /etc/tmux.conf
3158: System-wide configuration file.
1.1 nicm 3159: .El
1.57 jmc 3160: .Sh EXAMPLES
3161: To create a new
3162: .Nm
3163: session running
3164: .Xr vi 1 :
3165: .Pp
3166: .Dl $ tmux new-session vi
3167: .Pp
3168: Most commands have a shorter form, known as an alias.
3169: For new-session, this is
3170: .Ic new :
3171: .Pp
3172: .Dl $ tmux new vi
3173: .Pp
3174: Alternatively, the shortest unambiguous form of a command is accepted.
3175: If there are several options, they are listed:
3176: .Bd -literal -offset indent
3177: $ tmux n
3178: ambiguous command: n, could be: new-session, new-window, next-window
3179: .Ed
3180: .Pp
3181: Within an active session, a new window may be created by typing
3182: .Ql C-b c
3183: (Ctrl
3184: followed by the
3185: .Ql b
3186: key
3187: followed by the
3188: .Ql c
3189: key).
3190: .Pp
3191: Windows may be navigated with:
3192: .Ql C-b 0
3193: (to select window 0),
3194: .Ql C-b 1
3195: (to select window 1), and so on;
3196: .Ql C-b n
3197: to select the next window; and
3198: .Ql C-b p
3199: to select the previous window.
3200: .Pp
3201: A session may be detached using
3202: .Ql C-b d
1.64 nicm 3203: (or by an external event such as
3204: .Xr ssh 1
3205: disconnection) and reattached with:
1.57 jmc 3206: .Pp
3207: .Dl $ tmux attach-session
3208: .Pp
3209: Typing
3210: .Ql C-b \&?
3211: lists the current key bindings in the current window; up and down may be used
3212: to navigate the list or
3213: .Ql q
3214: to exit from it.
3215: .Pp
3216: Commands to be run when the
3217: .Nm
3218: server is started may be placed in the
3219: .Pa ~/.tmux.conf
3220: configuration file.
3221: Common examples include:
3222: .Pp
3223: Changing the default prefix key:
3224: .Bd -literal -offset indent
3225: set-option -g prefix C-a
3226: unbind-key C-b
3227: bind-key C-a send-prefix
3228: .Ed
3229: .Pp
3230: Turning the status line off, or changing its colour:
3231: .Bd -literal -offset indent
3232: set-option -g status off
3233: set-option -g status-bg blue
3234: .Ed
3235: .Pp
3236: Setting other options, such as the default command,
3237: or locking after 30 minutes of inactivity:
3238: .Bd -literal -offset indent
3239: set-option -g default-command "exec /bin/ksh"
3240: set-option -g lock-after-time 1800
3241: .Ed
3242: .Pp
3243: Creating new key bindings:
3244: .Bd -literal -offset indent
3245: bind-key b set-option status
3246: bind-key / command-prompt "split-window 'exec man %%'"
1.73 nicm 3247: bind-key S command-prompt "new-window -n %1 'ssh %1'"
1.57 jmc 3248: .Ed
1.1 nicm 3249: .Sh SEE ALSO
3250: .Xr pty 4
3251: .Sh AUTHORS
3252: .An Nicholas Marriott Aq nicm@users.sourceforge.net