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