1TMUX(1) BSD General Commands Manual TMUX(1)
2
4 tmux — terminal multiplexer
5
7 tmux [-28lquvV] [-c shell-command] [-f file] [-L socket-name]
8 [-S socket-path] [command [flags]]
9
11 tmux is a terminal multiplexer: it enables a number of terminals to be
12 created, accessed, and controlled from a single screen. tmux may be
13 detached from a screen and continue running in the background, then later
14 reattached.
15
16 When tmux is started it creates a new session with a single window and
17 displays it on screen. A status line at the bottom of the screen shows
18 information on the current session and is used to enter interactive com‐
19 mands.
20
21 A session is a single collection of pseudo terminals under the management
22 of tmux. Each session has one or more windows linked to it. A window
23 occupies the entire screen and may be split into rectangular panes, each
24 of which is a separate pseudo terminal (the pty(4) manual page documents
25 the technical details of pseudo terminals). Any number of tmux instances
26 may connect to the same session, and any number of windows may be present
27 in the same session. Once all sessions are killed, tmux exits.
28
29 Each session is persistent and will survive accidental disconnection
30 (such as ssh(1) connection timeout) or intentional detaching (with the
31 ‘C-b d’ key strokes). tmux may be reattached using:
32
33 $ tmux attach
34
35 In tmux, a session is displayed on screen by a client and all sessions
36 are managed by a single server. The server and each client are separate
37 processes which communicate through a socket in a directory under
38 /var/run/tmux.
39
40 The options are as follows:
41
42 -2 Force tmux to assume the terminal supports 256 colours.
43
44 -8 Like -2, but indicates that the terminal supports 88
45 colours.
46
47 -c shell-command
48 Execute shell-command using the default shell. If neces‐
49 sary, the tmux server will be started to retrieve the
50 default-shell option. This option is for compatibility
51 with sh(1) when tmux is used as a login shell.
52
53 -f file Specify an alternative configuration file. By default,
54 tmux loads the system configuration file from
55 /etc/tmux.conf, if present, then looks for a user configu‐
56 ration file at ~/.tmux.conf. The configuration file is a
57 set of tmux commands which are executed in sequence when
58 the server is first started.
59
60 If a command in the configuration file fails, tmux will
61 report an error and exit without executing further com‐
62 mands.
63
64 -L socket-name
65 tmux stores the server socket in a directory under
66 /var/run/tmux; the default socket is named default. This
67 option allows a different socket name to be specified,
68 allowing several independent tmux servers to be run.
69 Unlike -S a full path is not necessary: the sockets are all
70 created in the same directory.
71
72 If the socket is accidentally removed, the SIGUSR1 signal
73 may be sent to the tmux server process to recreate it.
74
75 -l Behave as a login shell. This flag currently has no effect
76 and is for compatibility with other shells when using tmux
77 as a login shell.
78
79 -q Set the quiet server option to prevent the server sending
80 various informational messages.
81
82 -S socket-path
83 Specify a full alternative path to the server socket. If
84 -S is specified, the default socket directory is not used
85 and any -L flag is ignored.
86
87 -u tmux attempts to guess if the terminal is likely to support
88 UTF-8 by checking the first of the LC_ALL, LC_CTYPE and
89 LANG environment variables to be set for the string
90 "UTF-8". This is not always correct: the -u flag explic‐
91 itly informs tmux that UTF-8 is supported.
92
93 If the server is started from a client passed -u or where
94 UTF-8 is detected, the utf8 and status-utf8 options are
95 enabled in the global window and session options respec‐
96 tively.
97
98 -v Request verbose logging. This option may be specified mul‐
99 tiple times for increasing verbosity. Log messages will be
100 saved into tmux-client-PID.log and tmux-server-PID.log
101 files in the current directory, where PID is the PID of the
102 server or client process.
103
104 -V Report the tmux version.
105
106 command [flags]
107 This specifies one of a set of commands used to control
108 tmux, as described in the following sections. If no com‐
109 mands are specified, the new-session command is assumed.
110
112 tmux may be controlled from an attached client by using a key combination
113 of a prefix key, ‘C-b’ (Ctrl-b) by default, followed by a command key.
114
115 The default command key bindings are:
116
117 C-b Send the prefix key (C-b) through to the application.
118 C-o Rotate the panes in the current window forwards.
119 C-z Suspend the tmux client.
120 ! Break the current pane out of the window.
121 " Split the current pane into two, top and bottom.
122 # List all paste buffers.
123 % Split the current pane into two, left and right.
124 & Kill the current window.
125 ' Prompt for a window index to select.
126 , Rename the current window.
127 - Delete the most recently copied buffer of text.
128 . Prompt for an index to move the current window.
129 0 to 9 Select windows 0 to 9.
130 : Enter the tmux command prompt.
131 ; Move to the previously active pane.
132 = Choose which buffer to paste interactively from a list.
133 ? List all key bindings.
134 D Choose a client to detach.
135 [ Enter copy mode to copy text or view the history.
136 ] Paste the most recently copied buffer of text.
137 c Create a new window.
138 d Detach the current client.
139 f Prompt to search for text in open windows.
140 i Display some information about the current window.
141 l Move to the previously selected window.
142 n Change to the next window.
143 o Select the next pane in the current window.
144 p Change to the previous window.
145 q Briefly display pane indexes.
146 r Force redraw of the attached client.
147 s Select a new session for the attached client interac‐
148 tively.
149 L Switch the attached client back to the last session.
150 t Show the time.
151 w Choose the current window interactively.
152 x Kill the current pane.
153 { Swap the current pane with the previous pane.
154 } Swap the current pane with the next pane.
155 ~ Show previous messages from tmux, if any.
156 Page Up Enter copy mode and scroll one page up.
157 Up, Down
158 Left, Right
159 Change to the pane above, below, to the left, or to the
160 right of the current pane.
161 M-1 to M-5 Arrange panes in one of the five preset layouts: even-
162 horizontal, even-vertical, main-horizontal, main-verti‐
163 cal, or tiled.
164 M-n Move to the next window with a bell or activity marker.
165 M-o Rotate the panes in the current window backwards.
166 M-p Move to the previous window with a bell or activity
167 marker.
168 C-Up, C-Down
169 C-Left, C-Right
170 Resize the current pane in steps of one cell.
171 M-Up, M-Down
172 M-Left, M-Right
173 Resize the current pane in steps of five cells.
174
175 Key bindings may be changed with the bind-key and unbind-key commands.
176
178 This section contains a list of the commands supported by tmux. Most
179 commands accept the optional -t argument with one of target-client,
180 target-session target-window, or target-pane. These specify the client,
181 session, window or pane which a command should affect. target-client is
182 the name of the pty(4) file to which the client is connected, for example
183 either of /dev/ttyp1 or ttyp1 for the client attached to /dev/ttyp1. If
184 no client is specified, the current client is chosen, if possible, or an
185 error is reported. Clients may be listed with the list-clients command.
186
187 target-session is either the name of a session (as listed by the
188 list-sessions command) or the name of a client with the same syntax as
189 target-client, in which case the session attached to the client is used.
190 When looking for the session name, tmux initially searches for an exact
191 match; if none is found, the session names are checked for any for which
192 target-session is a prefix or for which it matches as an fnmatch(3) pat‐
193 tern. If a single match is found, it is used as the target session; mul‐
194 tiple matches produce an error. If a session is omitted, the current
195 session is used if available; if no current session is available, the
196 most recently used is chosen.
197
198 target-window specifies a window in the form session:window. session
199 follows the same rules as for target-session, and window is looked for in
200 order: as a window index, for example mysession:1; as an exact window
201 name, such as mysession:mywindow; then as an fnmatch(3) pattern or the
202 start of a window name, such as mysession:mywin* or mysession:mywin. An
203 empty window name specifies the next unused index if appropriate (for
204 example the new-window and link-window commands) otherwise the current
205 window in session is chosen. The special character ‘!’ uses the last
206 (previously current) window, or ‘+’ and ‘-’ are the next window or the
207 previous window by number. When the argument does not contain a colon,
208 tmux first attempts to parse it as window; if that fails, an attempt is
209 made to match a session.
210
211 target-pane takes a similar form to target-window but with the optional
212 addition of a period followed by a pane index, for example: myses‐
213 sion:mywindow.1. If the pane index is omitted, the currently active pane
214 in the specified window is used. If neither a colon nor period appears,
215 tmux first attempts to use the argument as a pane index; if that fails,
216 it is looked up as for target-window. A ‘+’ or ‘-’ indicate the next or
217 previous pane index, respectively. One of the strings top, bottom, left,
218 right, top-left, top-right, bottom-left or bottom-right may be used
219 instead of a pane index.
220
221 The special characters ‘+’ and ‘-’ may be followed by an offset, for
222 example:
223
224 select-window -t:+2
225
226 When dealing with a session that doesn't contain sequential window
227 indexes, they will be correctly skipped.
228
229 shell-command arguments are sh(1) commands. These must be passed as a
230 single item, which typically means quoting them, for example:
231
232 new-window 'vi /etc/passwd'
233
234 command [arguments] refers to a tmux command, passed with the command and
235 arguments separately, for example:
236
237 bind-key F1 set-window-option force-width 81
238
239 Or if using sh(1):
240
241 $ tmux bind-key F1 set-window-option force-width 81
242
243 Multiple commands may be specified together as part of a command
244 sequence. Each command should be separated by spaces and a semicolon;
245 commands are executed sequentially from left to right. A literal semi‐
246 colon may be included by escaping it with a backslash (for example, when
247 specifying a command sequence to bind-key).
248
249 Example tmux commands include:
250
251 refresh-client -t/dev/ttyp2
252
253 rename-session -tfirst newname
254
255 set-window-option -t:0 monitor-activity on
256
257 new-window ; split-window -d
258
259 Or from sh(1):
260
261 $ tmux kill-window -t :1
262
263 $ tmux new-window \; split-window -d
264
265 $ tmux new-session -d 'vi /etc/passwd' \; split-window -d \; attach
266
268 The tmux server manages clients, sessions, windows and panes. Clients
269 are attached to sessions to interact with them, either when they are cre‐
270 ated with the new-session command, or later with the attach-session com‐
271 mand. Each session has one or more windows linked into it. Windows may
272 be linked to multiple sessions and are made up of one or more panes, each
273 of which contains a pseudo terminal. Commands for creating, linking and
274 otherwise manipulating windows are covered in the WINDOWS AND PANES sec‐
275 tion.
276
277 The following commands are available to manage clients and sessions:
278
279 attach-session [-dr] [-t target-session]
280 (alias: attach)
281 If run from outside tmux, create a new client in the current ter‐
282 minal and attach it to target-session. If used from inside,
283 switch the current client. If -d is specified, any other clients
284 attached to the session are detached. -r signifies the client is
285 read-only (only keys bound to the detach-client command have any
286 effect)
287
288 If no server is started, attach-session will attempt to start it;
289 this will fail unless sessions are created in the configuration
290 file.
291
292 detach-client [-t target-client]
293 (alias: detach)
294 Detach the current client if bound to a key, or the specified
295 client with -t.
296
297 has-session [-t target-session]
298 (alias: has)
299 Report an error and exit with 1 if the specified session does not
300 exist. If it does exist, exit with 0.
301
302 kill-server
303 Kill the tmux server and clients and destroy all sessions.
304
305 kill-session [-t target-session]
306 Destroy the given session, closing any windows linked to it and
307 no other sessions, and detaching all clients attached to it.
308
309 list-clients
310 (alias: lsc)
311 List all clients attached to the server.
312
313 list-commands
314 (alias: lscm)
315 List the syntax of all commands supported by tmux.
316
317 list-sessions
318 (alias: ls)
319 List all sessions managed by the server.
320
321 lock-client [-t target-client]
322 (alias: lockc)
323 Lock target-client, see the lock-server command.
324
325 lock-session [-t target-session]
326 (alias: locks)
327 Lock all clients attached to target-session.
328
329 new-session [-d] [-n window-name] [-s session-name] [-t target-session]
330 [shell-command]
331 (alias: new)
332 Create a new session with name session-name.
333
334 The new session is attached to the current terminal unless -d is
335 given. window-name and shell-command are the name of and shell
336 command to execute in the initial window.
337
338 If run from a terminal, any termios(4) special characters are
339 saved and used for new windows in the new session.
340
341 If -t is given, the new session is grouped with target-session.
342 This means they share the same set of windows - all windows from
343 target-session are linked to the new session and any subsequent
344 new windows or windows being closed are applied to both sessions.
345 The current and previous window and any session options remain
346 independent and either session may be killed without affecting
347 the other. Giving -n or shell-command are invalid if -t is used.
348
349 refresh-client [-t target-client]
350 (alias: refresh)
351 Refresh the current client if bound to a key, or a single client
352 if one is given with -t.
353
354 rename-session [-t target-session] new-name
355 (alias: rename)
356 Rename the session to new-name.
357
358 show-messages [-t target-client]
359 (alias: showmsgs)
360 Any messages displayed on the status line are saved in a per-
361 client message log, up to a maximum of the limit set by the
362 message-limit session option for the session attached to that
363 client. This command displays the log for target-client.
364
365 source-file path
366 (alias: source)
367 Execute commands from path.
368
369 start-server
370 (alias: start)
371 Start the tmux server, if not already running, without creating
372 any sessions.
373
374 suspend-client [-c target-client]
375 (alias: suspendc)
376 Suspend a client by sending SIGTSTP (tty stop).
377
378 switch-client [-lnp] [-c target-client] [-t target-session]
379 (alias: switchc)
380 Switch the current session for client target-client to
381 target-session. If -l, -n or -p is used, the client is moved to
382 the last, next or previous session respectively.
383
385 A tmux window may be in one of several modes. The default permits direct
386 access to the terminal attached to the window. The other is copy mode,
387 which permits a section of a window or its history to be copied to a
388 paste buffer for later insertion into another window. This mode is
389 entered with the copy-mode command, bound to ‘[’ by default. It is also
390 entered when a command that produces output, such as list-keys, is exe‐
391 cuted from a key binding.
392
393 The keys available depend on whether emacs or vi mode is selected (see
394 the mode-keys option). The following keys are supported as appropriate
395 for the mode:
396
397 Function vi emacs
398 Back to indentation ^ M-m
399 Bottom of history G M-<
400 Clear selection Escape C-g
401 Copy selection Enter M-w
402 Cursor down j Down
403 Cursor left h Left
404 Cursor right l Right
405 Cursor to bottom line L
406 Cursor to middle line M M-r
407 Cursor to top line H M-R
408 Cursor up k Up
409 Delete entire line d C-u
410 Delete to end of line D C-k
411 End of line $ C-e
412 Go to line : g
413 Half page down C-d M-Down
414 Half page up C-u M-Up
415 Jump forward f f
416 Jump backward F F
417 Jump again ; ;
418 Jump again in reverse , ,
419 Next page C-f Page down
420 Next space W
421 Next space, end of word E
422 Next word w
423 Next word end e M-f
424 Paste buffer p C-y
425 Previous page C-b Page up
426 Previous word b M-b
427 Previous space B
428 Quit mode q Escape
429 Rectangle toggle v R
430 Scroll down C-Down or C-e C-Down
431 Scroll up C-Up or C-y C-Up
432 Search again n n
433 Search again in reverse N N
434 Search backward ? C-r
435 Search forward / C-s
436 Start of line 0 C-a
437 Start selection Space C-Space
438 Top of history g M->
439 Transpose chars C-t
440
441 The next and previous word keys use space and the ‘-’, ‘_’ and ‘@’ char‐
442 acters as word delimiters by default, but this can be adjusted by setting
443 the word-separators window option. Next word moves to the start of the
444 next word, next word end to the end of the next word and previous word to
445 the start of the previous word. The three next and previous space keys
446 work similarly but use a space alone as the word separator.
447
448 The jump commands enable quick movement within a line. For instance,
449 typing ‘f’ followed by ‘/’ will move the cursor to the next ‘/’ character
450 on the current line. A ‘;’ will then jump to the next occurrence.
451
452 Commands in copy mode may be prefaced by an optional repeat count. With
453 vi key bindings, a prefix is entered using the number keys; with emacs,
454 the Alt (meta) key and a number begins prefix entry. For example, to
455 move the cursor forward by ten words, use ‘M-1 0 M-f’ in emacs mode, and
456 ‘10w’ in vi.
457
458 Mode key bindings are defined in a set of named tables: vi-edit and
459 emacs-edit for keys used when line editing at the command prompt;
460 vi-choice and emacs-choice for keys used when choosing from lists (such
461 as produced by the choose-window command); and vi-copy and emacs-copy
462 used in copy mode. The tables may be viewed with the list-keys command
463 and keys modified or removed with bind-key and unbind-key.
464
465 The paste buffer key pastes the first line from the top paste buffer on
466 the stack.
467
468 The synopsis for the copy-mode command is:
469
470 copy-mode [-u] [-t target-pane]
471 Enter copy mode. The -u option scrolls one page up.
472
473 Each window displayed by tmux may be split into one or more panes; each
474 pane takes up a certain area of the display and is a separate terminal.
475 A window may be split into panes using the split-window command. Windows
476 may be split horizontally (with the -h flag) or vertically. Panes may be
477 resized with the resize-pane command (bound to ‘C-up’, ‘C-down’ ‘C-left’
478 and ‘C-right’ by default), the current pane may be changed with the
479 select-pane command and the rotate-window and swap-pane commands may be
480 used to swap panes without changing their position. Panes are numbered
481 beginning from zero in the order they are created.
482
483 A number of preset layouts are available. These may be selected with the
484 select-layout command or cycled with next-layout (bound to ‘Space’ by
485 default); once a layout is chosen, panes within it may be moved and
486 resized as normal.
487
488 The following layouts are supported:
489
490 even-horizontal
491 Panes are spread out evenly from left to right across the window.
492
493 even-vertical
494 Panes are spread evenly from top to bottom.
495
496 main-horizontal
497 A large (main) pane is shown at the top of the window and the
498 remaining panes are spread from left to right in the leftover
499 space at the bottom. Use the main-pane-height window option to
500 specify the height of the top pane.
501
502 main-vertical
503 Similar to main-horizontal but the large pane is placed on the
504 left and the others spread from top to bottom along the right.
505 See the main-pane-width window option.
506
507 tiled Panes are spread out as evenly as possible over the window in
508 both rows and columns.
509
510 In addition, select-layout may be used to apply a previously used layout
511 - the list-windows command displays the layout of each window in a form
512 suitable for use with select-layout. For example:
513
514 $ tmux list-windows
515 0: ksh [159x48]
516 layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
517 $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
518
519 tmux automatically adjusts the size of the layout for the current window
520 size. Note that a layout cannot be applied to a window with more panes
521 than that from which the layout was originally defined.
522
523 Commands related to windows and panes are as follows:
524
525 break-pane [-d] [-t target-pane]
526 (alias: breakp)
527 Break target-pane off from its containing window to make it the
528 only pane in a new window. If -d is given, the new window does
529 not become the current window.
530
531 capture-pane [-b buffer-index] [-t target-pane]
532 (alias: capturep)
533 Capture the contents of a pane to the specified buffer, or a new
534 buffer if none is specified.
535
536 choose-client [-t target-window] [template]
537 Put a window into client choice mode, allowing a client to be
538 selected interactively from a list. After a client is chosen,
539 ‘%%’ is replaced by the client pty(4) path in template and the
540 result executed as a command. If template is not given, "detach-
541 client -t '%%'" is used. This command works only from inside
542 tmux.
543
544 choose-session [-t target-window] [template]
545 Put a window into session choice mode, where a session may be
546 selected interactively from a list. When one is chosen, ‘%%’ is
547 replaced by the session name in template and the result executed
548 as a command. If template is not given, "switch-client -t '%%'"
549 is used. This command works only from inside tmux.
550
551 choose-window [-t target-window] [template]
552 Put a window into window choice mode, where a window may be cho‐
553 sen interactively from a list. After a window is selected, ‘%%’
554 is replaced by the session name and window index in template and
555 the result executed as a command. If template is not given,
556 "select-window -t '%%'" is used. This command works only from
557 inside tmux.
558
559 display-panes [-t target-client]
560 (alias: displayp)
561 Display a visible indicator of each pane shown by target-client.
562 See the display-panes-time, display-panes-colour, and
563 display-panes-active-colour session options. While the indicator
564 is on screen, a pane may be selected with the ‘0’ to ‘9’ keys.
565
566 find-window [-t target-window] match-string
567 (alias: findw)
568 Search for the fnmatch(3) pattern match-string in window names,
569 titles, and visible content (but not history). If only one win‐
570 dow is matched, it'll be automatically selected, otherwise a
571 choice list is shown. This command only works from inside tmux.
572
573 join-pane [-dhv] [-l size | -p percentage] [-s src-pane] [-t dst-pane]
574 (alias: joinp)
575 Like split-window, but instead of splitting dst-pane and creating
576 a new pane, split it and move src-pane into the space. This can
577 be used to reverse break-pane.
578
579 kill-pane [-a] [-t target-pane]
580 (alias: killp)
581 Destroy the given pane. If no panes remain in the containing
582 window, it is also destroyed. The -a option kills all but the
583 pane given with -t.
584
585 kill-window [-t target-window]
586 (alias: killw)
587 Kill the current window or the window at target-window, removing
588 it from any sessions to which it is linked.
589
590 last-pane [-t target-window]
591 (alias: lastp)
592 Select the last (previously selected) pane.
593
594 last-window [-t target-session]
595 (alias: last)
596 Select the last (previously selected) window. If no
597 target-session is specified, select the last window of the cur‐
598 rent session.
599
600 link-window [-dk] [-s src-window] [-t dst-window]
601 (alias: linkw)
602 Link the window at src-window to the specified dst-window. If
603 dst-window is specified and no such window exists, the src-window
604 is linked there. If -k is given and dst-window exists, it is
605 killed, otherwise an error is generated. If -d is given, the
606 newly linked window is not selected.
607
608 list-panes [-t target-window]
609 (alias: lsp)
610 List the panes in the current window or in target-window.
611
612 list-windows [-t target-session]
613 (alias: lsw)
614 List windows in the current session or in target-session.
615
616 move-window [-dk] [-s src-window] [-t dst-window]
617 (alias: movew)
618 This is similar to link-window, except the window at src-window
619 is moved to dst-window.
620
621 new-window [-adk] [-n window-name] [-t target-window] [shell-command]
622 (alias: neww)
623 Create a new window. With -a, the new window is inserted at the
624 next index up from the specified target-window, moving windows up
625 if necessary, otherwise target-window is the new window location.
626
627 If -d is given, the session does not make the new window the cur‐
628 rent window. target-window represents the window to be created;
629 if the target already exists an error is shown, unless the -k
630 flag is used, in which case it is destroyed. shell-command is
631 the command to execute. If shell-command is not specified, the
632 value of the default-command option is used.
633
634 When the shell command completes, the window closes. See the
635 remain-on-exit option to change this behaviour.
636
637 The TERM environment variable must be set to “screen” for all
638 programs running inside tmux. New windows will automatically
639 have “TERM=screen” added to their environment, but care must be
640 taken not to reset this in shell start-up files.
641
642 next-layout [-t target-window]
643 (alias: nextl)
644 Move a window to the next layout and rearrange the panes to fit.
645
646 next-window [-a] [-t target-session]
647 (alias: next)
648 Move to the next window in the session. If -a is used, move to
649 the next window with a bell, activity or content alert.
650
651 pipe-pane [-o] [-t target-pane] [shell-command]
652 (alias: pipep)
653 Pipe any output sent by the program in target-pane to a shell
654 command. A pane may only be piped to one command at a time, any
655 existing pipe is closed before shell-command is executed. The
656 shell-command string may contain the special character sequences
657 supported by the status-left command. If no shell-command is
658 given, the current pipe (if any) is closed.
659
660 The -o option only opens a new pipe if no previous pipe exists,
661 allowing a pipe to be toggled with a single key, for example:
662
663 bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
664
665 previous-layout [-t target-window]
666 (alias: prevl)
667 Move to the previous layout in the session.
668
669 previous-window [-a] [-t target-session]
670 (alias: prev)
671 Move to the previous window in the session. With -a, move to the
672 previous window with a bell, activity or content alert.
673
674 rename-window [-t target-window] new-name
675 (alias: renamew)
676 Rename the current window, or the window at target-window if
677 specified, to new-name.
678
679 resize-pane [-DLRU] [-t target-pane] [adjustment]
680 (alias: resizep)
681 Resize a pane, upward with -U (the default), downward with -D, to
682 the left with -L and to the right with -R. The adjustment is
683 given in lines or cells (the default is 1).
684
685 respawn-window [-k] [-t target-window] [shell-command]
686 (alias: respawnw)
687 Reactivate a window in which the command has exited (see the
688 remain-on-exit window option). If shell-command is not given,
689 the command used when the window was created is executed. The
690 window must be already inactive, unless -k is given, in which
691 case any existing command is killed.
692
693 rotate-window [-DU] [-t target-window]
694 (alias: rotatew)
695 Rotate the positions of the panes within a window, either upward
696 (numerically lower) with -U or downward (numerically higher).
697
698 select-layout [-t target-window] [layout-name]
699 (alias: selectl)
700 Choose a specific layout for a window. If layout-name is not
701 given, the last preset layout used (if any) is reapplied.
702
703 select-pane [-DLRU] [-t target-pane]
704 (alias: selectp)
705 Make pane target-pane the active pane in window target-window.
706 If one of -D, -L, -R, or -U is used, respectively the pane below,
707 to the left, to the right, or above the target pane is used.
708
709 select-window [-t target-window]
710 (alias: selectw)
711 Select the window at target-window.
712
713 split-window [-dhv] [-l size | -p percentage] [-t target-pane]
714 [shell-command]
715 (alias: splitw)
716 Create a new pane by splitting target-pane: -h does a horizontal
717 split and -v a vertical split; if neither is specified, -v is
718 assumed. The -l and -p options specify the size of the new pane
719 in lines (for vertical split) or in cells (for horizontal split),
720 or as a percentage, respectively. All other options have the
721 same meaning as for the new-window command.
722
723 swap-pane [-dDU] [-s src-pane] [-t dst-pane]
724 (alias: swapp)
725 Swap two panes. If -U is used and no source pane is specified
726 with -s, dst-pane is swapped with the previous pane (before it
727 numerically); -D swaps with the next pane (after it numerically).
728 -d instructs tmux not to change the active pane.
729
730 swap-window [-d] [-s src-window] [-t dst-window]
731 (alias: swapw)
732 This is similar to link-window, except the source and destination
733 windows are swapped. It is an error if no window exists at
734 src-window.
735
736 unlink-window [-k] [-t target-window]
737 (alias: unlinkw)
738 Unlink target-window. Unless -k is given, a window may be
739 unlinked only if it is linked to multiple sessions - windows may
740 not be linked to no sessions; if -k is specified and the window
741 is linked to only one session, it is unlinked and destroyed.
742
744 tmux allows a command to be bound to most keys, with or without a prefix
745 key. When specifying keys, most represent themselves (for example ‘A’ to
746 ‘Z’). Ctrl keys may be prefixed with ‘C-’ or ‘^’, and Alt (meta) with
747 ‘M-’. In addition, the following special key names are accepted: Up,
748 Down, Left, Right, BSpace, BTab, DC (Delete), End, Enter, Escape, F1 to
749 F20, Home, IC (Insert), NPage (Page Up), PPage (Page Down), Space, and
750 Tab. Note that to bind the ‘"’ or ‘'’ keys, quotation marks are neces‐
751 sary, for example:
752
753 bind-key '"' split-window
754 bind-key "'" new-window
755
756 Commands related to key bindings are as follows:
757
758 bind-key [-cnr] [-t key-table] key command [arguments]
759 (alias: bind)
760 Bind key key to command. By default (without -t) the primary key
761 bindings are modified (those normally activated with the prefix
762 key); in this case, if -n is specified, it is not necessary to
763 use the prefix key, command is bound to key alone. The -r flag
764 indicates this key may repeat, see the repeat-time option.
765
766 If -t is present, key is bound in key-table: the binding for com‐
767 mand mode with -c or for normal mode without. To view the
768 default bindings and possible commands, see the list-keys com‐
769 mand.
770
771 list-keys [-t key-table]
772 (alias: lsk)
773 List all key bindings. Without -t the primary key bindings -
774 those executed when preceded by the prefix key - are printed.
775 Keys bound without the prefix key (see bind-key -n) are marked
776 with ‘(no prefix)’.
777
778 With -t, the key bindings in key-table are listed; this may be
779 one of: vi-edit, emacs-edit, vi-choice, emacs-choice, vi-copy or
780 emacs-copy.
781
782 send-keys [-t target-pane] key ...
783 (alias: send)
784 Send a key or keys to a window. Each argument key is the name of
785 the key (such as ‘C-a’ or ‘npage’ ) to send; if the string is not
786 recognised as a key, it is sent as a series of characters. All
787 arguments are sent sequentially from first to last.
788
789 send-prefix [-t target-pane]
790 Send the prefix key to a window as if it was pressed. If multi‐
791 ple prefix keys are configured, only the first is sent.
792
793 unbind-key [-acn] [-t key-table] key
794 (alias: unbind)
795 Unbind the command bound to key. Without -t the primary key
796 bindings are modified; in this case, if -n is specified, the com‐
797 mand bound to key without a prefix (if any) is removed. If -a is
798 present, all key bindings are removed.
799
800 If -t is present, key in key-table is unbound: the binding for
801 command mode with -c or for normal mode without.
802
804 The appearance and behaviour of tmux may be modified by changing the
805 value of various options. There are three types of option: server
806 options, session options and window options.
807
808 The tmux server has a set of global options which do not apply to any
809 particular window or session. These are altered with the set-option -s
810 command, or displayed with the show-options -s command.
811
812 In addition, each individual session may have a set of session options,
813 and there is a separate set of global session options. Sessions which do
814 not have a particular option configured inherit the value from the global
815 session options. Session options are set or unset with the set-option
816 command and may be listed with the show-options command. The available
817 server and session options are listed under the set-option command.
818
819 Similarly, a set of window options is attached to each window, and there
820 is a set of global window options from which any unset options are inher‐
821 ited. Window options are altered with the set-window-option command and
822 can be listed with the show-window-options command. All window options
823 are documented with the set-window-option command.
824
825 Commands which set options are as follows:
826
827 set-option [-agsuw] [-t target-session | target-window] option value
828 (alias: set)
829 Set a window option with -w (equivalent to the set-window-option
830 command), a server option with -s, otherwise a session option.
831
832 If -g is specified, the global session or window option is set.
833 With -a, and if the option expects a string, value is appended to
834 the existing setting. The -u flag unsets an option, so a session
835 inherits the option from the global options. It is not possible
836 to unset a global option.
837
838 Available window options are listed under set-window-option.
839
840 Available server options are:
841
842 escape-time
843 Set the time in milliseconds for which tmux waits after
844 an escape is input to determine if it is part of a func‐
845 tion or meta key sequences. The default is 500 millisec‐
846 onds.
847
848 exit-unattached
849 If enabled, the server will exit when there are no
850 attached clients, rather than when there are no attached
851 sessions.
852
853 quiet Enable or disable the display of various informational
854 messages (see also the -q command line flag).
855
856 Available session options are:
857
858 base-index index
859 Set the base index from which an unused index should be
860 searched when a new window is created. The default is
861 zero.
862
863 bell-action [any | none | current]
864 Set action on window bell. any means a bell in any win‐
865 dow linked to a session causes a bell in the current win‐
866 dow of that session, none means all bells are ignored and
867 current means only bell in windows other than the current
868 window are ignored.
869
870 buffer-limit number
871 Set the number of buffers kept for each session; as new
872 buffers are added to the top of the stack, old ones are
873 removed from the bottom if necessary to maintain this
874 maximum length.
875
876 default-command shell-command
877 Set the command used for new windows (if not specified
878 when the window is created) to shell-command, which may
879 be any sh(1) command. The default is an empty string,
880 which instructs tmux to create a login shell using the
881 value of the default-shell option.
882
883 default-path path
884 Set the default working directory for processes created
885 from keys, or interactively from the prompt. The default
886 is empty, which means to use the working directory of the
887 shell from which the server was started if it is avail‐
888 able or the user's home if not.
889
890 default-shell path
891 Specify the default shell. This is used as the login
892 shell for new windows when the default-command option is
893 set to empty, and must be the full path of the exe‐
894 cutable. When started tmux tries to set a default value
895 from the first suitable of the SHELL environment vari‐
896 able, the shell returned by getpwuid(3), or /bin/sh.
897 This option should be configured when tmux is used as a
898 login shell.
899
900 default-terminal terminal
901 Set the default terminal for new windows created in this
902 session - the default value of the TERM environment vari‐
903 able. For tmux to work correctly, this must be set to
904 ‘screen’ or a derivative of it.
905
906 destroy-unattached
907 If enabled and the session is no longer attached to any
908 clients, it is destroyed.
909
910 detach-on-destroy
911 If on (the default), the client is detached when the ses‐
912 sion it is attached to is destroyed. If off, the client
913 is switched to the most recently active of the remaining
914 sessions.
915
916 display-panes-active-colour colour
917 Set the colour used by the display-panes command to show
918 the indicator for the active pane.
919
920 display-panes-colour colour
921 Set the colour used by the display-panes command to show
922 the indicators for inactive panes.
923
924 display-panes-time time
925 Set the time in milliseconds for which the indicators
926 shown by the display-panes command appear.
927
928 display-time time
929 Set the amount of time for which status line messages and
930 other on-screen indicators are displayed. time is in
931 milliseconds.
932
933 history-limit lines
934 Set the maximum number of lines held in window history.
935 This setting applies only to new windows - existing win‐
936 dow histories are not resized and retain the limit at the
937 point they were created.
938
939 lock-after-time number
940 Lock the session (like the lock-session command) after
941 number seconds of inactivity, or the entire server (all
942 sessions) if the lock-server option is set. The default
943 is not to lock (set to 0).
944
945 lock-command shell-command
946 Command to run when locking each client. The default is
947 to run lock(1) with -np.
948
949 lock-server [on | off]
950 If this option is on (the default), instead of each ses‐
951 sion locking individually as each has been idle for
952 lock-after-time, the entire server will lock after all
953 sessions would have locked. This has no effect as a ses‐
954 sion option; it must be set as a global option.
955
956 message-attr attributes
957 Set status line message attributes, where attributes is
958 either none or a comma-delimited list of one or more of:
959 bright (or bold), dim, underscore, blink, reverse,
960 hidden, or italics.
961
962 message-bg colour
963 Set status line message background colour, where colour
964 is one of: black, red, green, yellow, blue, magenta,
965 cyan, white, colour0 to colour255 from the 256-colour
966 palette, or default.
967
968 message-fg colour
969 Set status line message foreground colour.
970
971 message-limit number
972 Set the number of error or information messages to save
973 in the message log for each client. The default is 20.
974
975 mouse-select-pane [on | off]
976 If on, tmux captures the mouse and when a window is split
977 into multiple panes the mouse may be used to select the
978 current pane. The mouse click is also passed through to
979 the application as normal.
980
981 pane-active-border-bg colour
982
983 pane-active-border-fg colour
984 Set the pane border colour for the currently active pane.
985
986 pane-border-bg colour
987
988 pane-border-fg colour
989 Set the pane border colour for panes aside from the
990 active pane.
991
992 prefix keys
993 Set the keys accepted as a prefix key. keys is a comma-
994 separated list of key names, each of which individually
995 behave as the prefix key.
996
997 repeat-time time
998 Allow multiple commands to be entered without pressing
999 the prefix-key again in the specified time milliseconds
1000 (the default is 500). Whether a key repeats may be set
1001 when it is bound using the -r flag to bind-key. Repeat
1002 is enabled for the default keys bound to the resize-pane
1003 command.
1004
1005 set-remain-on-exit [on | off]
1006 Set the remain-on-exit window option for any windows
1007 first created in this session. When this option is true,
1008 windows in which the running program has exited do not
1009 close, instead remaining open but inactivate. Use the
1010 respawn-window command to reactivate such a window, or
1011 the kill-window command to destroy it.
1012
1013 set-titles [on | off]
1014 Attempt to set the window title using the \e]2;...\007
1015 xterm code if the terminal appears to be an xterm. This
1016 option is off by default. Note that elinks will only
1017 attempt to set the window title if the STY environment
1018 variable is set.
1019
1020 set-titles-string string
1021 String used to set the window title if set-titles is on.
1022 Character sequences are replaced as for the status-left
1023 option.
1024
1025 status [on | off]
1026 Show or hide the status line.
1027
1028 status-attr attributes
1029 Set status line attributes.
1030
1031 status-bg colour
1032 Set status line background colour.
1033
1034 status-fg colour
1035 Set status line foreground colour.
1036
1037 status-interval interval
1038 Update the status bar every interval seconds. By
1039 default, updates will occur every 15 seconds. A setting
1040 of zero disables redrawing at interval.
1041
1042 status-justify [left | centre | right]
1043 Set the position of the window list component of the sta‐
1044 tus line: left, centre or right justified.
1045
1046 status-keys [vi | emacs]
1047 Use vi or emacs-style key bindings in the status line,
1048 for example at the command prompt. The default is emacs,
1049 unless the VISUAL or EDITOR environment variables are set
1050 and contain the string ‘vi’.
1051
1052 status-left string
1053 Display string to the left of the status bar. string
1054 will be passed through strftime(3) before being used. By
1055 default, the session name is shown. string may contain
1056 any of the following special character sequences:
1057
1058 Character pair Replaced with
1059 #(shell-command) First line of the command's
1060 output
1061 #[attributes] Colour or attribute change
1062 #H Hostname of local host
1063 #F Current window flag
1064 #I Current window index
1065 #P Current pane index
1066 #S Session name
1067 #T Current window title
1068 #W Current window name
1069 ## A literal ‘#’
1070
1071 The #(shell-command) form executes ‘shell-command’ and
1072 inserts the first line of its output. Note that shell
1073 commands are only executed once at the interval specified
1074 by the status-interval option: if the status line is
1075 redrawn in the meantime, the previous result is used.
1076 Shell commands are executed with the tmux global environ‐
1077 ment set (see the ENVIRONMENT section).
1078
1079 The window title (#T) is the title set by the program
1080 running within the window using the OSC title setting
1081 sequence, for example:
1082
1083 $ printf '\033]2;My Title\033\\'
1084
1085 When a window is first created, its title is the host‐
1086 name.
1087
1088 #[attributes] allows a comma-separated list of attributes
1089 to be specified, these may be ‘fg=colour’ to set the
1090 foreground colour, ‘bg=colour’ to set the background
1091 colour, the name of one of the attributes (listed under
1092 the message-attr option) to turn an attribute on, or an
1093 attribute prefixed with ‘no’ to turn one off, for example
1094 nobright. Examples are:
1095
1096 #(sysctl vm.loadavg)
1097 #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
1098
1099 Where appropriate, special character sequences may be
1100 prefixed with a number to specify the maximum length, for
1101 example ‘#24T’.
1102
1103 By default, UTF-8 in string is not interpreted, to enable
1104 UTF-8, use the status-utf8 option.
1105
1106 status-left-attr attributes
1107 Set the attribute of the left part of the status line.
1108
1109 status-left-bg colour
1110 Set the background colour of the left part of the status
1111 line.
1112
1113 status-left-fg colour
1114 Set the foreground colour of the left part of the status
1115 line.
1116
1117 status-left-length length
1118 Set the maximum length of the left component of the sta‐
1119 tus bar. The default is 10.
1120
1121 status-right string
1122 Display string to the right of the status bar. By
1123 default, the current window title in double quotes, the
1124 date and the time are shown. As with status-left, string
1125 will be passed to strftime(3), character pairs are
1126 replaced, and UTF-8 is dependent on the status-utf8
1127 option.
1128
1129 status-right-attr attributes
1130 Set the attribute of the right part of the status line.
1131
1132 status-right-bg colour
1133 Set the background colour of the right part of the status
1134 line.
1135
1136 status-right-fg colour
1137 Set the foreground colour of the right part of the status
1138 line.
1139
1140 status-right-length length
1141 Set the maximum length of the right component of the sta‐
1142 tus bar. The default is 40.
1143
1144 status-utf8 [on | off]
1145 Instruct tmux to treat top-bit-set characters in the
1146 status-left and status-right strings as UTF-8; notably,
1147 this is important for wide characters. This option
1148 defaults to off.
1149
1150 terminal-overrides string
1151 Contains a list of entries which override terminal
1152 descriptions read using terminfo(5). string is a comma-
1153 separated list of items each a colon-separated string
1154 made up of a terminal type pattern (matched using
1155 fnmatch(3)) and a set of name=value entries.
1156
1157 For example, to set the ‘clear’ terminfo(5) entry to
1158 ‘\e[H\e[2J’ for all terminal types and the ‘dch1’ entry
1159 to ‘\e[P’ for the ‘rxvt’ terminal type, the option could
1160 be set to the string:
1161
1162 "*:clear=\e[H\e[2J,rxvt:dch1=\e[P"
1163
1164 The terminal entry value is passed through strunvis(3)
1165 before interpretation. The default value forcibly cor‐
1166 rects the ‘colors’ entry for terminals which support 88
1167 or 256 colours:
1168
1169 "*88col*:colors=88,*256col*:colors=256"
1170
1171 update-environment variables
1172 Set a space-separated string containing a list of envi‐
1173 ronment variables to be copied into the session environ‐
1174 ment when a new session is created or an existing session
1175 is attached. Any variables that do not exist in the
1176 source environment are set to be removed from the session
1177 environment (as if -r was given to the set-environment
1178 command). The default is "DISPLAY SSH_ASKPASS
1179 SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAU‐
1180 THORITY".
1181
1182 visual-activity [on | off]
1183 If on, display a status line message when activity occurs
1184 in a window for which the monitor-activity window option
1185 is enabled.
1186
1187 visual-bell [on | off]
1188 If this option is on, a message is shown on a bell
1189 instead of it being passed through to the terminal (which
1190 normally makes a sound). Also see the bell-action
1191 option.
1192
1193 visual-content [on | off]
1194 Like visual-activity, display a message when content is
1195 present in a window for which the monitor-content window
1196 option is enabled.
1197
1198 visual-silence [on | off]
1199 If monitor-silence is enabled, prints a message after the
1200 interval has expired on a given window.
1201
1202 set-window-option [-agu] [-t target-window] option value
1203 (alias: setw)
1204 Set a window option. The -a, -g and -u flags work similarly to
1205 the set-option command.
1206
1207 Supported window options are:
1208
1209 aggressive-resize [on | off]
1210 Aggressively resize the chosen window. This means that
1211 tmux will resize the window to the size of the smallest
1212 session for which it is the current window, rather than
1213 the smallest session to which it is attached. The window
1214 may resize when the current window is changed on another
1215 sessions; this option is good for full-screen programs
1216 which support SIGWINCH and poor for interactive programs
1217 such as shells.
1218
1219 alternate-screen [on | off]
1220 This option configures whether programs running inside
1221 tmux may use the terminal alternate screen feature, which
1222 allows the smcup and rmcup terminfo(5) capabilities to be
1223 issued to preserve the existing window content on start
1224 and restore it on exit.
1225
1226 automatic-rename [on | off]
1227 Control automatic window renaming. When this setting is
1228 enabled, tmux will attempt - on supported platforms - to
1229 rename the window to reflect the command currently run‐
1230 ning in it. This flag is automatically disabled for an
1231 individual window when a name is specified at creation
1232 with new-window or new-session, or later with
1233 rename-window. It may be switched off globally with:
1234
1235 set-window-option -g automatic-rename off
1236
1237 clock-mode-colour colour
1238 Set clock colour.
1239
1240 clock-mode-style [12 | 24]
1241 Set clock hour format.
1242
1243 force-height height
1244 force-width width
1245 Prevent tmux from resizing a window to greater than width
1246 or height. A value of zero restores the default unlim‐
1247 ited setting.
1248
1249 main-pane-height height
1250 main-pane-width width
1251 Set the width or height of the main (left or top) pane in
1252 the main-horizontal or main-vertical layouts.
1253
1254 mode-attr attributes
1255 Set window modes attributes.
1256
1257 mode-bg colour
1258 Set window modes background colour.
1259
1260 mode-fg colour
1261 Set window modes foreground colour.
1262
1263 mode-keys [vi | emacs]
1264 Use vi or emacs-style key bindings in copy and choice
1265 modes. As with the status-keys option, the default is
1266 emacs, unless VISUAL or EDITOR contains ‘vi’.
1267
1268 mode-mouse [on | off]
1269 Mouse state in modes. If on, the mouse may be used to
1270 copy a selection by dragging in copy mode, or to select
1271 an option in choice mode.
1272
1273 monitor-activity [on | off]
1274 Monitor for activity in the window. Windows with activ‐
1275 ity are highlighted in the status line.
1276
1277 monitor-content match-string
1278 Monitor content in the window. When fnmatch(3) pattern
1279 match-string appears in the window, it is highlighted in
1280 the status line.
1281
1282 monitor-silence [interval]
1283 Monitor for silence (no activity) in the window within
1284 interval seconds. Windows that have been silent for the
1285 interval are highlighted in the status line. An interval
1286 of zero disables the monitoring.
1287
1288 other-pane-height height
1289 Set the height of the other panes (not the main pane) in
1290 the main-horizontal layout. If this option is set to 0
1291 (the default), it will have no effect. If both the
1292 main-pane-height and other-pane-height options are set,
1293 the main pane will grow taller to make the other panes
1294 the specified height, but will never shrink to do so.
1295
1296 other-pane-width width
1297 Like other-pane-height, but set the width of other panes
1298 in the main-vertical layout.
1299
1300 remain-on-exit [on | off]
1301 A window with this flag set is not destroyed when the
1302 program running in it exits. The window may be reacti‐
1303 vated with the respawn-window command.
1304
1305 synchronize-panes [on | off]
1306 Duplicate input to any pane to all other panes in the
1307 same window (only for panes that are not in any special
1308 mode).
1309
1310 utf8 [on | off]
1311 Instructs tmux to expect UTF-8 sequences to appear in
1312 this window.
1313
1314 window-status-attr attributes
1315 Set status line attributes for a single window.
1316
1317 window-status-bg colour
1318 Set status line background colour for a single window.
1319
1320 window-status-fg colour
1321 Set status line foreground colour for a single window.
1322
1323 window-status-format string
1324 Set the format in which the window is displayed in the
1325 status line window list. See the status-left option for
1326 details of special character sequences available. The
1327 default is ‘#I:#W#F’.
1328
1329 window-status-alert-attr attributes
1330 Set status line attributes for windows which have an
1331 alert (bell, activity or content).
1332
1333 window-status-alert-bg colour
1334 Set status line background colour for windows with an
1335 alert.
1336
1337 window-status-alert-fg colour
1338 Set status line foreground colour for windows with an
1339 alert.
1340
1341 window-status-current-attr attributes
1342 Set status line attributes for the currently active win‐
1343 dow.
1344
1345 window-status-current-bg colour
1346 Set status line background colour for the currently
1347 active window.
1348
1349 window-status-current-fg colour
1350 Set status line foreground colour for the currently
1351 active window.
1352
1353 window-status-current-format string
1354 Like window-status-format, but is the format used when
1355 the window is the current window.
1356
1357 word-separators string
1358 Sets the window's conception of what characters are con‐
1359 sidered word separators, for the purposes of the next and
1360 previous word commands in copy mode. The default is
1361 ‘ -_@’.
1362
1363 xterm-keys [on | off]
1364 If this option is set, tmux will generate xterm(1) -style
1365 function key sequences; these have a number included to
1366 indicate modifiers such as Shift, Alt or Ctrl. The
1367 default is off.
1368
1369 show-options [-gsw] [-t target-session | target-window]
1370 (alias: show)
1371 Show the window options with -w (equivalent to
1372 show-window-options), the server options with -s, otherwise the
1373 session options for target session. Global session or window
1374 options are listed if -g is used.
1375
1376 show-window-options [-g] [-t target-window]
1377 (alias: showw)
1378 List the window options for target-window, or the global window
1379 options if -g is used.
1380
1382 When the server is started, tmux copies the environment into the global
1383 environment; in addition, each session has a session environment. When a
1384 window is created, the session and global environments are merged. If a
1385 variable exists in both, the value from the session environment is used.
1386 The result is the initial environment passed to the new process.
1387
1388 The update-environment session option may be used to update the session
1389 environment from the client when a new session is created or an old reat‐
1390 tached. tmux also initialises the TMUX variable with some internal
1391 information to allow commands to be executed from inside, and the TERM
1392 variable with the correct terminal setting of ‘screen’.
1393
1394 Commands to alter and view the environment are:
1395
1396 set-environment [-gru] [-t target-session] name [value]
1397 (alias: setenv)
1398 Set or unset an environment variable. If -g is used, the change
1399 is made in the global environment; otherwise, it is applied to
1400 the session environment for target-session. The -u flag unsets a
1401 variable. -r indicates the variable is to be removed from the
1402 environment before starting a new process.
1403
1404 show-environment [-g] [-t target-session]
1405 (alias: showenv)
1406 Display the environment for target-session or the global environ‐
1407 ment with -g. Variables removed from the environment are pre‐
1408 fixed with ‘-’.
1409
1411 tmux includes an optional status line which is displayed in the bottom
1412 line of each terminal. By default, the status line is enabled (it may be
1413 disabled with the status session option) and contains, from left-to-
1414 right: the name of the current session in square brackets; the window
1415 list; the current window title in double quotes; and the time and date.
1416
1417 The status line is made of three parts: configurable left and right sec‐
1418 tions (which may contain dynamic content such as the time or output from
1419 a shell command, see the status-left, status-left-length, status-right,
1420 and status-right-length options below), and a central window list. By
1421 default, the window list shows the index, name and (if any) flag of the
1422 windows present in the current session in ascending numerical order. It
1423 may be customised with the window-status-format and
1424 window-status-current-format options. The flag is one of the following
1425 symbols appended to the window name:
1426
1427 Symbol Meaning
1428 * Denotes the current window.
1429 - Marks the last window (previously selected).
1430 # Window is monitored and activity has been detected.
1431 ! A bell has occurred in the window.
1432 + Window is monitored for content and it has appeared.
1433 ~ The window has been silent for the monitor-silence
1434 interval.
1435
1436 The # symbol relates to the monitor-activity and + to the monitor-content
1437 window options. The window name is printed in inverted colours if an
1438 alert (bell, activity or content) is present.
1439
1440 The colour and attributes of the status line may be configured, the
1441 entire status line using the status-attr, status-fg and status-bg session
1442 options and individual windows using the window-status-attr,
1443 window-status-fg and window-status-bg window options.
1444
1445 The status line is automatically refreshed at interval if it has changed,
1446 the interval may be controlled with the status-interval session option.
1447
1448 Commands related to the status line are as follows:
1449
1450 command-prompt [-p prompts] [-t target-client] [template]
1451 Open the command prompt in a client. This may be used from
1452 inside tmux to execute commands interactively. If template is
1453 specified, it is used as the command. If -p is given, prompts is
1454 a comma-separated list of prompts which are displayed in order;
1455 otherwise a single prompt is displayed, constructed from template
1456 if it is present, or ‘:’ if not. Before the command is executed,
1457 the first occurrence of the string ‘%%’ and all occurrences of
1458 ‘%1’ are replaced by the response to the first prompt, the second
1459 ‘%%’ and all ‘%2’ are replaced with the response to the second
1460 prompt, and so on for further prompts. Up to nine prompt
1461 responses may be replaced (‘%1’ to ‘%9’).
1462
1463 confirm-before [-t target-client] command
1464 (alias: confirm)
1465 Ask for confirmation before executing command. This command
1466 works only from inside tmux.
1467
1468 display-message [-p] [-t target-client] [message]
1469 (alias: display)
1470 Display a message. If -p is given, the output is printed to std‐
1471 out, otherwise it is displayed in the target-client status line.
1472 The format of message is as for status-left, with the exception
1473 that #() are not handled.
1474
1476 tmux maintains a stack of paste buffers for each session. Up to the
1477 value of the buffer-limit option are kept; when a new buffer is added,
1478 the buffer at the bottom of the stack is removed. Buffers may be added
1479 using copy-mode or the set-buffer command, and pasted into a window using
1480 the paste-buffer command.
1481
1482 A configurable history buffer is also maintained for each window. By
1483 default, up to 2000 lines are kept; this can be altered with the
1484 history-limit option (see the set-option command above).
1485
1486 The buffer commands are as follows:
1487
1488 choose-buffer [-t target-window] [template]
1489 Put a window into buffer choice mode, where a buffer may be cho‐
1490 sen interactively from a list. After a buffer is selected, ‘%%’
1491 is replaced by the buffer index in template and the result exe‐
1492 cuted as a command. If template is not given, "paste-buffer -b
1493 '%%'" is used. This command works only from inside tmux.
1494
1495 clear-history [-t target-pane]
1496 (alias: clearhist)
1497 Remove and free the history for the specified pane.
1498
1499 copy-buffer [-a src-index] [-b dst-index] [-s src-session] [-t
1500 dst-session]
1501 (alias: copyb)
1502 Copy a session paste buffer to another session. If no sessions
1503 are specified, the current one is used instead.
1504
1505 delete-buffer [-b buffer-index] [-t target-session]
1506 (alias: deleteb)
1507 Delete the buffer at buffer-index, or the top buffer if not spec‐
1508 ified.
1509
1510 list-buffers [-t target-session]
1511 (alias: lsb)
1512 List the buffers in the given session.
1513
1514 load-buffer [-b buffer-index] [-t target-session] path
1515 (alias: loadb)
1516 Load the contents of the specified paste buffer from path.
1517
1518 paste-buffer [-dr] [-b buffer-index] [-s separator] [-t target-pane]
1519 (alias: pasteb)
1520 Insert the contents of a paste buffer into the specified pane.
1521 If not specified, paste into the current one. With -d, also
1522 delete the paste buffer from the stack. When output, any line‐
1523 feed (LF) characters in the paste buffer are replaced with a sep‐
1524 arator, by default carriage return (CR). A custom separator may
1525 be specified using the -s flag. The -r flag means to do no
1526 replacement (equivalent to a separator of LF).
1527
1528 save-buffer [-a] [-b buffer-index] [-t target-session] path
1529 (alias: saveb)
1530 Save the contents of the specified paste buffer to path. The -a
1531 option appends to rather than overwriting the file.
1532
1533 set-buffer [-b buffer-index] [-t target-session] data
1534 (alias: setb)
1535 Set the contents of the specified buffer to data.
1536
1537 show-buffer [-b buffer-index] [-t target-session]
1538 (alias: showb)
1539 Display the contents of the specified buffer.
1540
1542 Miscellaneous commands are as follows:
1543
1544 clock-mode [-t target-pane]
1545 Display a large clock.
1546
1547 if-shell shell-command command
1548 (alias: if)
1549 Execute command if shell-command returns success.
1550
1551 lock-server
1552 (alias: lock)
1553 Lock each client individually by running the command specified by
1554 the lock-command option.
1555
1556 run-shell shell-command
1557 (alias: run)
1558 Execute shell-command in the background without creating a win‐
1559 dow. After it finishes, any output to stdout is displayed in
1560 copy mode. If the command doesn't return success, the exit sta‐
1561 tus is also displayed.
1562
1563 server-info
1564 (alias: info)
1565 Show server information and terminal details.
1566
1568 ~/.tmux.conf Default tmux configuration file.
1569 /etc/tmux.conf System-wide configuration file.
1570
1572 To create a new tmux session running vi(1):
1573
1574 $ tmux new-session vi
1575
1576 Most commands have a shorter form, known as an alias. For new-session,
1577 this is new:
1578
1579 $ tmux new vi
1580
1581 Alternatively, the shortest unambiguous form of a command is accepted.
1582 If there are several options, they are listed:
1583
1584 $ tmux n
1585 ambiguous command: n, could be: new-session, new-window, next-window
1586
1587 Within an active session, a new window may be created by typing ‘C-b c’
1588 (Ctrl followed by the ‘b’ key followed by the ‘c’ key).
1589
1590 Windows may be navigated with: ‘C-b 0’ (to select window 0), ‘C-b 1’ (to
1591 select window 1), and so on; ‘C-b n’ to select the next window; and ‘C-b
1592 p’ to select the previous window.
1593
1594 A session may be detached using ‘C-b d’ (or by an external event such as
1595 ssh(1) disconnection) and reattached with:
1596
1597 $ tmux attach-session
1598
1599 Typing ‘C-b ?’ lists the current key bindings in the current window; up
1600 and down may be used to navigate the list or ‘q’ to exit from it.
1601
1602 Commands to be run when the tmux server is started may be placed in the
1603 ~/.tmux.conf configuration file. Common examples include:
1604
1605 Changing the default prefix key:
1606
1607 set-option -g prefix C-a
1608 unbind-key C-b
1609 bind-key C-a send-prefix
1610
1611 Turning the status line off, or changing its colour:
1612
1613 set-option -g status off
1614 set-option -g status-bg blue
1615
1616 Setting other options, such as the default command, or locking after 30
1617 minutes of inactivity:
1618
1619 set-option -g default-command "exec /bin/ksh"
1620 set-option -g lock-after-time 1800
1621
1622 Creating new key bindings:
1623
1624 bind-key b set-option status
1625 bind-key / command-prompt "split-window 'exec man %%'"
1626 bind-key S command-prompt "new-window -n %1 'ssh %1'"
1627
1629 pty(4)
1630
1632 Nicholas Marriott <nicm@users.sourceforge.net>
1633
1634BSD June 22, 2019 BSD