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