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