1.\" $OpenBSD: tmux.1,v 1.835 2021/04/15 05:38:11 nicm Exp $ 2.\" 3.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> 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.\" 17.Dd $Mdocdate: April 15 2021 $ 18.Dt TMUX 1 19.Os 20.Sh NAME 21.Nm tmux 22.Nd terminal multiplexer 23.Sh SYNOPSIS 24.Nm tmux 25.Bk -words 26.Op Fl 2CDluvV 27.Op Fl c Ar shell-command 28.Op Fl f Ar file 29.Op Fl L Ar socket-name 30.Op Fl S Ar socket-path 31.Op Fl T Ar features 32.Op Ar command Op Ar flags 33.Ek 34.Sh DESCRIPTION 35.Nm 36is a terminal multiplexer: 37it enables a number of terminals to be created, accessed, and 38controlled from a single screen. 39.Nm 40may be detached from a screen 41and continue running in the background, 42then later reattached. 43.Pp 44When 45.Nm 46is started it creates a new 47.Em session 48with a single 49.Em window 50and displays it on screen. 51A status line at the bottom of the screen 52shows information on the current session 53and is used to enter interactive commands. 54.Pp 55A session is a single collection of 56.Em pseudo terminals 57under the management of 58.Nm . 59Each session has one or more 60windows linked to it. 61A window occupies the entire screen 62and may be split into rectangular panes, 63each of which is a separate pseudo terminal 64(the 65.Xr pty 4 66manual page documents the technical details of pseudo terminals). 67Any number of 68.Nm 69instances may connect to the same session, 70and any number of windows may be present in the same session. 71Once all sessions are killed, 72.Nm 73exits. 74.Pp 75Each session is persistent and will survive accidental disconnection 76(such as 77.Xr ssh 1 78connection timeout) or intentional detaching (with the 79.Ql C-b d 80key strokes). 81.Nm 82may be reattached using: 83.Pp 84.Dl $ tmux attach 85.Pp 86In 87.Nm , 88a session is displayed on screen by a 89.Em client 90and all sessions are managed by a single 91.Em server . 92The server and each client are separate processes which communicate through a 93socket in 94.Pa /tmp . 95.Pp 96The options are as follows: 97.Bl -tag -width "XXXXXXXXXXXX" 98.It Fl 2 99Force 100.Nm 101to assume the terminal supports 256 colours. 102This is equivalent to 103.Fl T Ar 256 . 104.It Fl C 105Start in control mode (see the 106.Sx CONTROL MODE 107section). 108Given twice 109.Xo ( Fl CC ) Xc 110disables echo. 111.It Fl c Ar shell-command 112Execute 113.Ar shell-command 114using the default shell. 115If necessary, the 116.Nm 117server will be started to retrieve the 118.Ic default-shell 119option. 120This option is for compatibility with 121.Xr sh 1 122when 123.Nm 124is used as a login shell. 125.It Fl D 126Do not start the 127.Nm 128server as a daemon. 129This also turns the 130.Ic exit-empty 131option off. 132With 133.Fl D , 134.Ar command 135may not be specified. 136.It Fl f Ar file 137Specify an alternative configuration file. 138By default, 139.Nm 140loads the system configuration file from 141.Pa /etc/tmux.conf , 142if present, then looks for a user configuration file at 143.Pa ~/.tmux.conf . 144.Pp 145The configuration file is a set of 146.Nm 147commands which are executed in sequence when the server is first started. 148.Nm 149loads configuration files once when the server process has started. 150The 151.Ic source-file 152command may be used to load a file later. 153.Pp 154.Nm 155shows any error messages from commands in configuration files in the first 156session created, and continues to process the rest of the configuration file. 157.It Fl L Ar socket-name 158.Nm 159stores the server socket in a directory under 160.Ev TMUX_TMPDIR 161or 162.Pa /tmp 163if it is unset. 164The default socket is named 165.Em default . 166This option allows a different socket name to be specified, allowing several 167independent 168.Nm 169servers to be run. 170Unlike 171.Fl S 172a full path is not necessary: the sockets are all created in a directory 173.Pa tmux-UID 174under the directory given by 175.Ev TMUX_TMPDIR 176or in 177.Pa /tmp . 178The 179.Pa tmux-UID 180directory is created by 181.Nm 182and must not be world readable, writable or executable. 183.Pp 184If the socket is accidentally removed, the 185.Dv SIGUSR1 186signal may be sent to the 187.Nm 188server process to recreate it (note that this will fail if any parent 189directories are missing). 190.It Fl l 191Behave as a login shell. 192This flag currently has no effect and is for compatibility with other shells 193when using tmux as a login shell. 194.It Fl N 195Do not start the server even if the command would normally do so (for example 196.Ic new-session 197or 198.Ic start-server ) . 199.It Fl S Ar socket-path 200Specify a full alternative path to the server socket. 201If 202.Fl S 203is specified, the default socket directory is not used and any 204.Fl L 205flag is ignored. 206.It Fl u 207Write UTF-8 output to the terminal even if the first environment 208variable of 209.Ev LC_ALL , 210.Ev LC_CTYPE , 211or 212.Ev LANG 213that is set does not contain 214.Qq UTF-8 215or 216.Qq UTF8 . 217This is equivalent to 218.Fl T Ar UTF-8 . 219.It Fl T Ar features 220Set terminal features for the client. 221This is a comma-separated list of features. 222See the 223.Ic terminal-features 224option. 225.It Fl v 226Request verbose logging. 227Log messages will be saved into 228.Pa tmux-client-PID.log 229and 230.Pa tmux-server-PID.log 231files in the current directory, where 232.Em PID 233is the PID of the server or client process. 234If 235.Fl v 236is specified twice, an additional 237.Pa tmux-out-PID.log 238file is generated with a copy of everything 239.Nm 240writes to the terminal. 241.Pp 242The 243.Dv SIGUSR2 244signal may be sent to the 245.Nm 246server process to toggle logging between on (as if 247.Fl v 248was given) and off. 249.It Fl V 250Report the 251.Nm 252version. 253.It Ar command Op Ar flags 254This specifies one of a set of commands used to control 255.Nm , 256as described in the following sections. 257If no commands are specified, the 258.Ic new-session 259command is assumed. 260.El 261.Sh DEFAULT KEY BINDINGS 262.Nm 263may be controlled from an attached client by using a key combination of a 264prefix key, 265.Ql C-b 266(Ctrl-b) by default, followed by a command key. 267.Pp 268The default command key bindings are: 269.Pp 270.Bl -tag -width "XXXXXXXXXX" -offset indent -compact 271.It C-b 272Send the prefix key (C-b) through to the application. 273.It C-o 274Rotate the panes in the current window forwards. 275.It C-z 276Suspend the 277.Nm 278client. 279.It ! 280Break the current pane out of the window. 281.It \&" 282.\" " 283Split the current pane into two, top and bottom. 284.It # 285List all paste buffers. 286.It $ 287Rename the current session. 288.It % 289Split the current pane into two, left and right. 290.It & 291Kill the current window. 292.It ' 293Prompt for a window index to select. 294.It \&( 295Switch the attached client to the previous session. 296.It \&) 297Switch the attached client to the next session. 298.It , 299Rename the current window. 300.It - 301Delete the most recently copied buffer of text. 302.It . 303Prompt for an index to move the current window. 304.It 0 to 9 305Select windows 0 to 9. 306.It : 307Enter the 308.Nm 309command prompt. 310.It ; 311Move to the previously active pane. 312.It = 313Choose which buffer to paste interactively from a list. 314.It \&? 315List all key bindings. 316.It D 317Choose a client to detach. 318.It L 319Switch the attached client back to the last session. 320.It \&[ 321Enter copy mode to copy text or view the history. 322.It \&] 323Paste the most recently copied buffer of text. 324.It c 325Create a new window. 326.It d 327Detach the current client. 328.It f 329Prompt to search for text in open windows. 330.It i 331Display some information about the current window. 332.It l 333Move to the previously selected window. 334.It m 335Mark the current pane (see 336.Ic select-pane 337.Fl m ) . 338.It M 339Clear the marked pane. 340.It n 341Change to the next window. 342.It o 343Select the next pane in the current window. 344.It p 345Change to the previous window. 346.It q 347Briefly display pane indexes. 348.It r 349Force redraw of the attached client. 350.It s 351Select a new session for the attached client interactively. 352.It t 353Show the time. 354.It w 355Choose the current window interactively. 356.It x 357Kill the current pane. 358.It z 359Toggle zoom state of the current pane. 360.It { 361Swap the current pane with the previous pane. 362.It } 363Swap the current pane with the next pane. 364.It ~ 365Show previous messages from 366.Nm , 367if any. 368.It Page Up 369Enter copy mode and scroll one page up. 370.It Up, Down 371.It Left, Right 372Change to the pane above, below, to the left, or to the right of the current 373pane. 374.It M-1 to M-5 375Arrange panes in one of the five preset layouts: even-horizontal, 376even-vertical, main-horizontal, main-vertical, or tiled. 377.It Space 378Arrange the current window in the next preset layout. 379.It M-n 380Move to the next window with a bell or activity marker. 381.It M-o 382Rotate the panes in the current window backwards. 383.It M-p 384Move to the previous window with a bell or activity marker. 385.It C-Up, C-Down 386.It C-Left, C-Right 387Resize the current pane in steps of one cell. 388.It M-Up, M-Down 389.It M-Left, M-Right 390Resize the current pane in steps of five cells. 391.El 392.Pp 393Key bindings may be changed with the 394.Ic bind-key 395and 396.Ic unbind-key 397commands. 398.Sh COMMAND PARSING AND EXECUTION 399.Nm 400supports a large number of commands which can be used to control its 401behaviour. 402Each command is named and can accept zero or more flags and arguments. 403They may be bound to a key with the 404.Ic bind-key 405command or run from the shell prompt, a shell script, a configuration file or 406the command prompt. 407For example, the same 408.Ic set-option 409command run from the shell prompt, from 410.Pa ~/.tmux.conf 411and bound to a key may look like: 412.Bd -literal -offset indent 413$ tmux set-option -g status-style bg=cyan 414 415set-option -g status-style bg=cyan 416 417bind-key C set-option -g status-style bg=cyan 418.Ed 419.Pp 420Here, the command name is 421.Ql set-option , 422.Ql Fl g 423is a flag and 424.Ql status-style 425and 426.Ql bg=cyan 427are arguments. 428.Pp 429.Nm 430distinguishes between command parsing and execution. 431In order to execute a command, 432.Nm 433needs it to be split up into its name and arguments. 434This is command parsing. 435If a command is run from the shell, the shell parses it; from inside 436.Nm 437or from a configuration file, 438.Nm 439does. 440Examples of when 441.Nm 442parses commands are: 443.Bl -dash -offset indent 444.It 445in a configuration file; 446.It 447typed at the command prompt (see 448.Ic command-prompt ) ; 449.It 450given to 451.Ic bind-key ; 452.It 453passed as arguments to 454.Ic if-shell 455or 456.Ic confirm-before . 457.El 458.Pp 459To execute commands, each client has a 460.Ql command queue . 461A global command queue not attached to any client is used on startup 462for configuration files like 463.Pa ~/.tmux.conf . 464Parsed commands added to the queue are executed in order. 465Some commands, like 466.Ic if-shell 467and 468.Ic confirm-before , 469parse their argument to create a new command which is inserted immediately 470after themselves. 471This means that arguments can be parsed twice or more - once when the parent command (such as 472.Ic if-shell ) 473is parsed and again when it parses and executes its command. 474Commands like 475.Ic if-shell , 476.Ic run-shell 477and 478.Ic display-panes 479stop execution of subsequent commands on the queue until something happens - 480.Ic if-shell 481and 482.Ic run-shell 483until a shell command finishes and 484.Ic display-panes 485until a key is pressed. 486For example, the following commands: 487.Bd -literal -offset indent 488new-session; new-window 489if-shell "true" "split-window" 490kill-session 491.Ed 492.Pp 493Will execute 494.Ic new-session , 495.Ic new-window , 496.Ic if-shell , 497the shell command 498.Xr true 1 , 499.Ic split-window 500and 501.Ic kill-session 502in that order. 503.Pp 504The 505.Sx COMMANDS 506section lists the 507.Nm 508commands and their arguments. 509.Sh PARSING SYNTAX 510This section describes the syntax of commands parsed by 511.Nm , 512for example in a configuration file or at the command prompt. 513Note that when commands are entered into the shell, they are parsed by the shell 514- see for example 515.Xr ksh 1 516or 517.Xr csh 1 . 518.Pp 519Each command is terminated by a newline or a semicolon (;). 520Commands separated by semicolons together form a 521.Ql command sequence 522- if a command in the sequence encounters an error, no subsequent commands are 523executed. 524.Pp 525It is recommended that a semicolon used as a command separator should be 526written as an individual token, for example from 527.Xr sh 1 : 528.Bd -literal -offset indent 529$ tmux neww \\; splitw 530.Ed 531.Pp 532Or: 533.Bd -literal -offset indent 534$ tmux neww ';' splitw 535.Ed 536.Pp 537Or from the tmux command prompt: 538.Bd -literal -offset indent 539neww ; splitw 540.Ed 541.Pp 542However, a trailing semicolon is also interpreted as a command separator, 543for example in these 544.Xr sh 1 545commands: 546.Bd -literal -offset indent 547$ tmux neww\e\e; splitw 548.Ed 549.Pp 550Or: 551.Bd -literal -offset indent 552$ tmux 'neww;' splitw 553.Ed 554.Pp 555As in these examples, when running tmux from the shell extra care must be taken 556to properly quote semicolons: 557.Bl -enum -offset Ds 558.It 559Semicolons that should be interpreted as a command separator 560should be escaped according to the shell conventions. 561For 562.Xr sh 1 563this typically means quoted (such as 564.Ql neww ';' splitw ) 565or escaped (such as 566.Ql neww \e\e\e\e; splitw ) . 567.It 568Individual semicolons or trailing semicolons that should be interpreted as 569arguments should be escaped twice: once according to the shell conventions and 570a second time for 571.Nm ; 572for example: 573.Bd -literal -offset indent 574$ tmux neww 'foo\e\e;' bar 575$ tmux neww foo\e\e\e\e; bar 576.Ed 577.It 578Semicolons that are not individual tokens or trailing another token should only 579be escaped once according to shell conventions; for example: 580.Bd -literal -offset indent 581$ tmux neww 'foo-;-bar' 582$ tmux neww foo-\e\e;-bar 583.Ed 584.El 585.Pp 586Comments are marked by the unquoted # character - any remaining text after a 587comment is ignored until the end of the line. 588.Pp 589If the last character of a line is \e, the line is joined with the following 590line (the \e and the newline are completely removed). 591This is called line continuation and applies both inside and outside quoted 592strings and in comments, but not inside braces. 593.Pp 594Command arguments may be specified as strings surrounded by single (') quotes, 595double quotes (") or braces ({}). 596.\" " 597This is required when the argument contains any special character. 598Single and double quoted strings cannot span multiple lines except with line 599continuation. 600Braces can span multiple lines. 601.Pp 602Outside of quotes and inside double quotes, these replacements are performed: 603.Bl -dash -offset indent 604.It 605Environment variables preceded by $ are replaced with their value from the 606global environment (see the 607.Sx GLOBAL AND SESSION ENVIRONMENT 608section). 609.It 610A leading ~ or ~user is expanded to the home directory of the current or 611specified user. 612.It 613\euXXXX or \euXXXXXXXX is replaced by the Unicode codepoint corresponding to 614the given four or eight digit hexadecimal number. 615.It 616When preceded (escaped) by a \e, the following characters are replaced: \ee by 617the escape character; \er by a carriage return; \en by a newline; and \et by a 618tab. 619.It 620\eooo is replaced by a character of the octal value ooo. 621Three octal digits are required, for example \e001. 622The largest valid character is \e377. 623.It 624Any other characters preceded by \e are replaced by themselves (that is, the \e 625is removed) and are not treated as having any special meaning - so for example 626\e; will not mark a command sequence and \e$ will not expand an environment 627variable. 628.El 629.Pp 630Braces are parsed as a configuration file (so conditions such as 631.Ql %if 632are processed) and then converted into a string. 633They are designed to avoid the need for additional escaping when passing a 634group of 635.Nm 636commands as an argument (for example to 637.Ic if-shell ) . 638These two examples produce an identical command - note that no escaping is 639needed when using {}: 640.Bd -literal -offset indent 641if-shell true { 642 display -p 'brace-dollar-foo: }$foo' 643} 644 645if-shell true "display -p 'brace-dollar-foo: }\e$foo'" 646.Ed 647.Pp 648Braces may be enclosed inside braces, for example: 649.Bd -literal -offset indent 650bind x if-shell "true" { 651 if-shell "true" { 652 display "true!" 653 } 654} 655.Ed 656.Pp 657Environment variables may be set by using the syntax 658.Ql name=value , 659for example 660.Ql HOME=/home/user . 661Variables set during parsing are added to the global environment. 662A hidden variable may be set with 663.Ql %hidden , 664for example: 665.Bd -literal -offset indent 666%hidden MYVAR=42 667.Ed 668.Pp 669Hidden variables are not passed to the environment of processes created 670by tmux. 671See the 672.Sx GLOBAL AND SESSION ENVIRONMENT 673section. 674.Pp 675Commands may be parsed conditionally by surrounding them with 676.Ql %if , 677.Ql %elif , 678.Ql %else 679and 680.Ql %endif . 681The argument to 682.Ql %if 683and 684.Ql %elif 685is expanded as a format (see 686.Sx FORMATS ) 687and if it evaluates to false (zero or empty), subsequent text is ignored until 688the closing 689.Ql %elif , 690.Ql %else 691or 692.Ql %endif . 693For example: 694.Bd -literal -offset indent 695%if "#{==:#{host},myhost}" 696set -g status-style bg=red 697%elif "#{==:#{host},myotherhost}" 698set -g status-style bg=green 699%else 700set -g status-style bg=blue 701%endif 702.Ed 703.Pp 704Will change the status line to red if running on 705.Ql myhost , 706green if running on 707.Ql myotherhost , 708or blue if running on another host. 709Conditionals may be given on one line, for example: 710.Bd -literal -offset indent 711%if #{==:#{host},myhost} set -g status-style bg=red %endif 712.Ed 713.Sh COMMANDS 714This section describes the commands supported by 715.Nm . 716Most commands accept the optional 717.Fl t 718(and sometimes 719.Fl s ) 720argument with one of 721.Ar target-client , 722.Ar target-session , 723.Ar target-window , 724or 725.Ar target-pane . 726These specify the client, session, window or pane which a command should affect. 727.Pp 728.Ar target-client 729should be the name of the client, 730typically the 731.Xr pty 4 732file to which the client is connected, for example either of 733.Pa /dev/ttyp1 734or 735.Pa ttyp1 736for the client attached to 737.Pa /dev/ttyp1 . 738If no client is specified, 739.Nm 740attempts to work out the client currently in use; if that fails, an error is 741reported. 742Clients may be listed with the 743.Ic list-clients 744command. 745.Pp 746.Ar target-session 747is tried as, in order: 748.Bl -enum -offset Ds 749.It 750A session ID prefixed with a $. 751.It 752An exact name of a session (as listed by the 753.Ic list-sessions 754command). 755.It 756The start of a session name, for example 757.Ql mysess 758would match a session named 759.Ql mysession . 760.It 761An 762.Xr fnmatch 3 763pattern which is matched against the session name. 764.El 765.Pp 766If the session name is prefixed with an 767.Ql = , 768only an exact match is accepted (so 769.Ql =mysess 770will only match exactly 771.Ql mysess , 772not 773.Ql mysession ) . 774.Pp 775If a single session is found, it is used as the target session; multiple matches 776produce an error. 777If a session is omitted, the current session is used if available; if no 778current session is available, the most recently used is chosen. 779.Pp 780.Ar target-window 781(or 782.Ar src-window 783or 784.Ar dst-window ) 785specifies a window in the form 786.Em session Ns \&: Ns Em window . 787.Em session 788follows the same rules as for 789.Ar target-session , 790and 791.Em window 792is looked for in order as: 793.Bl -enum -offset Ds 794.It 795A special token, listed below. 796.It 797A window index, for example 798.Ql mysession:1 799is window 1 in session 800.Ql mysession . 801.It 802A window ID, such as @1. 803.It 804An exact window name, such as 805.Ql mysession:mywindow . 806.It 807The start of a window name, such as 808.Ql mysession:mywin . 809.It 810As an 811.Xr fnmatch 3 812pattern matched against the window name. 813.El 814.Pp 815Like sessions, a 816.Ql = 817prefix will do an exact match only. 818An empty window name specifies the next unused index if appropriate (for 819example the 820.Ic new-window 821and 822.Ic link-window 823commands) 824otherwise the current window in 825.Em session 826is chosen. 827.Pp 828The following special tokens are available to indicate particular windows. 829Each has a single-character alternative form. 830.Bl -column "XXXXXXXXXX" "X" 831.It Sy "Token" Ta Sy "" Ta Sy "Meaning" 832.It Li "{start}" Ta "^" Ta "The lowest-numbered window" 833.It Li "{end}" Ta "$" Ta "The highest-numbered window" 834.It Li "{last}" Ta "!" Ta "The last (previously current) window" 835.It Li "{next}" Ta "+" Ta "The next window by number" 836.It Li "{previous}" Ta "-" Ta "The previous window by number" 837.El 838.Pp 839.Ar target-pane 840(or 841.Ar src-pane 842or 843.Ar dst-pane ) 844may be a pane ID or takes a similar form to 845.Ar target-window 846but with the optional addition of a period followed by a pane index or pane ID, 847for example: 848.Ql mysession:mywindow.1 . 849If the pane index is omitted, the currently active pane in the specified 850window is used. 851The following special tokens are available for the pane index: 852.Bl -column "XXXXXXXXXXXXXX" "X" 853.It Sy "Token" Ta Sy "" Ta Sy "Meaning" 854.It Li "{last}" Ta "!" Ta "The last (previously active) pane" 855.It Li "{next}" Ta "+" Ta "The next pane by number" 856.It Li "{previous}" Ta "-" Ta "The previous pane by number" 857.It Li "{top}" Ta "" Ta "The top pane" 858.It Li "{bottom}" Ta "" Ta "The bottom pane" 859.It Li "{left}" Ta "" Ta "The leftmost pane" 860.It Li "{right}" Ta "" Ta "The rightmost pane" 861.It Li "{top-left}" Ta "" Ta "The top-left pane" 862.It Li "{top-right}" Ta "" Ta "The top-right pane" 863.It Li "{bottom-left}" Ta "" Ta "The bottom-left pane" 864.It Li "{bottom-right}" Ta "" Ta "The bottom-right pane" 865.It Li "{up-of}" Ta "" Ta "The pane above the active pane" 866.It Li "{down-of}" Ta "" Ta "The pane below the active pane" 867.It Li "{left-of}" Ta "" Ta "The pane to the left of the active pane" 868.It Li "{right-of}" Ta "" Ta "The pane to the right of the active pane" 869.El 870.Pp 871The tokens 872.Ql + 873and 874.Ql - 875may be followed by an offset, for example: 876.Bd -literal -offset indent 877select-window -t:+2 878.Ed 879.Pp 880In addition, 881.Em target-session , 882.Em target-window 883or 884.Em target-pane 885may consist entirely of the token 886.Ql {mouse} 887(alternative form 888.Ql = ) 889to specify the session, window or pane where the most recent mouse event occurred 890(see the 891.Sx MOUSE SUPPORT 892section) 893or 894.Ql {marked} 895(alternative form 896.Ql ~ ) 897to specify the marked pane (see 898.Ic select-pane 899.Fl m ) . 900.Pp 901Sessions, window and panes are each numbered with a unique ID; session IDs are 902prefixed with a 903.Ql $ , 904windows with a 905.Ql @ , 906and panes with a 907.Ql % . 908These are unique and are unchanged for the life of the session, window or pane 909in the 910.Nm 911server. 912The pane ID is passed to the child process of the pane in the 913.Ev TMUX_PANE 914environment variable. 915IDs may be displayed using the 916.Ql session_id , 917.Ql window_id , 918or 919.Ql pane_id 920formats (see the 921.Sx FORMATS 922section) and the 923.Ic display-message , 924.Ic list-sessions , 925.Ic list-windows 926or 927.Ic list-panes 928commands. 929.Pp 930.Ar shell-command 931arguments are 932.Xr sh 1 933commands. 934This may be a single argument passed to the shell, for example: 935.Bd -literal -offset indent 936new-window 'vi ~/.tmux.conf' 937.Ed 938.Pp 939Will run: 940.Bd -literal -offset indent 941/bin/sh -c 'vi ~/.tmux.conf' 942.Ed 943.Pp 944Additionally, the 945.Ic new-window , 946.Ic new-session , 947.Ic split-window , 948.Ic respawn-window 949and 950.Ic respawn-pane 951commands allow 952.Ar shell-command 953to be given as multiple arguments and executed directly (without 954.Ql sh -c ) . 955This can avoid issues with shell quoting. 956For example: 957.Bd -literal -offset indent 958$ tmux new-window vi ~/.tmux.conf 959.Ed 960.Pp 961Will run 962.Xr vi 1 963directly without invoking the shell. 964.Pp 965.Ar command 966.Op Ar arguments 967refers to a 968.Nm 969command, either passed with the command and arguments separately, for example: 970.Bd -literal -offset indent 971bind-key F1 set-option status off 972.Ed 973.Pp 974Or passed as a single string argument in 975.Pa .tmux.conf , 976for example: 977.Bd -literal -offset indent 978bind-key F1 { set-option status off } 979.Ed 980.Pp 981Example 982.Nm 983commands include: 984.Bd -literal -offset indent 985refresh-client -t/dev/ttyp2 986 987rename-session -tfirst newname 988 989set-option -wt:0 monitor-activity on 990 991new-window ; split-window -d 992 993bind-key R source-file ~/.tmux.conf \e; \e 994 display-message "source-file done" 995.Ed 996.Pp 997Or from 998.Xr sh 1 : 999.Bd -literal -offset indent 1000$ tmux kill-window -t :1 1001 1002$ tmux new-window \e; split-window -d 1003 1004$ tmux new-session -d 'vi ~/.tmux.conf' \e; split-window -d \e; attach 1005.Ed 1006.Sh CLIENTS AND SESSIONS 1007The 1008.Nm 1009server manages clients, sessions, windows and panes. 1010Clients are attached to sessions to interact with them, either 1011when they are created with the 1012.Ic new-session 1013command, or later with the 1014.Ic attach-session 1015command. 1016Each session has one or more windows 1017.Em linked 1018into it. 1019Windows may be linked to multiple sessions and are made up of one or 1020more panes, 1021each of which contains a pseudo terminal. 1022Commands for creating, linking and otherwise manipulating windows 1023are covered 1024in the 1025.Sx WINDOWS AND PANES 1026section. 1027.Pp 1028The following commands are available to manage clients and sessions: 1029.Bl -tag -width Ds 1030.It Xo Ic attach-session 1031.Op Fl dErx 1032.Op Fl c Ar working-directory 1033.Op Fl f Ar flags 1034.Op Fl t Ar target-session 1035.Xc 1036.D1 (alias: Ic attach ) 1037If run from outside 1038.Nm , 1039create a new client in the current terminal and attach it to 1040.Ar target-session . 1041If used from inside, switch the current client. 1042If 1043.Fl d 1044is specified, any other clients attached to the session are detached. 1045If 1046.Fl x 1047is given, send 1048.Dv SIGHUP 1049to the parent process of the client as well as 1050detaching the client, typically causing it to exit. 1051.Fl f 1052sets a comma-separated list of client flags. 1053The flags are: 1054.Bl -tag -width Ds 1055.It active-pane 1056the client has an independent active pane 1057.It ignore-size 1058the client does not affect the size of other clients 1059.It no-output 1060the client does not receive pane output in control mode 1061.It pause-after=seconds 1062output is paused once the pane is 1063.Ar seconds 1064behind in control mode 1065.It read-only 1066the client is read-only 1067.It wait-exit 1068wait for an empty line input before exiting in control mode 1069.El 1070.Pp 1071A leading 1072.Ql \&! 1073turns a flag off if the client is already attached. 1074.Fl r 1075is an alias for 1076.Fl f 1077.Ar read-only,ignore-size . 1078When a client is read-only, only keys bound to the 1079.Ic detach-client 1080or 1081.Ic switch-client 1082commands have any effect. 1083A client with the 1084.Ar active-pane 1085flag allows the active pane to be selected independently of the window's active 1086pane used by clients without the flag. 1087This only affects the cursor position and commands issued from the client; 1088other features such as hooks and styles continue to use the window's active 1089pane. 1090.Pp 1091If no server is started, 1092.Ic attach-session 1093will attempt to start it; this will fail unless sessions are created in the 1094configuration file. 1095.Pp 1096The 1097.Ar target-session 1098rules for 1099.Ic attach-session 1100are slightly adjusted: if 1101.Nm 1102needs to select the most recently used session, it will prefer the most 1103recently used 1104.Em unattached 1105session. 1106.Pp 1107.Fl c 1108will set the session working directory (used for new windows) to 1109.Ar working-directory . 1110.Pp 1111If 1112.Fl E 1113is used, the 1114.Ic update-environment 1115option will not be applied. 1116.It Xo Ic detach-client 1117.Op Fl aP 1118.Op Fl E Ar shell-command 1119.Op Fl s Ar target-session 1120.Op Fl t Ar target-client 1121.Xc 1122.D1 (alias: Ic detach ) 1123Detach the current client if bound to a key, the client specified with 1124.Fl t , 1125or all clients currently attached to the session specified by 1126.Fl s . 1127The 1128.Fl a 1129option kills all but the client given with 1130.Fl t . 1131If 1132.Fl P 1133is given, send 1134.Dv SIGHUP 1135to the parent process of the client, typically causing it 1136to exit. 1137With 1138.Fl E , 1139run 1140.Ar shell-command 1141to replace the client. 1142.It Ic has-session Op Fl t Ar target-session 1143.D1 (alias: Ic has ) 1144Report an error and exit with 1 if the specified session does not exist. 1145If it does exist, exit with 0. 1146.It Ic kill-server 1147Kill the 1148.Nm 1149server and clients and destroy all sessions. 1150.It Xo Ic kill-session 1151.Op Fl aC 1152.Op Fl t Ar target-session 1153.Xc 1154Destroy the given session, closing any windows linked to it and no other 1155sessions, and detaching all clients attached to it. 1156If 1157.Fl a 1158is given, all sessions but the specified one is killed. 1159The 1160.Fl C 1161flag clears alerts (bell, activity, or silence) in all windows linked to the 1162session. 1163.It Xo Ic list-clients 1164.Op Fl F Ar format 1165.Op Fl t Ar target-session 1166.Xc 1167.D1 (alias: Ic lsc ) 1168List all clients attached to the server. 1169For the meaning of the 1170.Fl F 1171flag, see the 1172.Sx FORMATS 1173section. 1174If 1175.Ar target-session 1176is specified, list only clients connected to that session. 1177.It Xo Ic list-commands 1178.Op Fl F Ar format 1179.Op Ar command 1180.Xc 1181.D1 (alias: Ic lscm ) 1182List the syntax of 1183.Ar command 1184or - if omitted - of all commands supported by 1185.Nm . 1186.It Xo Ic list-sessions 1187.Op Fl F Ar format 1188.Op Fl f Ar filter 1189.Xc 1190.D1 (alias: Ic ls ) 1191List all sessions managed by the server. 1192.Fl F 1193specifies the format of each line and 1194.Fl f 1195a filter. 1196Only sessions for which the filter is true are shown. 1197See the 1198.Sx FORMATS 1199section. 1200.It Ic lock-client Op Fl t Ar target-client 1201.D1 (alias: Ic lockc ) 1202Lock 1203.Ar target-client , 1204see the 1205.Ic lock-server 1206command. 1207.It Ic lock-session Op Fl t Ar target-session 1208.D1 (alias: Ic locks ) 1209Lock all clients attached to 1210.Ar target-session . 1211.It Xo Ic new-session 1212.Op Fl AdDEPX 1213.Op Fl c Ar start-directory 1214.Op Fl e Ar environment 1215.Op Fl f Ar flags 1216.Op Fl F Ar format 1217.Op Fl n Ar window-name 1218.Op Fl s Ar session-name 1219.Op Fl t Ar group-name 1220.Op Fl x Ar width 1221.Op Fl y Ar height 1222.Op Ar shell-command 1223.Xc 1224.D1 (alias: Ic new ) 1225Create a new session with name 1226.Ar session-name . 1227.Pp 1228The new session is attached to the current terminal unless 1229.Fl d 1230is given. 1231.Ar window-name 1232and 1233.Ar shell-command 1234are the name of and shell command to execute in the initial window. 1235With 1236.Fl d , 1237the initial size comes from the global 1238.Ic default-size 1239option; 1240.Fl x 1241and 1242.Fl y 1243can be used to specify a different size. 1244.Ql - 1245uses the size of the current client if any. 1246If 1247.Fl x 1248or 1249.Fl y 1250is given, the 1251.Ic default-size 1252option is set for the session. 1253.Fl f 1254sets a comma-separated list of client flags (see 1255.Ic attach-session ) . 1256.Pp 1257If run from a terminal, any 1258.Xr termios 4 1259special characters are saved and used for new windows in the new session. 1260.Pp 1261The 1262.Fl A 1263flag makes 1264.Ic new-session 1265behave like 1266.Ic attach-session 1267if 1268.Ar session-name 1269already exists; in this case, 1270.Fl D 1271behaves like 1272.Fl d 1273to 1274.Ic attach-session , 1275and 1276.Fl X 1277behaves like 1278.Fl x 1279to 1280.Ic attach-session . 1281.Pp 1282If 1283.Fl t 1284is given, it specifies a 1285.Ic session group . 1286Sessions in the same group share the same set of windows - new windows are 1287linked to all sessions in the group and any windows closed removed from all 1288sessions. 1289The current and previous window and any session options remain independent and 1290any session in a group may be killed without affecting the others. 1291The 1292.Ar group-name 1293argument may be: 1294.Bl -enum -width Ds 1295.It 1296the name of an existing group, in which case the new session is added to that 1297group; 1298.It 1299the name of an existing session - the new session is added to the same group 1300as that session, creating a new group if necessary; 1301.It 1302the name for a new group containing only the new session. 1303.El 1304.Pp 1305.Fl n 1306and 1307.Ar shell-command 1308are invalid if 1309.Fl t 1310is used. 1311.Pp 1312The 1313.Fl P 1314option prints information about the new session after it has been created. 1315By default, it uses the format 1316.Ql #{session_name}:\& 1317but a different format may be specified with 1318.Fl F . 1319.Pp 1320If 1321.Fl E 1322is used, the 1323.Ic update-environment 1324option will not be applied. 1325.Fl e 1326takes the form 1327.Ql VARIABLE=value 1328and sets an environment variable for the newly created session; it may be 1329specified multiple times. 1330.It Xo Ic refresh-client 1331.Op Fl cDlLRSU 1332.Op Fl A Ar pane:state 1333.Op Fl B Ar name:what:format 1334.Op Fl C Ar XxY 1335.Op Fl f Ar flags 1336.Op Fl t Ar target-client 1337.Op Ar adjustment 1338.Xc 1339.D1 (alias: Ic refresh ) 1340Refresh the current client if bound to a key, or a single client if one is given 1341with 1342.Fl t . 1343If 1344.Fl S 1345is specified, only update the client's status line. 1346.Pp 1347The 1348.Fl U , 1349.Fl D , 1350.Fl L 1351.Fl R , 1352and 1353.Fl c 1354flags allow the visible portion of a window which is larger than the client 1355to be changed. 1356.Fl U 1357moves the visible part up by 1358.Ar adjustment 1359rows and 1360.Fl D 1361down, 1362.Fl L 1363left by 1364.Ar adjustment 1365columns and 1366.Fl R 1367right. 1368.Fl c 1369returns to tracking the cursor automatically. 1370If 1371.Ar adjustment 1372is omitted, 1 is used. 1373Note that the visible position is a property of the client not of the 1374window, changing the current window in the attached session will reset 1375it. 1376.Pp 1377.Fl C 1378sets the width and height of a control mode client. 1379.Fl A 1380allows a control mode client to trigger actions on a pane. 1381The argument is a pane ID (with leading 1382.Ql % ) , 1383a colon, then one of 1384.Ql on , 1385.Ql off , 1386.Ql continue 1387or 1388.Ql pause . 1389If 1390.Ql off , 1391.Nm 1392will not send output from the pane to the client and if all clients have turned 1393the pane off, will stop reading from the pane. 1394If 1395.Ql continue , 1396.Nm 1397will return to sending output to the pane if it was paused (manually or with the 1398.Ar pause-after 1399flag). 1400If 1401.Ql pause , 1402.Nm 1403will pause the pane. 1404.Fl A 1405may be given multiple times for different panes. 1406.Pp 1407.Fl B 1408sets a subscription to a format for a control mode client. 1409The argument is split into three items by colons: 1410.Ar name 1411is a name for the subscription; 1412.Ar what 1413is a type of item to subscribe to; 1414.Ar format 1415is the format. 1416After a subscription is added, changes to the format are reported with the 1417.Ic %subscription-changed 1418notification, at most once a second. 1419If only the name is given, the subscription is removed. 1420.Ar what 1421may be empty to check the format only for the attached session, or one of: 1422a pane ID such as 1423.Ql %0 ; 1424.Ql %* 1425for all panes in the attached session; 1426a window ID such as 1427.Ql @0 ; 1428or 1429.Ql @* 1430for all windows in the attached session. 1431.Pp 1432.Fl f 1433sets a comma-separated list of client flags, see 1434.Ic attach-session . 1435.Pp 1436.Fl l 1437requests the clipboard from the client using the 1438.Xr xterm 1 1439escape sequence and stores it in a new paste buffer. 1440.Pp 1441.Fl L , 1442.Fl R , 1443.Fl U 1444and 1445.Fl D 1446move the visible portion of the window left, right, up or down 1447by 1448.Ar adjustment , 1449if the window is larger than the client. 1450.Fl c 1451resets so that the position follows the cursor. 1452See the 1453.Ic window-size 1454option. 1455.It Xo Ic rename-session 1456.Op Fl t Ar target-session 1457.Ar new-name 1458.Xc 1459.D1 (alias: Ic rename ) 1460Rename the session to 1461.Ar new-name . 1462.It Xo Ic show-messages 1463.Op Fl JT 1464.Op Fl t Ar target-client 1465.Xc 1466.D1 (alias: Ic showmsgs ) 1467Show server messages or information. 1468Messages are stored, up to a maximum of the limit set by the 1469.Ar message-limit 1470server option. 1471.Fl J 1472and 1473.Fl T 1474show debugging information about jobs and terminals. 1475.It Xo Ic source-file 1476.Op Fl Fnqv 1477.Ar path 1478.Ar ... 1479.Xc 1480.D1 (alias: Ic source ) 1481Execute commands from one or more files specified by 1482.Ar path 1483(which may be 1484.Xr glob 7 1485patterns). 1486If 1487.Fl F 1488is present, then 1489.Ar path 1490is expanded as a format. 1491If 1492.Fl q 1493is given, no error will be returned if 1494.Ar path 1495does not exist. 1496With 1497.Fl n , 1498the file is parsed but no commands are executed. 1499.Fl v 1500shows the parsed commands and line numbers if possible. 1501.It Ic start-server 1502.D1 (alias: Ic start ) 1503Start the 1504.Nm 1505server, if not already running, without creating any sessions. 1506.Pp 1507Note that as by default the 1508.Nm 1509server will exit with no sessions, this is only useful if a session is created in 1510.Pa ~/.tmux.conf , 1511.Ic exit-empty 1512is turned off, or another command is run as part of the same command sequence. 1513For example: 1514.Bd -literal -offset indent 1515$ tmux start \\; show -g 1516.Ed 1517.It Xo Ic suspend-client 1518.Op Fl t Ar target-client 1519.Xc 1520.D1 (alias: Ic suspendc ) 1521Suspend a client by sending 1522.Dv SIGTSTP 1523(tty stop). 1524.It Xo Ic switch-client 1525.Op Fl ElnprZ 1526.Op Fl c Ar target-client 1527.Op Fl t Ar target-session 1528.Op Fl T Ar key-table 1529.Xc 1530.D1 (alias: Ic switchc ) 1531Switch the current session for client 1532.Ar target-client 1533to 1534.Ar target-session . 1535As a special case, 1536.Fl t 1537may refer to a pane (a target that contains 1538.Ql \&: , 1539.Ql \&. 1540or 1541.Ql % ) , 1542to change session, window and pane. 1543In that case, 1544.Fl Z 1545keeps the window zoomed if it was zoomed. 1546If 1547.Fl l , 1548.Fl n 1549or 1550.Fl p 1551is used, the client is moved to the last, next or previous session 1552respectively. 1553.Fl r 1554toggles the client 1555.Ic read-only 1556and 1557.Ic ignore-size 1558flags (see the 1559.Ic attach-session 1560command). 1561.Pp 1562If 1563.Fl E 1564is used, 1565.Ic update-environment 1566option will not be applied. 1567.Pp 1568.Fl T 1569sets the client's key table; the next key from the client will be interpreted 1570from 1571.Ar key-table . 1572This may be used to configure multiple prefix keys, or to bind commands to 1573sequences of keys. 1574For example, to make typing 1575.Ql abc 1576run the 1577.Ic list-keys 1578command: 1579.Bd -literal -offset indent 1580bind-key -Ttable2 c list-keys 1581bind-key -Ttable1 b switch-client -Ttable2 1582bind-key -Troot a switch-client -Ttable1 1583.Ed 1584.El 1585.Sh WINDOWS AND PANES 1586Each window displayed by 1587.Nm 1588may be split into one or more 1589.Em panes ; 1590each pane takes up a certain area of the display and is a separate terminal. 1591A window may be split into panes using the 1592.Ic split-window 1593command. 1594Windows may be split horizontally (with the 1595.Fl h 1596flag) or vertically. 1597Panes may be resized with the 1598.Ic resize-pane 1599command (bound to 1600.Ql C-Up , 1601.Ql C-Down 1602.Ql C-Left 1603and 1604.Ql C-Right 1605by default), the current pane may be changed with the 1606.Ic select-pane 1607command and the 1608.Ic rotate-window 1609and 1610.Ic swap-pane 1611commands may be used to swap panes without changing their position. 1612Panes are numbered beginning from zero in the order they are created. 1613.Pp 1614By default, a 1615.Nm 1616pane permits direct access to the terminal contained in the pane. 1617A pane may also be put into one of several modes: 1618.Bl -dash -offset indent 1619.It 1620Copy mode, which permits a section of a window or its 1621history to be copied to a 1622.Em paste buffer 1623for later insertion into another window. 1624This mode is entered with the 1625.Ic copy-mode 1626command, bound to 1627.Ql \&[ 1628by default. 1629Copied text can be pasted with the 1630.Ic paste-buffer 1631command, bound to 1632.Ql \&] . 1633.It 1634View mode, which is like copy mode but is entered when a command that produces 1635output, such as 1636.Ic list-keys , 1637is executed from a key binding. 1638.It 1639Choose mode, which allows an item to be chosen from a list. 1640This may be a client, a session or window or pane, or a buffer. 1641This mode is entered with the 1642.Ic choose-buffer , 1643.Ic choose-client 1644and 1645.Ic choose-tree 1646commands. 1647.El 1648.Pp 1649In copy mode an indicator is displayed in the top-right corner of the pane with 1650the current position and the number of lines in the history. 1651.Pp 1652Commands are sent to copy mode using the 1653.Fl X 1654flag to the 1655.Ic send-keys 1656command. 1657When a key is pressed, copy mode automatically uses one of two key tables, 1658depending on the 1659.Ic mode-keys 1660option: 1661.Ic copy-mode 1662for emacs, or 1663.Ic copy-mode-vi 1664for vi. 1665Key tables may be viewed with the 1666.Ic list-keys 1667command. 1668.Pp 1669The following commands are supported in copy mode: 1670.Bl -column "CommandXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent 1671.It Sy "Command" Ta Sy "vi" Ta Sy "emacs" 1672.It Li "append-selection" Ta "" Ta "" 1673.It Li "append-selection-and-cancel" Ta "A" Ta "" 1674.It Li "back-to-indentation" Ta "^" Ta "M-m" 1675.It Li "begin-selection" Ta "Space" Ta "C-Space" 1676.It Li "bottom-line" Ta "L" Ta "" 1677.It Li "cancel" Ta "q" Ta "Escape" 1678.It Li "clear-selection" Ta "Escape" Ta "C-g" 1679.It Li "copy-end-of-line [<prefix>]" Ta "D" Ta "C-k" 1680.It Li "copy-line [<prefix>]" Ta "" Ta "" 1681.It Li "copy-pipe [<command>] [<prefix>]" Ta "" Ta "" 1682.It Li "copy-pipe-no-clear [<command>] [<prefix>]" Ta "" Ta "" 1683.It Li "copy-pipe-and-cancel [<command>] [<prefix>]" Ta "" Ta "" 1684.It Li "copy-selection [<prefix>]" Ta "" Ta "" 1685.It Li "copy-selection-no-clear [<prefix>]" Ta "" Ta "" 1686.It Li "copy-selection-and-cancel [<prefix>]" Ta "Enter" Ta "M-w" 1687.It Li "cursor-down" Ta "j" Ta "Down" 1688.It Li "cursor-down-and-cancel" Ta "" Ta "" 1689.It Li "cursor-left" Ta "h" Ta "Left" 1690.It Li "cursor-right" Ta "l" Ta "Right" 1691.It Li "cursor-up" Ta "k" Ta "Up" 1692.It Li "end-of-line" Ta "$" Ta "C-e" 1693.It Li "goto-line <line>" Ta ":" Ta "g" 1694.It Li "halfpage-down" Ta "C-d" Ta "M-Down" 1695.It Li "halfpage-down-and-cancel" Ta "" Ta "" 1696.It Li "halfpage-up" Ta "C-u" Ta "M-Up" 1697.It Li "history-bottom" Ta "G" Ta "M->" 1698.It Li "history-top" Ta "g" Ta "M-<" 1699.It Li "jump-again" Ta ";" Ta ";" 1700.It Li "jump-backward <to>" Ta "F" Ta "F" 1701.It Li "jump-forward <to>" Ta "f" Ta "f" 1702.It Li "jump-reverse" Ta "," Ta "," 1703.It Li "jump-to-backward <to>" Ta "T" Ta "" 1704.It Li "jump-to-forward <to>" Ta "t" Ta "" 1705.It Li "jump-to-mark" Ta "M-x" Ta "M-x" 1706.It Li "middle-line" Ta "M" Ta "M-r" 1707.It Li "next-matching-bracket" Ta "%" Ta "M-C-f" 1708.It Li "next-paragraph" Ta "}" Ta "M-}" 1709.It Li "next-space" Ta "W" Ta "" 1710.It Li "next-space-end" Ta "E" Ta "" 1711.It Li "next-word" Ta "w" Ta "" 1712.It Li "next-word-end" Ta "e" Ta "M-f" 1713.It Li "other-end" Ta "o" Ta "" 1714.It Li "page-down" Ta "C-f" Ta "PageDown" 1715.It Li "page-down-and-cancel" Ta "" Ta "" 1716.It Li "page-up" Ta "C-b" Ta "PageUp" 1717.It Li "pipe [<command>] [<prefix>]" Ta "" Ta "" 1718.It Li "pipe-no-clear [<command>] [<prefix>]" Ta "" Ta "" 1719.It Li "pipe-and-cancel [<command>] [<prefix>]" Ta "" Ta "" 1720.It Li "previous-matching-bracket" Ta "" Ta "M-C-b" 1721.It Li "previous-paragraph" Ta "{" Ta "M-{" 1722.It Li "previous-space" Ta "B" Ta "" 1723.It Li "previous-word" Ta "b" Ta "M-b" 1724.It Li "rectangle-on" Ta "" Ta "" 1725.It Li "rectangle-off" Ta "" Ta "" 1726.It Li "rectangle-toggle" Ta "v" Ta "R" 1727.It Li "refresh-from-pane" Ta "r" Ta "r" 1728.It Li "scroll-down" Ta "C-e" Ta "C-Down" 1729.It Li "scroll-down-and-cancel" Ta "" Ta "" 1730.It Li "scroll-up" Ta "C-y" Ta "C-Up" 1731.It Li "search-again" Ta "n" Ta "n" 1732.It Li "search-backward <for>" Ta "?" Ta "" 1733.It Li "search-backward-incremental <for>" Ta "" Ta "C-r" 1734.It Li "search-backward-text <for>" Ta "" Ta "" 1735.It Li "search-forward <for>" Ta "/" Ta "" 1736.It Li "search-forward-incremental <for>" Ta "" Ta "C-s" 1737.It Li "search-forward-text <for>" Ta "" Ta "" 1738.It Li "search-reverse" Ta "N" Ta "N" 1739.It Li "select-line" Ta "V" Ta "" 1740.It Li "select-word" Ta "" Ta "" 1741.It Li "set-mark" Ta "X" Ta "X" 1742.It Li "start-of-line" Ta "0" Ta "C-a" 1743.It Li "stop-selection" Ta "" Ta "" 1744.It Li "top-line" Ta "H" Ta "M-R" 1745.El 1746.Pp 1747The search commands come in several varieties: 1748.Ql search-forward 1749and 1750.Ql search-backward 1751search for a regular expression; 1752the 1753.Ql -text 1754variants search for a plain text string rather than a regular expression; 1755.Ql -incremental 1756perform an incremental search and expect to be used with the 1757.Fl i 1758flag to the 1759.Ic command-prompt 1760command. 1761.Ql search-again 1762repeats the last search and 1763.Ql search-reverse 1764does the same but reverses the direction (forward becomes backward and backward 1765becomes forward). 1766.Pp 1767Copy commands may take an optional buffer prefix argument which is used 1768to generate the buffer name (the default is 1769.Ql buffer 1770so buffers are named 1771.Ql buffer0 , 1772.Ql buffer1 1773and so on). 1774Pipe commands take a command argument which is the command to which the 1775selected text is piped. 1776.Ql copy-pipe 1777variants also copy the selection. 1778The 1779.Ql -and-cancel 1780variants of some commands exit copy mode after they have completed (for copy 1781commands) or when the cursor reaches the bottom (for scrolling commands). 1782.Ql -no-clear 1783variants do not clear the selection. 1784.Pp 1785The next and previous word keys use space and the 1786.Ql - , 1787.Ql _ 1788and 1789.Ql @ 1790characters as word delimiters by default, but this can be adjusted by 1791setting the 1792.Em word-separators 1793session option. 1794Next word moves to the start of the next word, next word end to the end of the 1795next word and previous word to the start of the previous word. 1796The three next and previous space keys work similarly but use a space alone as 1797the word separator. 1798.Pp 1799The jump commands enable quick movement within a line. 1800For instance, typing 1801.Ql f 1802followed by 1803.Ql / 1804will move the cursor to the next 1805.Ql / 1806character on the current line. 1807A 1808.Ql \&; 1809will then jump to the next occurrence. 1810.Pp 1811Commands in copy mode may be prefaced by an optional repeat count. 1812With vi key bindings, a prefix is entered using the number keys; with 1813emacs, the Alt (meta) key and a number begins prefix entry. 1814.Pp 1815The synopsis for the 1816.Ic copy-mode 1817command is: 1818.Bl -tag -width Ds 1819.It Xo Ic copy-mode 1820.Op Fl eHMqu 1821.Op Fl s Ar src-pane 1822.Op Fl t Ar target-pane 1823.Xc 1824Enter copy mode. 1825The 1826.Fl u 1827option scrolls one page up. 1828.Fl M 1829begins a mouse drag (only valid if bound to a mouse key binding, see 1830.Sx MOUSE SUPPORT ) . 1831.Fl H 1832hides the position indicator in the top right. 1833.Fl q 1834cancels copy mode and any other modes. 1835.Fl s 1836copies from 1837.Ar src-pane 1838instead of 1839.Ar target-pane . 1840.Pp 1841.Fl e 1842specifies that scrolling to the bottom of the history (to the visible screen) 1843should exit copy mode. 1844While in copy mode, pressing a key other than those used for scrolling will 1845disable this behaviour. 1846This is intended to allow fast scrolling through a pane's history, for 1847example with: 1848.Bd -literal -offset indent 1849bind PageUp copy-mode -eu 1850.Ed 1851.El 1852.Pp 1853A number of preset arrangements of panes are available, these are called layouts. 1854These may be selected with the 1855.Ic select-layout 1856command or cycled with 1857.Ic next-layout 1858(bound to 1859.Ql Space 1860by default); once a layout is chosen, panes within it may be moved and resized 1861as normal. 1862.Pp 1863The following layouts are supported: 1864.Bl -tag -width Ds 1865.It Ic even-horizontal 1866Panes are spread out evenly from left to right across the window. 1867.It Ic even-vertical 1868Panes are spread evenly from top to bottom. 1869.It Ic main-horizontal 1870A large (main) pane is shown at the top of the window and the remaining panes 1871are spread from left to right in the leftover space at the bottom. 1872Use the 1873.Em main-pane-height 1874window option to specify the height of the top pane. 1875.It Ic main-vertical 1876Similar to 1877.Ic main-horizontal 1878but the large pane is placed on the left and the others spread from top to 1879bottom along the right. 1880See the 1881.Em main-pane-width 1882window option. 1883.It Ic tiled 1884Panes are spread out as evenly as possible over the window in both rows and 1885columns. 1886.El 1887.Pp 1888In addition, 1889.Ic select-layout 1890may be used to apply a previously used layout - the 1891.Ic list-windows 1892command displays the layout of each window in a form suitable for use with 1893.Ic select-layout . 1894For example: 1895.Bd -literal -offset indent 1896$ tmux list-windows 18970: ksh [159x48] 1898 layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0} 1899$ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0} 1900.Ed 1901.Pp 1902.Nm 1903automatically adjusts the size of the layout for the current window size. 1904Note that a layout cannot be applied to a window with more panes than that 1905from which the layout was originally defined. 1906.Pp 1907Commands related to windows and panes are as follows: 1908.Bl -tag -width Ds 1909.It Xo Ic break-pane 1910.Op Fl abdP 1911.Op Fl F Ar format 1912.Op Fl n Ar window-name 1913.Op Fl s Ar src-pane 1914.Op Fl t Ar dst-window 1915.Xc 1916.D1 (alias: Ic breakp ) 1917Break 1918.Ar src-pane 1919off from its containing window to make it the only pane in 1920.Ar dst-window . 1921With 1922.Fl a 1923or 1924.Fl b , 1925the window is moved to the next index after or before (existing windows are 1926moved if necessary). 1927If 1928.Fl d 1929is given, the new window does not become the current window. 1930The 1931.Fl P 1932option prints information about the new window after it has been created. 1933By default, it uses the format 1934.Ql #{session_name}:#{window_index}.#{pane_index} 1935but a different format may be specified with 1936.Fl F . 1937.It Xo Ic capture-pane 1938.Op Fl aepPqCJN 1939.Op Fl b Ar buffer-name 1940.Op Fl E Ar end-line 1941.Op Fl S Ar start-line 1942.Op Fl t Ar target-pane 1943.Xc 1944.D1 (alias: Ic capturep ) 1945Capture the contents of a pane. 1946If 1947.Fl p 1948is given, the output goes to stdout, otherwise to the buffer specified with 1949.Fl b 1950or a new buffer if omitted. 1951If 1952.Fl a 1953is given, the alternate screen is used, and the history is not accessible. 1954If no alternate screen exists, an error will be returned unless 1955.Fl q 1956is given. 1957If 1958.Fl e 1959is given, the output includes escape sequences for text and background 1960attributes. 1961.Fl C 1962also escapes non-printable characters as octal \exxx. 1963.Fl N 1964preserves trailing spaces at each line's end and 1965.Fl J 1966preserves trailing spaces and joins any wrapped lines. 1967.Fl P 1968captures only any output that the pane has received that is the beginning of an 1969as-yet incomplete escape sequence. 1970.Pp 1971.Fl S 1972and 1973.Fl E 1974specify the starting and ending line numbers, zero is the first line of the 1975visible pane and negative numbers are lines in the history. 1976.Ql - 1977to 1978.Fl S 1979is the start of the history and to 1980.Fl E 1981the end of the visible pane. 1982The default is to capture only the visible contents of the pane. 1983.It Xo 1984.Ic choose-client 1985.Op Fl NrZ 1986.Op Fl F Ar format 1987.Op Fl f Ar filter 1988.Op Fl K Ar key-format 1989.Op Fl O Ar sort-order 1990.Op Fl t Ar target-pane 1991.Op Ar template 1992.Xc 1993Put a pane into client mode, allowing a client to be selected interactively from 1994a list. 1995Each client is shown on one line. 1996A shortcut key is shown on the left in brackets allowing for immediate choice, 1997or the list may be navigated and an item chosen or otherwise manipulated using 1998the keys below. 1999.Fl Z 2000zooms the pane. 2001The following keys may be used in client mode: 2002.Bl -column "Key" "Function" -offset indent 2003.It Sy "Key" Ta Sy "Function" 2004.It Li "Enter" Ta "Choose selected client" 2005.It Li "Up" Ta "Select previous client" 2006.It Li "Down" Ta "Select next client" 2007.It Li "C-s" Ta "Search by name" 2008.It Li "n" Ta "Repeat last search" 2009.It Li "t" Ta "Toggle if client is tagged" 2010.It Li "T" Ta "Tag no clients" 2011.It Li "C-t" Ta "Tag all clients" 2012.It Li "d" Ta "Detach selected client" 2013.It Li "D" Ta "Detach tagged clients" 2014.It Li "x" Ta "Detach and HUP selected client" 2015.It Li "X" Ta "Detach and HUP tagged clients" 2016.It Li "z" Ta "Suspend selected client" 2017.It Li "Z" Ta "Suspend tagged clients" 2018.It Li "f" Ta "Enter a format to filter items" 2019.It Li "O" Ta "Change sort field" 2020.It Li "r" Ta "Reverse sort order" 2021.It Li "v" Ta "Toggle preview" 2022.It Li "q" Ta "Exit mode" 2023.El 2024.Pp 2025After a client is chosen, 2026.Ql %% 2027is replaced by the client name in 2028.Ar template 2029and the result executed as a command. 2030If 2031.Ar template 2032is not given, "detach-client -t '%%'" is used. 2033.Pp 2034.Fl O 2035specifies the initial sort field: one of 2036.Ql name , 2037.Ql size , 2038.Ql creation , 2039or 2040.Ql activity . 2041.Fl r 2042reverses the sort order. 2043.Fl f 2044specifies an initial filter: the filter is a format - if it evaluates to zero, 2045the item in the list is not shown, otherwise it is shown. 2046If a filter would lead to an empty list, it is ignored. 2047.Fl F 2048specifies the format for each item in the list and 2049.Fl K 2050a format for each shortcut key; both are evaluated once for each line. 2051.Fl N 2052starts without the preview. 2053This command works only if at least one client is attached. 2054.It Xo 2055.Ic choose-tree 2056.Op Fl GNrswZ 2057.Op Fl F Ar format 2058.Op Fl f Ar filter 2059.Op Fl K Ar key-format 2060.Op Fl O Ar sort-order 2061.Op Fl t Ar target-pane 2062.Op Ar template 2063.Xc 2064Put a pane into tree mode, where a session, window or pane may be chosen 2065interactively from a tree. 2066Each session, window or pane is shown on one line. 2067A shortcut key is shown on the left in brackets allowing for immediate choice, 2068or the tree may be navigated and an item chosen or otherwise manipulated using 2069the keys below. 2070.Fl s 2071starts with sessions collapsed and 2072.Fl w 2073with windows collapsed. 2074.Fl Z 2075zooms the pane. 2076The following keys may be used in tree mode: 2077.Bl -column "Key" "Function" -offset indent 2078.It Sy "Key" Ta Sy "Function" 2079.It Li "Enter" Ta "Choose selected item" 2080.It Li "Up" Ta "Select previous item" 2081.It Li "Down" Ta "Select next item" 2082.It Li "+" Ta "Expand selected item" 2083.It Li "-" Ta "Collapse selected item" 2084.It Li "M-+" Ta "Expand all items" 2085.It Li "M--" Ta "Collapse all items" 2086.It Li "x" Ta "Kill selected item" 2087.It Li "X" Ta "Kill tagged items" 2088.It Li "<" Ta "Scroll list of previews left" 2089.It Li ">" Ta "Scroll list of previews right" 2090.It Li "C-s" Ta "Search by name" 2091.It Li "m" Ta "Set the marked pane" 2092.It Li "M" Ta "Clear the marked pane" 2093.It Li "n" Ta "Repeat last search" 2094.It Li "t" Ta "Toggle if item is tagged" 2095.It Li "T" Ta "Tag no items" 2096.It Li "C-t" Ta "Tag all items" 2097.It Li "\&:" Ta "Run a command for each tagged item" 2098.It Li "f" Ta "Enter a format to filter items" 2099.It Li "H" Ta "Jump to the starting pane" 2100.It Li "O" Ta "Change sort field" 2101.It Li "r" Ta "Reverse sort order" 2102.It Li "v" Ta "Toggle preview" 2103.It Li "q" Ta "Exit mode" 2104.El 2105.Pp 2106After a session, window or pane is chosen, 2107.Ql %% 2108is replaced by the target in 2109.Ar template 2110and the result executed as a command. 2111If 2112.Ar template 2113is not given, "switch-client -t '%%'" is used. 2114.Pp 2115.Fl O 2116specifies the initial sort field: one of 2117.Ql index , 2118.Ql name , 2119or 2120.Ql time . 2121.Fl r 2122reverses the sort order. 2123.Fl f 2124specifies an initial filter: the filter is a format - if it evaluates to zero, 2125the item in the list is not shown, otherwise it is shown. 2126If a filter would lead to an empty list, it is ignored. 2127.Fl F 2128specifies the format for each item in the tree and 2129.Fl K 2130a format for each shortcut key; both are evaluated once for each line. 2131.Fl N 2132starts without the preview. 2133.Fl G 2134includes all sessions in any session groups in the tree rather than only the 2135first. 2136This command works only if at least one client is attached. 2137.It Xo 2138.Ic customize-mode 2139.Op Fl NZ 2140.Op Fl F Ar format 2141.Op Fl f Ar filter 2142.Op Fl t Ar target-pane 2143.Op Ar template 2144.Xc 2145Put a pane into customize mode, where options and key bindings may be browsed 2146and modified from a list. 2147Option values in the list are shown for the active pane in the current window. 2148.Fl Z 2149zooms the pane. 2150The following keys may be used in customize mode: 2151.Bl -column "Key" "Function" -offset indent 2152.It Sy "Key" Ta Sy "Function" 2153.It Li "Enter" Ta "Set pane, window, session or global option value" 2154.It Li "Up" Ta "Select previous item" 2155.It Li "Down" Ta "Select next item" 2156.It Li "+" Ta "Expand selected item" 2157.It Li "-" Ta "Collapse selected item" 2158.It Li "M-+" Ta "Expand all items" 2159.It Li "M--" Ta "Collapse all items" 2160.It Li "s" Ta "Set option value or key attribute" 2161.It Li "S" Ta "Set global option value" 2162.It Li "w" Ta "Set window option value, if option is for pane and window" 2163.It Li "d" Ta "Set an option or key to the default" 2164.It Li "D" Ta "Set tagged options and tagged keys to the default" 2165.It Li "u" Ta "Unset an option (set to default value if global) or unbind a key" 2166.It Li "U" Ta "Unset tagged options and unbind tagged keys" 2167.It Li "C-s" Ta "Search by name" 2168.It Li "n" Ta "Repeat last search" 2169.It Li "t" Ta "Toggle if item is tagged" 2170.It Li "T" Ta "Tag no items" 2171.It Li "C-t" Ta "Tag all items" 2172.It Li "f" Ta "Enter a format to filter items" 2173.It Li "v" Ta "Toggle option information" 2174.It Li "q" Ta "Exit mode" 2175.El 2176.Pp 2177.Fl f 2178specifies an initial filter: the filter is a format - if it evaluates to zero, 2179the item in the list is not shown, otherwise it is shown. 2180If a filter would lead to an empty list, it is ignored. 2181.Fl F 2182specifies the format for each item in the tree. 2183.Fl N 2184starts without the option information. 2185This command works only if at least one client is attached. 2186.It Xo 2187.Ic display-panes 2188.Op Fl bN 2189.Op Fl d Ar duration 2190.Op Fl t Ar target-client 2191.Op Ar template 2192.Xc 2193.D1 (alias: Ic displayp ) 2194Display a visible indicator of each pane shown by 2195.Ar target-client . 2196See the 2197.Ic display-panes-colour 2198and 2199.Ic display-panes-active-colour 2200session options. 2201The indicator is closed when a key is pressed (unless 2202.Fl N 2203is given) or 2204.Ar duration 2205milliseconds have passed. 2206If 2207.Fl d 2208is not given, 2209.Ic display-panes-time 2210is used. 2211A duration of zero means the indicator stays until a key is pressed. 2212While the indicator is on screen, a pane may be chosen with the 2213.Ql 0 2214to 2215.Ql 9 2216keys, which will cause 2217.Ar template 2218to be executed as a command with 2219.Ql %% 2220substituted by the pane ID. 2221The default 2222.Ar template 2223is "select-pane -t '%%'". 2224With 2225.Fl b , 2226other commands are not blocked from running until the indicator is closed. 2227.It Xo Ic find-window 2228.Op Fl iCNrTZ 2229.Op Fl t Ar target-pane 2230.Ar match-string 2231.Xc 2232.D1 (alias: Ic findw ) 2233Search for a 2234.Xr fnmatch 3 2235pattern or, with 2236.Fl r , 2237regular expression 2238.Ar match-string 2239in window names, titles, and visible content (but not history). 2240The flags control matching behavior: 2241.Fl C 2242matches only visible window contents, 2243.Fl N 2244matches only the window name and 2245.Fl T 2246matches only the window title. 2247.Fl i 2248makes the search ignore case. 2249The default is 2250.Fl CNT . 2251.Fl Z 2252zooms the pane. 2253.Pp 2254This command works only if at least one client is attached. 2255.It Xo Ic join-pane 2256.Op Fl bdfhv 2257.Op Fl l Ar size 2258.Op Fl s Ar src-pane 2259.Op Fl t Ar dst-pane 2260.Xc 2261.D1 (alias: Ic joinp ) 2262Like 2263.Ic split-window , 2264but instead of splitting 2265.Ar dst-pane 2266and creating a new pane, split it and move 2267.Ar src-pane 2268into the space. 2269This can be used to reverse 2270.Ic break-pane . 2271The 2272.Fl b 2273option causes 2274.Ar src-pane 2275to be joined to left of or above 2276.Ar dst-pane . 2277.Pp 2278If 2279.Fl s 2280is omitted and a marked pane is present (see 2281.Ic select-pane 2282.Fl m ) , 2283the marked pane is used rather than the current pane. 2284.It Xo Ic kill-pane 2285.Op Fl a 2286.Op Fl t Ar target-pane 2287.Xc 2288.D1 (alias: Ic killp ) 2289Destroy the given pane. 2290If no panes remain in the containing window, it is also destroyed. 2291The 2292.Fl a 2293option kills all but the pane given with 2294.Fl t . 2295.It Xo Ic kill-window 2296.Op Fl a 2297.Op Fl t Ar target-window 2298.Xc 2299.D1 (alias: Ic killw ) 2300Kill the current window or the window at 2301.Ar target-window , 2302removing it from any sessions to which it is linked. 2303The 2304.Fl a 2305option kills all but the window given with 2306.Fl t . 2307.It Xo Ic last-pane 2308.Op Fl deZ 2309.Op Fl t Ar target-window 2310.Xc 2311.D1 (alias: Ic lastp ) 2312Select the last (previously selected) pane. 2313.Fl Z 2314keeps the window zoomed if it was zoomed. 2315.Fl e 2316enables or 2317.Fl d 2318disables input to the pane. 2319.It Ic last-window Op Fl t Ar target-session 2320.D1 (alias: Ic last ) 2321Select the last (previously selected) window. 2322If no 2323.Ar target-session 2324is specified, select the last window of the current session. 2325.It Xo Ic link-window 2326.Op Fl abdk 2327.Op Fl s Ar src-window 2328.Op Fl t Ar dst-window 2329.Xc 2330.D1 (alias: Ic linkw ) 2331Link the window at 2332.Ar src-window 2333to the specified 2334.Ar dst-window . 2335If 2336.Ar dst-window 2337is specified and no such window exists, the 2338.Ar src-window 2339is linked there. 2340With 2341.Fl a 2342or 2343.Fl b 2344the window is moved to the next index after or before 2345.Ar dst-window 2346(existing windows are moved if necessary). 2347If 2348.Fl k 2349is given and 2350.Ar dst-window 2351exists, it is killed, otherwise an error is generated. 2352If 2353.Fl d 2354is given, the newly linked window is not selected. 2355.It Xo Ic list-panes 2356.Op Fl as 2357.Op Fl F Ar format 2358.Op Fl f Ar filter 2359.Op Fl t Ar target 2360.Xc 2361.D1 (alias: Ic lsp ) 2362If 2363.Fl a 2364is given, 2365.Ar target 2366is ignored and all panes on the server are listed. 2367If 2368.Fl s 2369is given, 2370.Ar target 2371is a session (or the current session). 2372If neither is given, 2373.Ar target 2374is a window (or the current window). 2375.Fl F 2376specifies the format of each line and 2377.Fl f 2378a filter. 2379Only panes for which the filter is true are shown. 2380See the 2381.Sx FORMATS 2382section. 2383.It Xo Ic list-windows 2384.Op Fl a 2385.Op Fl F Ar format 2386.Op Fl f Ar filter 2387.Op Fl t Ar target-session 2388.Xc 2389.D1 (alias: Ic lsw ) 2390If 2391.Fl a 2392is given, list all windows on the server. 2393Otherwise, list windows in the current session or in 2394.Ar target-session . 2395.Fl F 2396specifies the format of each line and 2397.Fl f 2398a filter. 2399Only windows for which the filter is true are shown. 2400See the 2401.Sx FORMATS 2402section. 2403.It Xo Ic move-pane 2404.Op Fl bdfhv 2405.Op Fl l Ar size 2406.Op Fl s Ar src-pane 2407.Op Fl t Ar dst-pane 2408.Xc 2409.D1 (alias: Ic movep ) 2410Does the same as 2411.Ic join-pane . 2412.It Xo Ic move-window 2413.Op Fl abrdk 2414.Op Fl s Ar src-window 2415.Op Fl t Ar dst-window 2416.Xc 2417.D1 (alias: Ic movew ) 2418This is similar to 2419.Ic link-window , 2420except the window at 2421.Ar src-window 2422is moved to 2423.Ar dst-window . 2424With 2425.Fl r , 2426all windows in the session are renumbered in sequential order, respecting 2427the 2428.Ic base-index 2429option. 2430.It Xo Ic new-window 2431.Op Fl abdkPS 2432.Op Fl c Ar start-directory 2433.Op Fl e Ar environment 2434.Op Fl F Ar format 2435.Op Fl n Ar window-name 2436.Op Fl t Ar target-window 2437.Op Ar shell-command 2438.Xc 2439.D1 (alias: Ic neww ) 2440Create a new window. 2441With 2442.Fl a 2443or 2444.Fl b , 2445the new window is inserted at the next index after or before the specified 2446.Ar target-window , 2447moving windows up if necessary; 2448otherwise 2449.Ar target-window 2450is the new window location. 2451.Pp 2452If 2453.Fl d 2454is given, the session does not make the new window the current window. 2455.Ar target-window 2456represents the window to be created; if the target already exists an error is 2457shown, unless the 2458.Fl k 2459flag is used, in which case it is destroyed. 2460If 2461.Fl S 2462is given and a window named 2463.Ar window-name 2464already exists, it is selected (unless 2465.Fl d 2466is also given in which case the command does nothing). 2467.Pp 2468.Ar shell-command 2469is the command to execute. 2470If 2471.Ar shell-command 2472is not specified, the value of the 2473.Ic default-command 2474option is used. 2475.Fl c 2476specifies the working directory in which the new window is created. 2477.Pp 2478When the shell command completes, the window closes. 2479See the 2480.Ic remain-on-exit 2481option to change this behaviour. 2482.Pp 2483.Fl e 2484takes the form 2485.Ql VARIABLE=value 2486and sets an environment variable for the newly created window; it may be 2487specified multiple times. 2488.Pp 2489The 2490.Ev TERM 2491environment variable must be set to 2492.Ql screen 2493or 2494.Ql tmux 2495for all programs running 2496.Em inside 2497.Nm . 2498New windows will automatically have 2499.Ql TERM=screen 2500added to their environment, but care must be taken not to reset this in shell 2501start-up files or by the 2502.Fl e 2503option. 2504.Pp 2505The 2506.Fl P 2507option prints information about the new window after it has been created. 2508By default, it uses the format 2509.Ql #{session_name}:#{window_index} 2510but a different format may be specified with 2511.Fl F . 2512.It Ic next-layout Op Fl t Ar target-window 2513.D1 (alias: Ic nextl ) 2514Move a window to the next layout and rearrange the panes to fit. 2515.It Xo Ic next-window 2516.Op Fl a 2517.Op Fl t Ar target-session 2518.Xc 2519.D1 (alias: Ic next ) 2520Move to the next window in the session. 2521If 2522.Fl a 2523is used, move to the next window with an alert. 2524.It Xo Ic pipe-pane 2525.Op Fl IOo 2526.Op Fl t Ar target-pane 2527.Op Ar shell-command 2528.Xc 2529.D1 (alias: Ic pipep ) 2530Pipe output sent by the program in 2531.Ar target-pane 2532to a shell command or vice versa. 2533A pane may only be connected to one command at a time, any existing pipe is 2534closed before 2535.Ar shell-command 2536is executed. 2537The 2538.Ar shell-command 2539string may contain the special character sequences supported by the 2540.Ic status-left 2541option. 2542If no 2543.Ar shell-command 2544is given, the current pipe (if any) is closed. 2545.Pp 2546.Fl I 2547and 2548.Fl O 2549specify which of the 2550.Ar shell-command 2551output streams are connected to the pane: 2552with 2553.Fl I 2554stdout is connected (so anything 2555.Ar shell-command 2556prints is written to the pane as if it were typed); 2557with 2558.Fl O 2559stdin is connected (so any output in the pane is piped to 2560.Ar shell-command ) . 2561Both may be used together and if neither are specified, 2562.Fl O 2563is used. 2564.Pp 2565The 2566.Fl o 2567option only opens a new pipe if no previous pipe exists, allowing a pipe to 2568be toggled with a single key, for example: 2569.Bd -literal -offset indent 2570bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P' 2571.Ed 2572.It Xo Ic previous-layout 2573.Op Fl t Ar target-window 2574.Xc 2575.D1 (alias: Ic prevl ) 2576Move to the previous layout in the session. 2577.It Xo Ic previous-window 2578.Op Fl a 2579.Op Fl t Ar target-session 2580.Xc 2581.D1 (alias: Ic prev ) 2582Move to the previous window in the session. 2583With 2584.Fl a , 2585move to the previous window with an alert. 2586.It Xo Ic rename-window 2587.Op Fl t Ar target-window 2588.Ar new-name 2589.Xc 2590.D1 (alias: Ic renamew ) 2591Rename the current window, or the window at 2592.Ar target-window 2593if specified, to 2594.Ar new-name . 2595.It Xo Ic resize-pane 2596.Op Fl DLMRTUZ 2597.Op Fl t Ar target-pane 2598.Op Fl x Ar width 2599.Op Fl y Ar height 2600.Op Ar adjustment 2601.Xc 2602.D1 (alias: Ic resizep ) 2603Resize a pane, up, down, left or right by 2604.Ar adjustment 2605with 2606.Fl U , 2607.Fl D , 2608.Fl L 2609or 2610.Fl R , 2611or 2612to an absolute size 2613with 2614.Fl x 2615or 2616.Fl y . 2617The 2618.Ar adjustment 2619is given in lines or columns (the default is 1); 2620.Fl x 2621and 2622.Fl y 2623may be a given as a number of lines or columns or followed by 2624.Ql % 2625for a percentage of the window size (for example 2626.Ql -x 10% ) . 2627With 2628.Fl Z , 2629the active pane is toggled between zoomed (occupying the whole of the window) 2630and unzoomed (its normal position in the layout). 2631.Pp 2632.Fl M 2633begins mouse resizing (only valid if bound to a mouse key binding, see 2634.Sx MOUSE SUPPORT ) . 2635.Pp 2636.Fl T 2637trims all lines below the current cursor position and moves lines out of the 2638history to replace them. 2639.It Xo Ic resize-window 2640.Op Fl aADLRU 2641.Op Fl t Ar target-window 2642.Op Fl x Ar width 2643.Op Fl y Ar height 2644.Op Ar adjustment 2645.Xc 2646.D1 (alias: Ic resizew ) 2647Resize a window, up, down, left or right by 2648.Ar adjustment 2649with 2650.Fl U , 2651.Fl D , 2652.Fl L 2653or 2654.Fl R , 2655or 2656to an absolute size 2657with 2658.Fl x 2659or 2660.Fl y . 2661The 2662.Ar adjustment 2663is given in lines or cells (the default is 1). 2664.Fl A 2665sets the size of the largest session containing the window; 2666.Fl a 2667the size of the smallest. 2668This command will automatically set 2669.Ic window-size 2670to manual in the window options. 2671.It Xo Ic respawn-pane 2672.Op Fl k 2673.Op Fl c Ar start-directory 2674.Op Fl e Ar environment 2675.Op Fl t Ar target-pane 2676.Op Ar shell-command 2677.Xc 2678.D1 (alias: Ic respawnp ) 2679Reactivate a pane in which the command has exited (see the 2680.Ic remain-on-exit 2681window option). 2682If 2683.Ar shell-command 2684is not given, the command used when the pane was created or last respawned is 2685executed. 2686The pane must be already inactive, unless 2687.Fl k 2688is given, in which case any existing command is killed. 2689.Fl c 2690specifies a new working directory for the pane. 2691The 2692.Fl e 2693option has the same meaning as for the 2694.Ic new-window 2695command. 2696.It Xo Ic respawn-window 2697.Op Fl k 2698.Op Fl c Ar start-directory 2699.Op Fl e Ar environment 2700.Op Fl t Ar target-window 2701.Op Ar shell-command 2702.Xc 2703.D1 (alias: Ic respawnw ) 2704Reactivate a window in which the command has exited (see the 2705.Ic remain-on-exit 2706window option). 2707If 2708.Ar shell-command 2709is not given, the command used when the window was created or last respawned is 2710executed. 2711The window must be already inactive, unless 2712.Fl k 2713is given, in which case any existing command is killed. 2714.Fl c 2715specifies a new working directory for the window. 2716The 2717.Fl e 2718option has the same meaning as for the 2719.Ic new-window 2720command. 2721.It Xo Ic rotate-window 2722.Op Fl DUZ 2723.Op Fl t Ar target-window 2724.Xc 2725.D1 (alias: Ic rotatew ) 2726Rotate the positions of the panes within a window, either upward (numerically 2727lower) with 2728.Fl U 2729or downward (numerically higher). 2730.Fl Z 2731keeps the window zoomed if it was zoomed. 2732.It Xo Ic select-layout 2733.Op Fl Enop 2734.Op Fl t Ar target-pane 2735.Op Ar layout-name 2736.Xc 2737.D1 (alias: Ic selectl ) 2738Choose a specific layout for a window. 2739If 2740.Ar layout-name 2741is not given, the last preset layout used (if any) is reapplied. 2742.Fl n 2743and 2744.Fl p 2745are equivalent to the 2746.Ic next-layout 2747and 2748.Ic previous-layout 2749commands. 2750.Fl o 2751applies the last set layout if possible (undoes the most recent layout change). 2752.Fl E 2753spreads the current pane and any panes next to it out evenly. 2754.It Xo Ic select-pane 2755.Op Fl DdeLlMmRUZ 2756.Op Fl T Ar title 2757.Op Fl t Ar target-pane 2758.Xc 2759.D1 (alias: Ic selectp ) 2760Make pane 2761.Ar target-pane 2762the active pane in its window. 2763If one of 2764.Fl D , 2765.Fl L , 2766.Fl R , 2767or 2768.Fl U 2769is used, respectively the pane below, to the left, to the right, or above the 2770target pane is used. 2771.Fl Z 2772keeps the window zoomed if it was zoomed. 2773.Fl l 2774is the same as using the 2775.Ic last-pane 2776command. 2777.Fl e 2778enables or 2779.Fl d 2780disables input to the pane. 2781.Fl T 2782sets the pane title. 2783.Pp 2784.Fl m 2785and 2786.Fl M 2787are used to set and clear the 2788.Em marked pane . 2789There is one marked pane at a time, setting a new marked pane clears the last. 2790The marked pane is the default target for 2791.Fl s 2792to 2793.Ic join-pane , 2794.Ic move-pane , 2795.Ic swap-pane 2796and 2797.Ic swap-window . 2798.It Xo Ic select-window 2799.Op Fl lnpT 2800.Op Fl t Ar target-window 2801.Xc 2802.D1 (alias: Ic selectw ) 2803Select the window at 2804.Ar target-window . 2805.Fl l , 2806.Fl n 2807and 2808.Fl p 2809are equivalent to the 2810.Ic last-window , 2811.Ic next-window 2812and 2813.Ic previous-window 2814commands. 2815If 2816.Fl T 2817is given and the selected window is already the current window, 2818the command behaves like 2819.Ic last-window . 2820.It Xo Ic split-window 2821.Op Fl bdfhIvPZ 2822.Op Fl c Ar start-directory 2823.Op Fl e Ar environment 2824.Op Fl l Ar size 2825.Op Fl t Ar target-pane 2826.Op Ar shell-command 2827.Op Fl F Ar format 2828.Xc 2829.D1 (alias: Ic splitw ) 2830Create a new pane by splitting 2831.Ar target-pane : 2832.Fl h 2833does a horizontal split and 2834.Fl v 2835a vertical split; if neither is specified, 2836.Fl v 2837is assumed. 2838The 2839.Fl l 2840option specifies the size of the new pane in lines (for vertical split) or in 2841columns (for horizontal split); 2842.Ar size 2843may be followed by 2844.Ql % 2845to specify a percentage of the available space. 2846The 2847.Fl b 2848option causes the new pane to be created to the left of or above 2849.Ar target-pane . 2850The 2851.Fl f 2852option creates a new pane spanning the full window height (with 2853.Fl h ) 2854or full window width (with 2855.Fl v ) , 2856instead of splitting the active pane. 2857.Fl Z 2858zooms if the window is not zoomed, or keeps it zoomed if already zoomed. 2859.Pp 2860An empty 2861.Ar shell-command 2862('') will create a pane with no command running in it. 2863Output can be sent to such a pane with the 2864.Ic display-message 2865command. 2866The 2867.Fl I 2868flag (if 2869.Ar shell-command 2870is not specified or empty) 2871will create an empty pane and forward any output from stdin to it. 2872For example: 2873.Bd -literal -offset indent 2874$ make 2>&1|tmux splitw -dI & 2875.Ed 2876.Pp 2877All other options have the same meaning as for the 2878.Ic new-window 2879command. 2880.It Xo Ic swap-pane 2881.Op Fl dDUZ 2882.Op Fl s Ar src-pane 2883.Op Fl t Ar dst-pane 2884.Xc 2885.D1 (alias: Ic swapp ) 2886Swap two panes. 2887If 2888.Fl U 2889is used and no source pane is specified with 2890.Fl s , 2891.Ar dst-pane 2892is swapped with the previous pane (before it numerically); 2893.Fl D 2894swaps with the next pane (after it numerically). 2895.Fl d 2896instructs 2897.Nm 2898not to change the active pane and 2899.Fl Z 2900keeps the window zoomed if it was zoomed. 2901.Pp 2902If 2903.Fl s 2904is omitted and a marked pane is present (see 2905.Ic select-pane 2906.Fl m ) , 2907the marked pane is used rather than the current pane. 2908.It Xo Ic swap-window 2909.Op Fl d 2910.Op Fl s Ar src-window 2911.Op Fl t Ar dst-window 2912.Xc 2913.D1 (alias: Ic swapw ) 2914This is similar to 2915.Ic link-window , 2916except the source and destination windows are swapped. 2917It is an error if no window exists at 2918.Ar src-window . 2919If 2920.Fl d 2921is given, the new window does not become the current window. 2922.Pp 2923If 2924.Fl s 2925is omitted and a marked pane is present (see 2926.Ic select-pane 2927.Fl m ) , 2928the window containing the marked pane is used rather than the current window. 2929.It Xo Ic unlink-window 2930.Op Fl k 2931.Op Fl t Ar target-window 2932.Xc 2933.D1 (alias: Ic unlinkw ) 2934Unlink 2935.Ar target-window . 2936Unless 2937.Fl k 2938is given, a window may be unlinked only if it is linked to multiple sessions - 2939windows may not be linked to no sessions; 2940if 2941.Fl k 2942is specified and the window is linked to only one session, it is unlinked and 2943destroyed. 2944.El 2945.Sh KEY BINDINGS 2946.Nm 2947allows a command to be bound to most keys, with or without a prefix key. 2948When specifying keys, most represent themselves (for example 2949.Ql A 2950to 2951.Ql Z ) . 2952Ctrl keys may be prefixed with 2953.Ql C- 2954or 2955.Ql ^ , 2956and Alt (meta) with 2957.Ql M- . 2958In addition, the following special key names are accepted: 2959.Em Up , 2960.Em Down , 2961.Em Left , 2962.Em Right , 2963.Em BSpace , 2964.Em BTab , 2965.Em DC 2966(Delete), 2967.Em End , 2968.Em Enter , 2969.Em Escape , 2970.Em F1 2971to 2972.Em F12 , 2973.Em Home , 2974.Em IC 2975(Insert), 2976.Em NPage/PageDown/PgDn , 2977.Em PPage/PageUp/PgUp , 2978.Em Space , 2979and 2980.Em Tab . 2981Note that to bind the 2982.Ql \&" 2983or 2984.Ql ' 2985keys, quotation marks are necessary, for example: 2986.Bd -literal -offset indent 2987bind-key '"' split-window 2988bind-key "'" new-window 2989.Ed 2990.Pp 2991A command bound to the 2992.Em Any 2993key will execute for all keys which do not have a more specific binding. 2994.Pp 2995Commands related to key bindings are as follows: 2996.Bl -tag -width Ds 2997.It Xo Ic bind-key 2998.Op Fl nr 2999.Op Fl N Ar note 3000.Op Fl T Ar key-table 3001.Ar key command Op Ar arguments 3002.Xc 3003.D1 (alias: Ic bind ) 3004Bind key 3005.Ar key 3006to 3007.Ar command . 3008Keys are bound in a key table. 3009By default (without -T), the key is bound in 3010the 3011.Em prefix 3012key table. 3013This table is used for keys pressed after the prefix key (for example, 3014by default 3015.Ql c 3016is bound to 3017.Ic new-window 3018in the 3019.Em prefix 3020table, so 3021.Ql C-b c 3022creates a new window). 3023The 3024.Em root 3025table is used for keys pressed without the prefix key: binding 3026.Ql c 3027to 3028.Ic new-window 3029in the 3030.Em root 3031table (not recommended) means a plain 3032.Ql c 3033will create a new window. 3034.Fl n 3035is an alias 3036for 3037.Fl T Ar root . 3038Keys may also be bound in custom key tables and the 3039.Ic switch-client 3040.Fl T 3041command used to switch to them from a key binding. 3042The 3043.Fl r 3044flag indicates this key may repeat, see the 3045.Ic repeat-time 3046option. 3047.Fl N 3048attaches a note to the key (shown with 3049.Ic list-keys 3050.Fl N ) . 3051.Pp 3052To view the default bindings and possible commands, see the 3053.Ic list-keys 3054command. 3055.It Xo Ic list-keys 3056.Op Fl 1aN 3057.Op Fl P Ar prefix-string Fl T Ar key-table 3058.Op Ar key 3059.Xc 3060.D1 (alias: Ic lsk ) 3061List key bindings. 3062There are two forms: the default lists keys as 3063.Ic bind-key 3064commands; 3065.Fl N 3066lists only keys with attached notes and shows only the key and note for each 3067key. 3068.Pp 3069With the default form, all key tables are listed by default. 3070.Fl T 3071lists only keys in 3072.Ar key-table . 3073.Pp 3074With the 3075.Fl N 3076form, only keys in the 3077.Em root 3078and 3079.Em prefix 3080key tables are listed by default; 3081.Fl T 3082also lists only keys in 3083.Ar key-table . 3084.Fl P 3085specifies a prefix to print before each key and 3086.Fl 1 3087lists only the first matching key. 3088.Fl a 3089lists the command for keys that do not have a note rather than skipping them. 3090.It Xo Ic send-keys 3091.Op Fl FHlMRX 3092.Op Fl N Ar repeat-count 3093.Op Fl t Ar target-pane 3094.Ar key Ar ... 3095.Xc 3096.D1 (alias: Ic send ) 3097Send a key or keys to a window. 3098Each argument 3099.Ar key 3100is the name of the key (such as 3101.Ql C-a 3102or 3103.Ql NPage ) 3104to send; if the string is not recognised as a key, it is sent as a series of 3105characters. 3106All arguments are sent sequentially from first to last. 3107.Pp 3108The 3109.Fl l 3110flag disables key name lookup and processes the keys as literal UTF-8 3111characters. 3112The 3113.Fl H 3114flag expects each key to be a hexadecimal number for an ASCII character. 3115.Pp 3116The 3117.Fl R 3118flag causes the terminal state to be reset. 3119.Pp 3120.Fl M 3121passes through a mouse event (only valid if bound to a mouse key binding, see 3122.Sx MOUSE SUPPORT ) . 3123.Pp 3124.Fl X 3125is used to send a command into copy mode - see 3126the 3127.Sx WINDOWS AND PANES 3128section. 3129.Fl N 3130specifies a repeat count and 3131.Fl F 3132expands formats in arguments where appropriate. 3133.It Xo Ic send-prefix 3134.Op Fl 2 3135.Op Fl t Ar target-pane 3136.Xc 3137Send the prefix key, or with 3138.Fl 2 3139the secondary prefix key, to a window as if it was pressed. 3140.It Xo Ic unbind-key 3141.Op Fl anq 3142.Op Fl T Ar key-table 3143.Ar key 3144.Xc 3145.D1 (alias: Ic unbind ) 3146Unbind the command bound to 3147.Ar key . 3148.Fl n 3149and 3150.Fl T 3151are the same as for 3152.Ic bind-key . 3153If 3154.Fl a 3155is present, all key bindings are removed. 3156The 3157.Fl q 3158option prevents errors being returned. 3159.El 3160.Sh OPTIONS 3161The appearance and behaviour of 3162.Nm 3163may be modified by changing the value of various options. 3164There are four types of option: 3165.Em server options , 3166.Em session options , 3167.Em window options , 3168and 3169.Em pane options . 3170.Pp 3171The 3172.Nm 3173server has a set of global server options which do not apply to any particular 3174window or session or pane. 3175These are altered with the 3176.Ic set-option 3177.Fl s 3178command, or displayed with the 3179.Ic show-options 3180.Fl s 3181command. 3182.Pp 3183In addition, each individual session may have a set of session options, and 3184there is a separate set of global session options. 3185Sessions which do not have a particular option configured inherit the value 3186from the global session options. 3187Session options are set or unset with the 3188.Ic set-option 3189command and may be listed with the 3190.Ic show-options 3191command. 3192The available server and session options are listed under the 3193.Ic set-option 3194command. 3195.Pp 3196Similarly, a set of window options is attached to each window and a set of pane 3197options to each pane. 3198Pane options inherit from window options. 3199This means any pane option may be set as a window option to apply the option to 3200all panes in the window without the option set, for example these commands will 3201set the background colour to red for all panes except pane 0: 3202.Bd -literal -offset indent 3203set -w window-style bg=red 3204set -pt:.0 window-style bg=blue 3205.Ed 3206.Pp 3207There is also a set of global window options from which any unset window or 3208pane options are inherited. 3209Window and pane options are altered with 3210.Ic set-option 3211.Fl w 3212and 3213.Fl p 3214commands and displayed with 3215.Ic show-option 3216.Fl w 3217and 3218.Fl p . 3219.Pp 3220.Nm 3221also supports user options which are prefixed with a 3222.Ql \&@ . 3223User options may have any name, so long as they are prefixed with 3224.Ql \&@ , 3225and be set to any string. 3226For example: 3227.Bd -literal -offset indent 3228$ tmux set -wq @foo "abc123" 3229$ tmux show -wv @foo 3230abc123 3231.Ed 3232.Pp 3233Commands which set options are as follows: 3234.Bl -tag -width Ds 3235.It Xo Ic set-option 3236.Op Fl aFgopqsuUw 3237.Op Fl t Ar target-pane 3238.Ar option Ar value 3239.Xc 3240.D1 (alias: Ic set ) 3241Set a pane option with 3242.Fl p , 3243a window option with 3244.Fl w , 3245a server option with 3246.Fl s , 3247otherwise a session option. 3248If the option is not a user option, 3249.Fl w 3250or 3251.Fl s 3252may be unnecessary - 3253.Nm 3254will infer the type from the option name, assuming 3255.Fl w 3256for pane options. 3257If 3258.Fl g 3259is given, the global session or window option is set. 3260.Pp 3261.Fl F 3262expands formats in the option value. 3263The 3264.Fl u 3265flag unsets an option, so a session inherits the option from the global 3266options (or with 3267.Fl g , 3268restores a global option to the default). 3269.Fl U 3270unsets an option (like 3271.Fl u ) 3272but if the option is a pane option also unsets the option on any panes in the 3273window. 3274.Ar value 3275depends on the option and may be a number, a string, or a flag (on, off, or 3276omitted to toggle). 3277.Pp 3278The 3279.Fl o 3280flag prevents setting an option that is already set and the 3281.Fl q 3282flag suppresses errors about unknown or ambiguous options. 3283.Pp 3284With 3285.Fl a , 3286and if the option expects a string or a style, 3287.Ar value 3288is appended to the existing setting. 3289For example: 3290.Bd -literal -offset indent 3291set -g status-left "foo" 3292set -ag status-left "bar" 3293.Ed 3294.Pp 3295Will result in 3296.Ql foobar . 3297And: 3298.Bd -literal -offset indent 3299set -g status-style "bg=red" 3300set -ag status-style "fg=blue" 3301.Ed 3302.Pp 3303Will result in a red background 3304.Em and 3305blue foreground. 3306Without 3307.Fl a , 3308the result would be the default background and a blue foreground. 3309.It Xo Ic show-options 3310.Op Fl AgHpqsvw 3311.Op Fl t Ar target-pane 3312.Op Ar option 3313.Xc 3314.D1 (alias: Ic show ) 3315Show the pane options (or a single option if 3316.Ar option 3317is provided) with 3318.Fl p , 3319the window options with 3320.Fl w , 3321the server options with 3322.Fl s , 3323otherwise the session options. 3324If the option is not a user option, 3325.Fl w 3326or 3327.Fl s 3328may be unnecessary - 3329.Nm 3330will infer the type from the option name, assuming 3331.Fl w 3332for pane options. 3333Global session or window options are listed if 3334.Fl g 3335is used. 3336.Fl v 3337shows only the option value, not the name. 3338If 3339.Fl q 3340is set, no error will be returned if 3341.Ar option 3342is unset. 3343.Fl H 3344includes hooks (omitted by default). 3345.Fl A 3346includes options inherited from a parent set of options, such options are 3347marked with an asterisk. 3348.El 3349.Pp 3350Available server options are: 3351.Bl -tag -width Ds 3352.It Ic backspace Ar key 3353Set the key sent by 3354.Nm 3355for backspace. 3356.It Ic buffer-limit Ar number 3357Set the number of buffers; as new buffers are added to the top of the stack, 3358old ones are removed from the bottom if necessary to maintain this maximum 3359length. 3360.It Xo Ic command-alias[] 3361.Ar name=value 3362.Xc 3363This is an array of custom aliases for commands. 3364If an unknown command matches 3365.Ar name , 3366it is replaced with 3367.Ar value . 3368For example, after: 3369.Pp 3370.Dl set -s command-alias[100] zoom='resize-pane -Z' 3371.Pp 3372Using: 3373.Pp 3374.Dl zoom -t:.1 3375.Pp 3376Is equivalent to: 3377.Pp 3378.Dl resize-pane -Z -t:.1 3379.Pp 3380Note that aliases are expanded when a command is parsed rather than when it is 3381executed, so binding an alias with 3382.Ic bind-key 3383will bind the expanded form. 3384.It Ic default-terminal Ar terminal 3385Set the default terminal for new windows created in this session - the 3386default value of the 3387.Ev TERM 3388environment variable. 3389For 3390.Nm 3391to work correctly, this 3392.Em must 3393be set to 3394.Ql screen , 3395.Ql tmux 3396or a derivative of them. 3397.It Ic copy-command Ar shell-command 3398Give the command to pipe to if the 3399.Ic copy-pipe 3400copy mode command is used without arguments. 3401.It Ic escape-time Ar time 3402Set the time in milliseconds for which 3403.Nm 3404waits after an escape is input to determine if it is part of a function or meta 3405key sequences. 3406The default is 500 milliseconds. 3407.It Ic editor Ar shell-command 3408Set the command used when 3409.Nm 3410runs an editor. 3411.It Xo Ic exit-empty 3412.Op Ic on | off 3413.Xc 3414If enabled (the default), the server will exit when there are no active 3415sessions. 3416.It Xo Ic exit-unattached 3417.Op Ic on | off 3418.Xc 3419If enabled, the server will exit when there are no attached clients. 3420.It Xo Ic extended-keys 3421.Op Ic on | off 3422.Xc 3423When enabled, extended keys are requested from the terminal and if supported 3424are recognised by 3425.Nm . 3426.It Xo Ic focus-events 3427.Op Ic on | off 3428.Xc 3429When enabled, focus events are requested from the terminal if supported and 3430passed through to applications running in 3431.Nm . 3432Attached clients should be detached and attached again after changing this 3433option. 3434.It Ic history-file Ar path 3435If not empty, a file to which 3436.Nm 3437will write command prompt history on exit and load it from on start. 3438.It Ic message-limit Ar number 3439Set the number of error or information messages to save in the message log for 3440each client. 3441The default is 100. 3442.It Xo Ic set-clipboard 3443.Op Ic on | external | off 3444.Xc 3445Attempt to set the terminal clipboard content using the 3446.Xr xterm 1 3447escape sequence, if there is an 3448.Em \&Ms 3449entry in the 3450.Xr terminfo 5 3451description (see the 3452.Sx TERMINFO EXTENSIONS 3453section). 3454.Pp 3455If set to 3456.Ic on , 3457.Nm 3458will both accept the escape sequence to create a buffer and attempt to set 3459the terminal clipboard. 3460If set to 3461.Ic external , 3462.Nm 3463will attempt to set the terminal clipboard but ignore attempts 3464by applications to set 3465.Nm 3466buffers. 3467If 3468.Ic off , 3469.Nm 3470will neither accept the clipboard escape sequence nor attempt to set the 3471clipboard. 3472.Pp 3473Note that this feature needs to be enabled in 3474.Xr xterm 1 3475by setting the resource: 3476.Bd -literal -offset indent 3477disallowedWindowOps: 20,21,SetXprop 3478.Ed 3479.Pp 3480Or changing this property from the 3481.Xr xterm 1 3482interactive menu when required. 3483.It Ic terminal-features[] Ar string 3484Set terminal features for terminal types read from 3485.Xr terminfo 5 . 3486.Nm 3487has a set of named terminal features. 3488Each will apply appropriate changes to the 3489.Xr terminfo 5 3490entry in use. 3491.Pp 3492.Nm 3493can detect features for a few common terminals; this option can be used to 3494easily tell tmux about features supported by terminals it cannot detect. 3495The 3496.Ic terminal-overrides 3497option allows individual 3498.Xr terminfo 5 3499capabilities to be set instead, 3500.Ic terminal-features 3501is intended for classes of functionality supported in a standard way but not 3502reported by 3503.Xr terminfo 5 . 3504Care must be taken only to configure this with features the terminal actually 3505support. 3506.Pp 3507This is an array option where each entry is a colon-separated string made up 3508of a terminal type pattern (matched using 3509.Xr fnmatch 3 ) 3510followed by a list of terminal features. 3511The available features are: 3512.Bl -tag -width Ds 3513.It 256 3514Supports 256 colours with the SGR escape sequences. 3515.It clipboard 3516Allows setting the system clipboard. 3517.It ccolour 3518Allows setting the cursor colour. 3519.It cstyle 3520Allows setting the cursor style. 3521.It extkeys 3522Supports extended keys. 3523.It focus 3524Supports focus reporting. 3525.It margins 3526Supports DECSLRM margins. 3527.It overline 3528Supports the overline SGR attribute. 3529.It rectfill 3530Supports the DECFRA rectangle fill escape sequence. 3531.It RGB 3532Supports RGB colour with the SGR escape sequences. 3533.It strikethrough 3534Supports the strikethrough SGR escape sequence. 3535.It sync 3536Supports synchronized updates. 3537.It title 3538Supports 3539.Xr xterm 1 3540title setting. 3541.It usstyle 3542Allows underscore style and colour to be set. 3543.El 3544.It Ic terminal-overrides[] Ar string 3545Allow terminal descriptions read using 3546.Xr terminfo 5 3547to be overridden. 3548Each entry is a colon-separated string made up of a terminal type pattern 3549(matched using 3550.Xr fnmatch 3 ) 3551and a set of 3552.Em name=value 3553entries. 3554.Pp 3555For example, to set the 3556.Ql clear 3557.Xr terminfo 5 3558entry to 3559.Ql \ee[H\ee[2J 3560for all terminal types matching 3561.Ql rxvt* : 3562.Pp 3563.Dl "rxvt*:clear=\ee[H\ee[2J" 3564.Pp 3565The terminal entry value is passed through 3566.Xr strunvis 3 3567before interpretation. 3568.It Ic user-keys[] Ar key 3569Set list of user-defined key escape sequences. 3570Each item is associated with a key named 3571.Ql User0 , 3572.Ql User1 , 3573and so on. 3574.Pp 3575For example: 3576.Bd -literal -offset indent 3577set -s user-keys[0] "\ee[5;30012~" 3578bind User0 resize-pane -L 3 3579.Ed 3580.El 3581.Pp 3582Available session options are: 3583.Bl -tag -width Ds 3584.It Xo Ic activity-action 3585.Op Ic any | none | current | other 3586.Xc 3587Set action on window activity when 3588.Ic monitor-activity 3589is on. 3590.Ic any 3591means activity in any window linked to a session causes a bell or message 3592(depending on 3593.Ic visual-activity ) 3594in the current window of that session, 3595.Ic none 3596means all activity is ignored (equivalent to 3597.Ic monitor-activity 3598being off), 3599.Ic current 3600means only activity in windows other than the current window are ignored and 3601.Ic other 3602means activity in the current window is ignored but not those in other windows. 3603.It Ic assume-paste-time Ar milliseconds 3604If keys are entered faster than one in 3605.Ar milliseconds , 3606they are assumed to have been pasted rather than typed and 3607.Nm 3608key bindings are not processed. 3609The default is one millisecond and zero disables. 3610.It Ic base-index Ar index 3611Set the base index from which an unused index should be searched when a new 3612window is created. 3613The default is zero. 3614.It Xo Ic bell-action 3615.Op Ic any | none | current | other 3616.Xc 3617Set action on a bell in a window when 3618.Ic monitor-bell 3619is on. 3620The values are the same as those for 3621.Ic activity-action . 3622.It Ic default-command Ar shell-command 3623Set the command used for new windows (if not specified when the window is 3624created) to 3625.Ar shell-command , 3626which may be any 3627.Xr sh 1 3628command. 3629The default is an empty string, which instructs 3630.Nm 3631to create a login shell using the value of the 3632.Ic default-shell 3633option. 3634.It Ic default-shell Ar path 3635Specify the default shell. 3636This is used as the login shell for new windows when the 3637.Ic default-command 3638option is set to empty, and must be the full path of the executable. 3639When started 3640.Nm 3641tries to set a default value from the first suitable of the 3642.Ev SHELL 3643environment variable, the shell returned by 3644.Xr getpwuid 3 , 3645or 3646.Pa /bin/sh . 3647This option should be configured when 3648.Nm 3649is used as a login shell. 3650.It Ic default-size Ar XxY 3651Set the default size of new windows when the 3652.Ic window-size 3653option is set to manual or when a session is created with 3654.Ic new-session 3655.Fl d . 3656The value is the width and height separated by an 3657.Ql x 3658character. 3659The default is 80x24. 3660.It Xo Ic destroy-unattached 3661.Op Ic on | off 3662.Xc 3663If enabled and the session is no longer attached to any clients, it is 3664destroyed. 3665.It Xo Ic detach-on-destroy 3666.Op Ic off | on | no-detached 3667.Xc 3668If on (the default), the client is detached when the session it is attached to 3669is destroyed. 3670If off, the client is switched to the most recently active of the remaining 3671sessions. 3672If 3673.Ic no-detached , 3674the client is detached only if there are no detached sessions; if detached 3675sessions exist, the client is switched to the most recently active. 3676.It Ic display-panes-active-colour Ar colour 3677Set the colour used by the 3678.Ic display-panes 3679command to show the indicator for the active pane. 3680.It Ic display-panes-colour Ar colour 3681Set the colour used by the 3682.Ic display-panes 3683command to show the indicators for inactive panes. 3684.It Ic display-panes-time Ar time 3685Set the time in milliseconds for which the indicators shown by the 3686.Ic display-panes 3687command appear. 3688.It Ic display-time Ar time 3689Set the amount of time for which status line messages and other on-screen 3690indicators are displayed. 3691If set to 0, messages and indicators are displayed until a key is pressed. 3692.Ar time 3693is in milliseconds. 3694.It Ic history-limit Ar lines 3695Set the maximum number of lines held in window history. 3696This setting applies only to new windows - existing window histories are not 3697resized and retain the limit at the point they were created. 3698.It Ic key-table Ar key-table 3699Set the default key table to 3700.Ar key-table 3701instead of 3702.Em root . 3703.It Ic lock-after-time Ar number 3704Lock the session (like the 3705.Ic lock-session 3706command) after 3707.Ar number 3708seconds of inactivity. 3709The default is not to lock (set to 0). 3710.It Ic lock-command Ar shell-command 3711Command to run when locking each client. 3712The default is to run 3713.Xr lock 1 3714with 3715.Fl np . 3716.It Ic message-command-style Ar style 3717Set status line message command style. 3718This is used for the command prompt with 3719.Xr vi 1 3720keys when in command mode. 3721For how to specify 3722.Ar style , 3723see the 3724.Sx STYLES 3725section. 3726.It Ic message-style Ar style 3727Set status line message style. 3728This is used for messages and for the command prompt. 3729For how to specify 3730.Ar style , 3731see the 3732.Sx STYLES 3733section. 3734.It Xo Ic mouse 3735.Op Ic on | off 3736.Xc 3737If on, 3738.Nm 3739captures the mouse and allows mouse events to be bound as key bindings. 3740See the 3741.Sx MOUSE SUPPORT 3742section for details. 3743.It Ic prefix Ar key 3744Set the key accepted as a prefix key. 3745In addition to the standard keys described under 3746.Sx KEY BINDINGS , 3747.Ic prefix 3748can be set to the special key 3749.Ql None 3750to set no prefix. 3751.It Ic prefix2 Ar key 3752Set a secondary key accepted as a prefix key. 3753Like 3754.Ic prefix , 3755.Ic prefix2 3756can be set to 3757.Ql None . 3758.It Xo Ic renumber-windows 3759.Op Ic on | off 3760.Xc 3761If on, when a window is closed in a session, automatically renumber the other 3762windows in numerical order. 3763This respects the 3764.Ic base-index 3765option if it has been set. 3766If off, do not renumber the windows. 3767.It Ic repeat-time Ar time 3768Allow multiple commands to be entered without pressing the prefix-key again 3769in the specified 3770.Ar time 3771milliseconds (the default is 500). 3772Whether a key repeats may be set when it is bound using the 3773.Fl r 3774flag to 3775.Ic bind-key . 3776Repeat is enabled for the default keys bound to the 3777.Ic resize-pane 3778command. 3779.It Xo Ic set-titles 3780.Op Ic on | off 3781.Xc 3782Attempt to set the client terminal title using the 3783.Em tsl 3784and 3785.Em fsl 3786.Xr terminfo 5 3787entries if they exist. 3788.Nm 3789automatically sets these to the \ee]0;...\e007 sequence if 3790the terminal appears to be 3791.Xr xterm 1 . 3792This option is off by default. 3793.It Ic set-titles-string Ar string 3794String used to set the client terminal title if 3795.Ic set-titles 3796is on. 3797Formats are expanded, see the 3798.Sx FORMATS 3799section. 3800.It Xo Ic silence-action 3801.Op Ic any | none | current | other 3802.Xc 3803Set action on window silence when 3804.Ic monitor-silence 3805is on. 3806The values are the same as those for 3807.Ic activity-action . 3808.It Xo Ic status 3809.Op Ic off | on | 2 | 3 | 4 | 5 3810.Xc 3811Show or hide the status line or specify its size. 3812Using 3813.Ic on 3814gives a status line one row in height; 3815.Ic 2 , 3816.Ic 3 , 3817.Ic 4 3818or 3819.Ic 5 3820more rows. 3821.It Ic status-format[] Ar format 3822Specify the format to be used for each line of the status line. 3823The default builds the top status line from the various individual status 3824options below. 3825.It Ic status-interval Ar interval 3826Update the status line every 3827.Ar interval 3828seconds. 3829By default, updates will occur every 15 seconds. 3830A setting of zero disables redrawing at interval. 3831.It Xo Ic status-justify 3832.Op Ic left | centre | right | absolute-centre 3833.Xc 3834Set the position of the window list in the status line: left, centre or right. 3835centre puts the window list in the relative centre of the available free space; 3836absolute-centre uses the centre of the entire horizontal space. 3837.It Xo Ic status-keys 3838.Op Ic vi | emacs 3839.Xc 3840Use vi or emacs-style 3841key bindings in the status line, for example at the command prompt. 3842The default is emacs, unless the 3843.Ev VISUAL 3844or 3845.Ev EDITOR 3846environment variables are set and contain the string 3847.Ql vi . 3848.It Ic status-left Ar string 3849Display 3850.Ar string 3851(by default the session name) to the left of the status line. 3852.Ar string 3853will be passed through 3854.Xr strftime 3 . 3855Also see the 3856.Sx FORMATS 3857and 3858.Sx STYLES 3859sections. 3860.Pp 3861For details on how the names and titles can be set see the 3862.Sx "NAMES AND TITLES" 3863section. 3864.Pp 3865Examples are: 3866.Bd -literal -offset indent 3867#(sysctl vm.loadavg) 3868#[fg=yellow,bold]#(apm -l)%%#[default] [#S] 3869.Ed 3870.Pp 3871The default is 3872.Ql "[#S] " . 3873.It Ic status-left-length Ar length 3874Set the maximum 3875.Ar length 3876of the left component of the status line. 3877The default is 10. 3878.It Ic status-left-style Ar style 3879Set the style of the left part of the status line. 3880For how to specify 3881.Ar style , 3882see the 3883.Sx STYLES 3884section. 3885.It Xo Ic status-position 3886.Op Ic top | bottom 3887.Xc 3888Set the position of the status line. 3889.It Ic status-right Ar string 3890Display 3891.Ar string 3892to the right of the status line. 3893By default, the current pane title in double quotes, the date and the time 3894are shown. 3895As with 3896.Ic status-left , 3897.Ar string 3898will be passed to 3899.Xr strftime 3 3900and character pairs are replaced. 3901.It Ic status-right-length Ar length 3902Set the maximum 3903.Ar length 3904of the right component of the status line. 3905The default is 40. 3906.It Ic status-right-style Ar style 3907Set the style of the right part of the status line. 3908For how to specify 3909.Ar style , 3910see the 3911.Sx STYLES 3912section. 3913.It Ic status-style Ar style 3914Set status line style. 3915For how to specify 3916.Ar style , 3917see the 3918.Sx STYLES 3919section. 3920.It Ic update-environment[] Ar variable 3921Set list of environment variables to be copied into the session environment 3922when a new session is created or an existing session is attached. 3923Any variables that do not exist in the source environment are set to be 3924removed from the session environment (as if 3925.Fl r 3926was given to the 3927.Ic set-environment 3928command). 3929.It Xo Ic visual-activity 3930.Op Ic on | off | both 3931.Xc 3932If on, display a message instead of sending a bell when activity occurs in a 3933window for which the 3934.Ic monitor-activity 3935window option is enabled. 3936If set to both, a bell and a message are produced. 3937.It Xo Ic visual-bell 3938.Op Ic on | off | both 3939.Xc 3940If on, a message is shown on a bell in a window for which the 3941.Ic monitor-bell 3942window option is enabled instead of it being passed through to the 3943terminal (which normally makes a sound). 3944If set to both, a bell and a message are produced. 3945Also see the 3946.Ic bell-action 3947option. 3948.It Xo Ic visual-silence 3949.Op Ic on | off | both 3950.Xc 3951If 3952.Ic monitor-silence 3953is enabled, prints a message after the interval has expired on a given window 3954instead of sending a bell. 3955If set to both, a bell and a message are produced. 3956.It Ic word-separators Ar string 3957Sets the session's conception of what characters are considered word 3958separators, for the purposes of the next and previous word commands in 3959copy mode. 3960The default is 3961.Ql \ -_@ . 3962.El 3963.Pp 3964Available window options are: 3965.Pp 3966.Bl -tag -width Ds -compact 3967.It Xo Ic aggressive-resize 3968.Op Ic on | off 3969.Xc 3970Aggressively resize the chosen window. 3971This means that 3972.Nm 3973will resize the window to the size of the smallest or largest session 3974(see the 3975.Ic window-size 3976option) for which it is the current window, rather than the session to 3977which it is attached. 3978The window may resize when the current window is changed on another 3979session; this option is good for full-screen programs which support 3980.Dv SIGWINCH 3981and poor for interactive programs such as shells. 3982.Pp 3983.It Xo Ic automatic-rename 3984.Op Ic on | off 3985.Xc 3986Control automatic window renaming. 3987When this setting is enabled, 3988.Nm 3989will rename the window automatically using the format specified by 3990.Ic automatic-rename-format . 3991This flag is automatically disabled for an individual window when a name 3992is specified at creation with 3993.Ic new-window 3994or 3995.Ic new-session , 3996or later with 3997.Ic rename-window , 3998or with a terminal escape sequence. 3999It may be switched off globally with: 4000.Bd -literal -offset indent 4001set-option -wg automatic-rename off 4002.Ed 4003.Pp 4004.It Ic automatic-rename-format Ar format 4005The format (see 4006.Sx FORMATS ) 4007used when the 4008.Ic automatic-rename 4009option is enabled. 4010.Pp 4011.It Ic clock-mode-colour Ar colour 4012Set clock colour. 4013.Pp 4014.It Xo Ic clock-mode-style 4015.Op Ic 12 | 24 4016.Xc 4017Set clock hour format. 4018.Pp 4019.It Ic main-pane-height Ar height 4020.It Ic main-pane-width Ar width 4021Set the width or height of the main (left or top) pane in the 4022.Ic main-horizontal 4023or 4024.Ic main-vertical 4025layouts. 4026If suffixed by 4027.Ql % , 4028this is a percentage of the window size. 4029.Pp 4030.It Ic copy-mode-match-style Ar style 4031Set the style of search matches in copy mode. 4032For how to specify 4033.Ar style , 4034see the 4035.Sx STYLES 4036section. 4037.Pp 4038.It Ic copy-mode-mark-style Ar style 4039Set the style of the line containing the mark in copy mode. 4040For how to specify 4041.Ar style , 4042see the 4043.Sx STYLES 4044section. 4045.Pp 4046.It Ic copy-mode-current-match-style Ar style 4047Set the style of the current search match in copy mode. 4048For how to specify 4049.Ar style , 4050see the 4051.Sx STYLES 4052section. 4053.Pp 4054.It Xo Ic mode-keys 4055.Op Ic vi | emacs 4056.Xc 4057Use vi or emacs-style key bindings in copy mode. 4058The default is emacs, unless 4059.Ev VISUAL 4060or 4061.Ev EDITOR 4062contains 4063.Ql vi . 4064.Pp 4065.It Ic mode-style Ar style 4066Set window modes style. 4067For how to specify 4068.Ar style , 4069see the 4070.Sx STYLES 4071section. 4072.Pp 4073.It Xo Ic monitor-activity 4074.Op Ic on | off 4075.Xc 4076Monitor for activity in the window. 4077Windows with activity are highlighted in the status line. 4078.Pp 4079.It Xo Ic monitor-bell 4080.Op Ic on | off 4081.Xc 4082Monitor for a bell in the window. 4083Windows with a bell are highlighted in the status line. 4084.Pp 4085.It Xo Ic monitor-silence 4086.Op Ic interval 4087.Xc 4088Monitor for silence (no activity) in the window within 4089.Ic interval 4090seconds. 4091Windows that have been silent for the interval are highlighted in the 4092status line. 4093An interval of zero disables the monitoring. 4094.Pp 4095.It Ic other-pane-height Ar height 4096Set the height of the other panes (not the main pane) in the 4097.Ic main-horizontal 4098layout. 4099If this option is set to 0 (the default), it will have no effect. 4100If both the 4101.Ic main-pane-height 4102and 4103.Ic other-pane-height 4104options are set, the main pane will grow taller to make the other panes the 4105specified height, but will never shrink to do so. 4106If suffixed by 4107.Ql % , 4108this is a percentage of the window size. 4109.Pp 4110.It Ic other-pane-width Ar width 4111Like 4112.Ic other-pane-height , 4113but set the width of other panes in the 4114.Ic main-vertical 4115layout. 4116.Pp 4117.It Ic pane-active-border-style Ar style 4118Set the pane border style for the currently active pane. 4119For how to specify 4120.Ar style , 4121see the 4122.Sx STYLES 4123section. 4124Attributes are ignored. 4125.Pp 4126.It Ic pane-base-index Ar index 4127Like 4128.Ic base-index , 4129but set the starting index for pane numbers. 4130.Pp 4131.It Ic pane-border-format Ar format 4132Set the text shown in pane border status lines. 4133.Pp 4134.It Ic pane-border-lines Ar type 4135Set the type of characters used for drawing pane borders. 4136.Ar type 4137may be one of: 4138.Bl -tag -width Ds 4139.It single 4140single lines using ACS or UTF-8 characters 4141.It double 4142double lines using UTF-8 characters 4143.It heavy 4144heavy lines using UTF-8 characters 4145.It simple 4146simple ASCII characters 4147.It number 4148the pane number 4149.El 4150.Pp 4151.Ql double 4152and 4153.Ql heavy 4154will fall back to standard ACS line drawing when UTF-8 is not supported. 4155.Pp 4156.It Xo Ic pane-border-status 4157.Op Ic off | top | bottom 4158.Xc 4159Turn pane border status lines off or set their position. 4160.Pp 4161.It Ic pane-border-style Ar style 4162Set the pane border style for panes aside from the active pane. 4163For how to specify 4164.Ar style , 4165see the 4166.Sx STYLES 4167section. 4168Attributes are ignored. 4169.Pp 4170.It Ic window-status-activity-style Ar style 4171Set status line style for windows with an activity alert. 4172For how to specify 4173.Ar style , 4174see the 4175.Sx STYLES 4176section. 4177.Pp 4178.It Ic window-status-bell-style Ar style 4179Set status line style for windows with a bell alert. 4180For how to specify 4181.Ar style , 4182see the 4183.Sx STYLES 4184section. 4185.Pp 4186.It Ic window-status-current-format Ar string 4187Like 4188.Ar window-status-format , 4189but is the format used when the window is the current window. 4190.Pp 4191.It Ic window-status-current-style Ar style 4192Set status line style for the currently active window. 4193For how to specify 4194.Ar style , 4195see the 4196.Sx STYLES 4197section. 4198.Pp 4199.It Ic window-status-format Ar string 4200Set the format in which the window is displayed in the status line window list. 4201See the 4202.Sx FORMATS 4203and 4204.Sx STYLES 4205sections. 4206.Pp 4207.It Ic window-status-last-style Ar style 4208Set status line style for the last active window. 4209For how to specify 4210.Ar style , 4211see the 4212.Sx STYLES 4213section. 4214.Pp 4215.It Ic window-status-separator Ar string 4216Sets the separator drawn between windows in the status line. 4217The default is a single space character. 4218.Pp 4219.It Ic window-status-style Ar style 4220Set status line style for a single window. 4221For how to specify 4222.Ar style , 4223see the 4224.Sx STYLES 4225section. 4226.Pp 4227.It Xo Ic window-size 4228.Ar largest | Ar smallest | Ar manual | Ar latest 4229.Xc 4230Configure how 4231.Nm 4232determines the window size. 4233If set to 4234.Ar largest , 4235the size of the largest attached session is used; if 4236.Ar smallest , 4237the size of the smallest. 4238If 4239.Ar manual , 4240the size of a new window is set from the 4241.Ic default-size 4242option and windows are resized automatically. 4243With 4244.Ar latest , 4245.Nm 4246uses the size of the client that had the most recent activity. 4247See also the 4248.Ic resize-window 4249command and the 4250.Ic aggressive-resize 4251option. 4252.Pp 4253.It Xo Ic wrap-search 4254.Op Ic on | off 4255.Xc 4256If this option is set, searches will wrap around the end of the pane contents. 4257The default is on. 4258.El 4259.Pp 4260Available pane options are: 4261.Pp 4262.Bl -tag -width Ds -compact 4263.It Xo Ic allow-rename 4264.Op Ic on | off 4265.Xc 4266Allow programs in the pane to change the window name using a terminal escape 4267sequence (\eek...\ee\e\e). 4268.Pp 4269.It Xo Ic alternate-screen 4270.Op Ic on | off 4271.Xc 4272This option configures whether programs running inside the pane may use the 4273terminal alternate screen feature, which allows the 4274.Em smcup 4275and 4276.Em rmcup 4277.Xr terminfo 5 4278capabilities. 4279The alternate screen feature preserves the contents of the window when an 4280interactive application starts and restores it on exit, so that any output 4281visible before the application starts reappears unchanged after it exits. 4282.Pp 4283.It Xo Ic remain-on-exit 4284.Op Ic on | off | failed 4285.Xc 4286A pane with this flag set is not destroyed when the program running in it 4287exits. 4288If set to 4289.Ic failed , 4290then only when the program exit status is not zero. 4291The pane may be reactivated with the 4292.Ic respawn-pane 4293command. 4294.Pp 4295.It Xo Ic synchronize-panes 4296.Op Ic on | off 4297.Xc 4298Duplicate input to all other panes in the same window where this option is also 4299on (only for panes that are not in any mode). 4300.Pp 4301.It Ic window-active-style Ar style 4302Set the pane style when it is the active pane. 4303For how to specify 4304.Ar style , 4305see the 4306.Sx STYLES 4307section. 4308.Pp 4309.It Ic window-style Ar style 4310Set the pane style. 4311For how to specify 4312.Ar style , 4313see the 4314.Sx STYLES 4315section. 4316.El 4317.Sh HOOKS 4318.Nm 4319allows commands to run on various triggers, called 4320.Em hooks . 4321Most 4322.Nm 4323commands have an 4324.Em after 4325hook and there are a number of hooks not associated with commands. 4326.Pp 4327Hooks are stored as array options, members of the array are executed in 4328order when the hook is triggered. 4329Like options different hooks may be global or belong to a session, window or pane. 4330Hooks may be configured with the 4331.Ic set-hook 4332or 4333.Ic set-option 4334commands and displayed with 4335.Ic show-hooks 4336or 4337.Ic show-options 4338.Fl H . 4339The following two commands are equivalent: 4340.Bd -literal -offset indent. 4341set-hook -g pane-mode-changed[42] 'set -g status-left-style bg=red' 4342set-option -g pane-mode-changed[42] 'set -g status-left-style bg=red' 4343.Ed 4344.Pp 4345Setting a hook without specifying an array index clears the hook and sets the 4346first member of the array. 4347.Pp 4348A command's after 4349hook is run after it completes, except when the command is run as part of a hook 4350itself. 4351They are named with an 4352.Ql after- 4353prefix. 4354For example, the following command adds a hook to select the even-vertical 4355layout after every 4356.Ic split-window : 4357.Bd -literal -offset indent 4358set-hook -g after-split-window "selectl even-vertical" 4359.Ed 4360.Pp 4361All the notifications listed in the 4362.Sx CONTROL MODE 4363section are hooks (without any arguments), except 4364.Ic %exit . 4365The following additional hooks are available: 4366.Bl -tag -width "XXXXXXXXXXXXXXXXXXXXXX" 4367.It alert-activity 4368Run when a window has activity. 4369See 4370.Ic monitor-activity . 4371.It alert-bell 4372Run when a window has received a bell. 4373See 4374.Ic monitor-bell . 4375.It alert-silence 4376Run when a window has been silent. 4377See 4378.Ic monitor-silence . 4379.It client-attached 4380Run when a client is attached. 4381.It client-detached 4382Run when a client is detached 4383.It client-resized 4384Run when a client is resized. 4385.It client-session-changed 4386Run when a client's attached session is changed. 4387.It pane-died 4388Run when the program running in a pane exits, but 4389.Ic remain-on-exit 4390is on so the pane has not closed. 4391.It pane-exited 4392Run when the program running in a pane exits. 4393.It pane-focus-in 4394Run when the focus enters a pane, if the 4395.Ic focus-events 4396option is on. 4397.It pane-focus-out 4398Run when the focus exits a pane, if the 4399.Ic focus-events 4400option is on. 4401.It pane-set-clipboard 4402Run when the terminal clipboard is set using the 4403.Xr xterm 1 4404escape sequence. 4405.It session-created 4406Run when a new session created. 4407.It session-closed 4408Run when a session closed. 4409.It session-renamed 4410Run when a session is renamed. 4411.It window-linked 4412Run when a window is linked into a session. 4413.It window-renamed 4414Run when a window is renamed. 4415.It window-unlinked 4416Run when a window is unlinked from a session. 4417.El 4418.Pp 4419Hooks are managed with these commands: 4420.Bl -tag -width Ds 4421.It Xo Ic set-hook 4422.Op Fl agpRuw 4423.Op Fl t Ar target-pane 4424.Ar hook-name 4425.Ar command 4426.Xc 4427Without 4428.Fl R , 4429sets (or with 4430.Fl u 4431unsets) hook 4432.Ar hook-name 4433to 4434.Ar command . 4435The flags are the same as for 4436.Ic set-option . 4437.Pp 4438With 4439.Fl R , 4440run 4441.Ar hook-name 4442immediately. 4443.It Xo Ic show-hooks 4444.Op Fl gpw 4445.Op Fl t Ar target-pane 4446.Xc 4447Shows hooks. 4448The flags are the same as for 4449.Ic show-options . 4450.El 4451.Sh MOUSE SUPPORT 4452If the 4453.Ic mouse 4454option is on (the default is off), 4455.Nm 4456allows mouse events to be bound as keys. 4457The name of each key is made up of a mouse event (such as 4458.Ql MouseUp1 ) 4459and a location suffix, one of the following: 4460.Bl -column "XXXXXXXXXXXXX" -offset indent 4461.It Li "Pane" Ta "the contents of a pane" 4462.It Li "Border" Ta "a pane border" 4463.It Li "Status" Ta "the status line window list" 4464.It Li "StatusLeft" Ta "the left part of the status line" 4465.It Li "StatusRight" Ta "the right part of the status line" 4466.It Li "StatusDefault" Ta "any other part of the status line" 4467.El 4468.Pp 4469The following mouse events are available: 4470.Bl -column "MouseDown1" "MouseDrag1" "WheelDown" -offset indent 4471.It Li "WheelUp" Ta "WheelDown" Ta "" 4472.It Li "MouseDown1" Ta "MouseUp1" Ta "MouseDrag1" Ta "MouseDragEnd1" 4473.It Li "MouseDown2" Ta "MouseUp2" Ta "MouseDrag2" Ta "MouseDragEnd2" 4474.It Li "MouseDown3" Ta "MouseUp3" Ta "MouseDrag3" Ta "MouseDragEnd3" 4475.It Li "SecondClick1" Ta "SecondClick2" Ta "SecondClick3" 4476.It Li "DoubleClick1" Ta "DoubleClick2" Ta "DoubleClick3" 4477.It Li "TripleClick1" Ta "TripleClick2" Ta "TripleClick3" 4478.El 4479.Pp 4480The 4481.Ql SecondClick 4482events are fired for the second click of a double click, even if there may be a 4483third click which will fire 4484.Ql TripleClick 4485instead of 4486.Ql DoubleClick . 4487.Pp 4488Each should be suffixed with a location, for example 4489.Ql MouseDown1Status . 4490.Pp 4491The special token 4492.Ql {mouse} 4493or 4494.Ql = 4495may be used as 4496.Ar target-window 4497or 4498.Ar target-pane 4499in commands bound to mouse key bindings. 4500It resolves to the window or pane over which the mouse event took place 4501(for example, the window in the status line over which button 1 was released for a 4502.Ql MouseUp1Status 4503binding, or the pane over which the wheel was scrolled for a 4504.Ql WheelDownPane 4505binding). 4506.Pp 4507The 4508.Ic send-keys 4509.Fl M 4510flag may be used to forward a mouse event to a pane. 4511.Pp 4512The default key bindings allow the mouse to be used to select and resize panes, 4513to copy text and to change window using the status line. 4514These take effect if the 4515.Ic mouse 4516option is turned on. 4517.Sh FORMATS 4518Certain commands accept the 4519.Fl F 4520flag with a 4521.Ar format 4522argument. 4523This is a string which controls the output format of the command. 4524Format variables are enclosed in 4525.Ql #{ 4526and 4527.Ql } , 4528for example 4529.Ql #{session_name} . 4530The possible variables are listed in the table below, or the name of a 4531.Nm 4532option may be used for an option's value. 4533Some variables have a shorter alias such as 4534.Ql #S ; 4535.Ql ## 4536is replaced by a single 4537.Ql # , 4538.Ql #, 4539by a 4540.Ql \&, 4541and 4542.Ql #} 4543by a 4544.Ql } . 4545.Pp 4546Conditionals are available by prefixing with 4547.Ql \&? 4548and separating two alternatives with a comma; 4549if the specified variable exists and is not zero, the first alternative 4550is chosen, otherwise the second is used. 4551For example 4552.Ql #{?session_attached,attached,not attached} 4553will include the string 4554.Ql attached 4555if the session is attached and the string 4556.Ql not attached 4557if it is unattached, or 4558.Ql #{?automatic-rename,yes,no} 4559will include 4560.Ql yes 4561if 4562.Ic automatic-rename 4563is enabled, or 4564.Ql no 4565if not. 4566Conditionals can be nested arbitrarily. 4567Inside a conditional, 4568.Ql \&, 4569and 4570.Ql } 4571must be escaped as 4572.Ql #, 4573and 4574.Ql #} , 4575unless they are part of a 4576.Ql #{...} 4577replacement. 4578For example: 4579.Bd -literal -offset indent 4580#{?pane_in_mode,#[fg=white#,bg=red],#[fg=red#,bg=white]}#W . 4581.Ed 4582.Pp 4583String comparisons may be expressed by prefixing two comma-separated 4584alternatives by 4585.Ql == , 4586.Ql != , 4587.Ql < , 4588.Ql > , 4589.Ql <= 4590or 4591.Ql >= 4592and a colon. 4593For example 4594.Ql #{==:#{host},myhost} 4595will be replaced by 4596.Ql 1 4597if running on 4598.Ql myhost , 4599otherwise by 4600.Ql 0 . 4601.Ql || 4602and 4603.Ql && 4604evaluate to true if either or both of two comma-separated alternatives are 4605true, for example 4606.Ql #{||:#{pane_in_mode},#{alternate_on}} . 4607.Pp 4608An 4609.Ql m 4610specifies an 4611.Xr fnmatch 3 4612or regular expression comparison. 4613The first argument is the pattern and the second the string to compare. 4614An optional argument specifies flags: 4615.Ql r 4616means the pattern is a regular expression instead of the default 4617.Xr fnmatch 3 4618pattern, and 4619.Ql i 4620means to ignore case. 4621For example: 4622.Ql #{m:*foo*,#{host}} 4623or 4624.Ql #{m/ri:^A,MYVAR} . 4625A 4626.Ql C 4627performs a search for an 4628.Xr fnmatch 3 4629pattern or regular expression in the pane content and evaluates to zero if not 4630found, or a line number if found. 4631Like 4632.Ql m , 4633an 4634.Ql r 4635flag means search for a regular expression and 4636.Ql i 4637ignores case. 4638For example: 4639.Ql #{C/r:^Start} 4640.Pp 4641Numeric operators may be performed by prefixing two comma-separated alternatives with an 4642.Ql e 4643and an operator. 4644An optional 4645.Ql f 4646flag may be given after the operator to use floating point numbers, otherwise integers are used. 4647This may be followed by a number giving the number of decimal places to use for the result. 4648The available operators are: 4649addition 4650.Ql + , 4651subtraction 4652.Ql - , 4653multiplication 4654.Ql * , 4655division 4656.Ql / , 4657modulus 4658.Ql m 4659or 4660.Ql % 4661(note that 4662.Ql % 4663must be escaped as 4664.Ql %% 4665in formats which are also expanded by 4666.Xr strftime 3 ) 4667and numeric comparison operators 4668.Ql == , 4669.Ql != , 4670.Ql < , 4671.Ql <= , 4672.Ql > 4673and 4674.Ql >= . 4675For example, 4676.Ql #{e|*|f|4:5.5,3} 4677multiplies 5.5 by 3 for a result with four decimal places and 4678.Ql #{e|%%:7,3} 4679returns the modulus of 7 and 3. 4680.Ql a 4681replaces a numeric argument by its ASCII equivalent, so 4682.Ql #{a:98} 4683results in 4684.Ql b . 4685.Pp 4686A limit may be placed on the length of the resultant string by prefixing it 4687by an 4688.Ql = , 4689a number and a colon. 4690Positive numbers count from the start of the string and negative from the end, 4691so 4692.Ql #{=5:pane_title} 4693will include at most the first five characters of the pane title, or 4694.Ql #{=-5:pane_title} 4695the last five characters. 4696A suffix or prefix may be given as a second argument - if provided then it is 4697appended or prepended to the string if the length has been trimmed, for example 4698.Ql #{=/5/...:pane_title} 4699will append 4700.Ql ... 4701if the pane title is more than five characters. 4702Similarly, 4703.Ql p 4704pads the string to a given width, for example 4705.Ql #{p10:pane_title} 4706will result in a width of at least 10 characters. 4707A positive width pads on the left, a negative on the right. 4708.Ql n 4709expands to the length of the variable and 4710.Ql w 4711to its width when displayed, for example 4712.Ql #{n:window_name} . 4713.Pp 4714Prefixing a time variable with 4715.Ql t:\& 4716will convert it to a string, so if 4717.Ql #{window_activity} 4718gives 4719.Ql 1445765102 , 4720.Ql #{t:window_activity} 4721gives 4722.Ql Sun Oct 25 09:25:02 2015 . 4723Adding 4724.Ql p ( 4725.Ql `t/p` ) 4726will use shorter but less accurate time format for times in the past. 4727A custom format may be given using an 4728.Ql f 4729suffix (note that 4730.Ql % 4731must be escaped as 4732.Ql %% 4733if the format is separately being passed through 4734.Xr strftime 3 , 4735for example in the 4736.Ic status-left 4737option): 4738.Ql #{t/f/%%H#:%%M:window_activity} , 4739see 4740.Xr strftime 3 . 4741.Pp 4742The 4743.Ql b:\& 4744and 4745.Ql d:\& 4746prefixes are 4747.Xr basename 3 4748and 4749.Xr dirname 3 4750of the variable respectively. 4751.Ql q:\& 4752will escape 4753.Xr sh 1 4754special characters or with a 4755.Ql h 4756suffix, escape hash characters (so 4757.Ql # 4758becomes 4759.Ql ## ) . 4760.Ql E:\& 4761will expand the format twice, for example 4762.Ql #{E:status-left} 4763is the result of expanding the content of the 4764.Ic status-left 4765option rather than the option itself. 4766.Ql T:\& 4767is like 4768.Ql E:\& 4769but also expands 4770.Xr strftime 3 4771specifiers. 4772.Ql S:\& , 4773.Ql W:\& 4774or 4775.Ql P:\& 4776will loop over each session, window or pane and insert the format once 4777for each. 4778For windows and panes, two comma-separated formats may be given: 4779the second is used for the current window or active pane. 4780For example, to get a list of windows formatted like the status line: 4781.Bd -literal -offset indent 4782#{W:#{E:window-status-format} ,#{E:window-status-current-format} } 4783.Ed 4784.Pp 4785.Ql N:\& 4786checks if a window (without any suffix or with the 4787.Ql w 4788suffix) or a session (with the 4789.Ql s 4790suffix) name exists, for example 4791.Ql `N/w:foo` 4792is replaced with 1 if a window named 4793.Ql foo 4794exists. 4795.Pp 4796A prefix of the form 4797.Ql s/foo/bar/:\& 4798will substitute 4799.Ql foo 4800with 4801.Ql bar 4802throughout. 4803The first argument may be an extended regular expression and a final argument may be 4804.Ql i 4805to ignore case, for example 4806.Ql s/a(.)/\e1x/i:\& 4807would change 4808.Ql abABab 4809into 4810.Ql bxBxbx . 4811.Pp 4812In addition, the last line of a shell command's output may be inserted using 4813.Ql #() . 4814For example, 4815.Ql #(uptime) 4816will insert the system's uptime. 4817When constructing formats, 4818.Nm 4819does not wait for 4820.Ql #() 4821commands to finish; instead, the previous result from running the same command is used, 4822or a placeholder if the command has not been run before. 4823If the command hasn't exited, the most recent line of output will be used, but the status 4824line will not be updated more than once a second. 4825Commands are executed with the 4826.Nm 4827global environment set (see the 4828.Sx GLOBAL AND SESSION ENVIRONMENT 4829section). 4830.Pp 4831An 4832.Ql l 4833specifies that a string should be interpreted literally and not expanded. 4834For example 4835.Ql #{l:#{?pane_in_mode,yes,no}} 4836will be replaced by 4837.Ql #{?pane_in_mode,yes,no} . 4838.Pp 4839The following variables are available, where appropriate: 4840.Bl -column "XXXXXXXXXXXXXXXXXXX" "XXXXX" 4841.It Sy "Variable name" Ta Sy "Alias" Ta Sy "Replaced with" 4842.It Li "active_window_index" Ta "" Ta "Index of active window in session" 4843.It Li "alternate_on" Ta "" Ta "1 if pane is in alternate screen" 4844.It Li "alternate_saved_x" Ta "" Ta "Saved cursor X in alternate screen" 4845.It Li "alternate_saved_y" Ta "" Ta "Saved cursor Y in alternate screen" 4846.It Li "buffer_created" Ta "" Ta "Time buffer created" 4847.It Li "buffer_name" Ta "" Ta "Name of buffer" 4848.It Li "buffer_sample" Ta "" Ta "Sample of start of buffer" 4849.It Li "buffer_size" Ta "" Ta "Size of the specified buffer in bytes" 4850.It Li "client_activity" Ta "" Ta "Time client last had activity" 4851.It Li "client_cell_height" Ta "" Ta "Height of each client cell in pixels" 4852.It Li "client_cell_width" Ta "" Ta "Width of each client cell in pixels" 4853.It Li "client_control_mode" Ta "" Ta "1 if client is in control mode" 4854.It Li "client_created" Ta "" Ta "Time client created" 4855.It Li "client_discarded" Ta "" Ta "Bytes discarded when client behind" 4856.It Li "client_flags" Ta "" Ta "List of client flags" 4857.It Li "client_height" Ta "" Ta "Height of client" 4858.It Li "client_key_table" Ta "" Ta "Current key table" 4859.It Li "client_last_session" Ta "" Ta "Name of the client's last session" 4860.It Li "client_name" Ta "" Ta "Name of client" 4861.It Li "client_pid" Ta "" Ta "PID of client process" 4862.It Li "client_prefix" Ta "" Ta "1 if prefix key has been pressed" 4863.It Li "client_readonly" Ta "" Ta "1 if client is readonly" 4864.It Li "client_session" Ta "" Ta "Name of the client's session" 4865.It Li "client_termfeatures" Ta "" Ta "Terminal features of client, if any" 4866.It Li "client_termname" Ta "" Ta "Terminal name of client" 4867.It Li "client_termtype" Ta "" Ta "Terminal type of client, if available" 4868.It Li "client_tty" Ta "" Ta "Pseudo terminal of client" 4869.It Li "client_utf8" Ta "" Ta "1 if client supports UTF-8" 4870.It Li "client_width" Ta "" Ta "Width of client" 4871.It Li "client_written" Ta "" Ta "Bytes written to client" 4872.It Li "command" Ta "" Ta "Name of command in use, if any" 4873.It Li "command_list_alias" Ta "" Ta "Command alias if listing commands" 4874.It Li "command_list_name" Ta "" Ta "Command name if listing commands" 4875.It Li "command_list_usage" Ta "" Ta "Command usage if listing commands" 4876.It Li "config_files" Ta "" Ta "List of configuration files loaded" 4877.It Li "copy_cursor_line" Ta "" Ta "Line the cursor is on in copy mode" 4878.It Li "copy_cursor_word" Ta "" Ta "Word under cursor in copy mode" 4879.It Li "copy_cursor_x" Ta "" Ta "Cursor X position in copy mode" 4880.It Li "copy_cursor_y" Ta "" Ta "Cursor Y position in copy mode" 4881.It Li "current_file" Ta "" Ta "Current configuration file" 4882.It Li "cursor_character" Ta "" Ta "Character at cursor in pane" 4883.It Li "cursor_flag" Ta "" Ta "Pane cursor flag" 4884.It Li "cursor_x" Ta "" Ta "Cursor X position in pane" 4885.It Li "cursor_y" Ta "" Ta "Cursor Y position in pane" 4886.It Li "history_bytes" Ta "" Ta "Number of bytes in window history" 4887.It Li "history_limit" Ta "" Ta "Maximum window history lines" 4888.It Li "history_size" Ta "" Ta "Size of history in lines" 4889.It Li "hook" Ta "" Ta "Name of running hook, if any" 4890.It Li "hook_pane" Ta "" Ta "ID of pane where hook was run, if any" 4891.It Li "hook_session" Ta "" Ta "ID of session where hook was run, if any" 4892.It Li "hook_session_name" Ta "" Ta "Name of session where hook was run, if any" 4893.It Li "hook_window" Ta "" Ta "ID of window where hook was run, if any" 4894.It Li "hook_window_name" Ta "" Ta "Name of window where hook was run, if any" 4895.It Li "host" Ta "#H" Ta "Hostname of local host" 4896.It Li "host_short" Ta "#h" Ta "Hostname of local host (no domain name)" 4897.It Li "insert_flag" Ta "" Ta "Pane insert flag" 4898.It Li "keypad_cursor_flag" Ta "" Ta "Pane keypad cursor flag" 4899.It Li "keypad_flag" Ta "" Ta "Pane keypad flag" 4900.It Li "last_window_index" Ta "" Ta "Index of last window in session" 4901.It Li "line" Ta "" Ta "Line number in the list" 4902.It Li "mouse_all_flag" Ta "" Ta "Pane mouse all flag" 4903.It Li "mouse_any_flag" Ta "" Ta "Pane mouse any flag" 4904.It Li "mouse_button_flag" Ta "" Ta "Pane mouse button flag" 4905.It Li "mouse_line" Ta "" Ta "Line under mouse, if any" 4906.It Li "mouse_sgr_flag" Ta "" Ta "Pane mouse SGR flag" 4907.It Li "mouse_standard_flag" Ta "" Ta "Pane mouse standard flag" 4908.It Li "mouse_utf8_flag" Ta "" Ta "Pane mouse UTF-8 flag" 4909.It Li "mouse_word" Ta "" Ta "Word under mouse, if any" 4910.It Li "mouse_x" Ta "" Ta "Mouse X position, if any" 4911.It Li "mouse_y" Ta "" Ta "Mouse Y position, if any" 4912.It Li "origin_flag" Ta "" Ta "Pane origin flag" 4913.It Li "pane_active" Ta "" Ta "1 if active pane" 4914.It Li "pane_at_bottom" Ta "" Ta "1 if pane is at the bottom of window" 4915.It Li "pane_at_left" Ta "" Ta "1 if pane is at the left of window" 4916.It Li "pane_at_right" Ta "" Ta "1 if pane is at the right of window" 4917.It Li "pane_at_top" Ta "" Ta "1 if pane is at the top of window" 4918.It Li "pane_bg" Ta "" Ta "Pane background colour" 4919.It Li "pane_bottom" Ta "" Ta "Bottom of pane" 4920.It Li "pane_current_command" Ta "" Ta "Current command if available" 4921.It Li "pane_current_path" Ta "" Ta "Current path if available" 4922.It Li "pane_dead" Ta "" Ta "1 if pane is dead" 4923.It Li "pane_dead_status" Ta "" Ta "Exit status of process in dead pane" 4924.It Li "pane_fg" Ta "" Ta "Pane foreground colour" 4925.It Li "pane_format" Ta "" Ta "1 if format is for a pane" 4926.It Li "pane_height" Ta "" Ta "Height of pane" 4927.It Li "pane_id" Ta "#D" Ta "Unique pane ID" 4928.It Li "pane_in_mode" Ta "" Ta "1 if pane is in a mode" 4929.It Li "pane_index" Ta "#P" Ta "Index of pane" 4930.It Li "pane_input_off" Ta "" Ta "1 if input to pane is disabled" 4931.It Li "pane_last" Ta "" Ta "1 if last pane" 4932.It Li "pane_left" Ta "" Ta "Left of pane" 4933.It Li "pane_marked" Ta "" Ta "1 if this is the marked pane" 4934.It Li "pane_marked_set" Ta "" Ta "1 if a marked pane is set" 4935.It Li "pane_mode" Ta "" Ta "Name of pane mode, if any" 4936.It Li "pane_path" Ta "" Ta "Path of pane (can be set by application)" 4937.It Li "pane_pid" Ta "" Ta "PID of first process in pane" 4938.It Li "pane_pipe" Ta "" Ta "1 if pane is being piped" 4939.It Li "pane_right" Ta "" Ta "Right of pane" 4940.It Li "pane_search_string" Ta "" Ta "Last search string in copy mode" 4941.It Li "pane_start_command" Ta "" Ta "Command pane started with" 4942.It Li "pane_synchronized" Ta "" Ta "1 if pane is synchronized" 4943.It Li "pane_tabs" Ta "" Ta "Pane tab positions" 4944.It Li "pane_title" Ta "#T" Ta "Title of pane (can be set by application)" 4945.It Li "pane_top" Ta "" Ta "Top of pane" 4946.It Li "pane_tty" Ta "" Ta "Pseudo terminal of pane" 4947.It Li "pane_width" Ta "" Ta "Width of pane" 4948.It Li "pid" Ta "" Ta "Server PID" 4949.It Li "rectangle_toggle" Ta "" Ta "1 if rectangle selection is activated" 4950.It Li "scroll_position" Ta "" Ta "Scroll position in copy mode" 4951.It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane" 4952.It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane" 4953.It Li "search_match" Ta "" Ta "Search match if any" 4954.It Li "search_present" Ta "" Ta "1 if search started in copy mode" 4955.It Li "selection_active" Ta "" Ta "1 if selection started and changes with the cursor in copy mode" 4956.It Li "selection_end_x" Ta "" Ta "X position of the end of the selection" 4957.It Li "selection_end_y" Ta "" Ta "Y position of the end of the selection" 4958.It Li "selection_present" Ta "" Ta "1 if selection started in copy mode" 4959.It Li "selection_start_x" Ta "" Ta "X position of the start of the selection" 4960.It Li "selection_start_y" Ta "" Ta "Y position of the start of the selection" 4961.It Li "session_activity" Ta "" Ta "Time of session last activity" 4962.It Li "session_alerts" Ta "" Ta "List of window indexes with alerts" 4963.It Li "session_attached" Ta "" Ta "Number of clients session is attached to" 4964.It Li "session_attached_list" Ta "" Ta "List of clients session is attached to" 4965.It Li "session_created" Ta "" Ta "Time session created" 4966.It Li "session_format" Ta "" Ta "1 if format is for a session" 4967.It Li "session_group" Ta "" Ta "Name of session group" 4968.It Li "session_group_attached" Ta "" Ta "Number of clients sessions in group are attached to" 4969.It Li "session_group_attached_list" Ta "" Ta "List of clients sessions in group are attached to" 4970.It Li "session_group_list" Ta "" Ta "List of sessions in group" 4971.It Li "session_group_many_attached" Ta "" Ta "1 if multiple clients attached to sessions in group" 4972.It Li "session_group_size" Ta "" Ta "Size of session group" 4973.It Li "session_grouped" Ta "" Ta "1 if session in a group" 4974.It Li "session_id" Ta "" Ta "Unique session ID" 4975.It Li "session_last_attached" Ta "" Ta "Time session last attached" 4976.It Li "session_many_attached" Ta "" Ta "1 if multiple clients attached" 4977.It Li "session_marked" Ta "" Ta "1 if this session contains the marked pane" 4978.It Li "session_name" Ta "#S" Ta "Name of session" 4979.It Li "session_path" Ta "" Ta "Working directory of session" 4980.It Li "session_stack" Ta "" Ta "Window indexes in most recent order" 4981.It Li "session_windows" Ta "" Ta "Number of windows in session" 4982.It Li "socket_path" Ta "" Ta "Server socket path" 4983.It Li "start_time" Ta "" Ta "Server start time" 4984.It Li "version" Ta "" Ta "Server version" 4985.It Li "window_active" Ta "" Ta "1 if window active" 4986.It Li "window_active_clients" Ta "" Ta "Number of clients viewing this window" 4987.It Li "window_active_clients_list" Ta "" Ta "List of clients viewing this window" 4988.It Li "window_active_sessions" Ta "" Ta "Number of sessions on which this window is active" 4989.It Li "window_active_sessions_list" Ta "" Ta "List of sessions on which this window is active" 4990.It Li "window_activity" Ta "" Ta "Time of window last activity" 4991.It Li "window_activity_flag" Ta "" Ta "1 if window has activity" 4992.It Li "window_bell_flag" Ta "" Ta "1 if window has bell" 4993.It Li "window_bigger" Ta "" Ta "1 if window is larger than client" 4994.It Li "window_cell_height" Ta "" Ta "Height of each cell in pixels" 4995.It Li "window_cell_width" Ta "" Ta "Width of each cell in pixels" 4996.It Li "window_end_flag" Ta "" Ta "1 if window has the highest index" 4997.It Li "window_flags" Ta "#F" Ta "Window flags with # escaped as ##" 4998.It Li "window_raw_flags" Ta "" Ta "Window flags with nothing escaped" 4999.It Li "window_format" Ta "" Ta "1 if format is for a window" 5000.It Li "window_height" Ta "" Ta "Height of window" 5001.It Li "window_id" Ta "" Ta "Unique window ID" 5002.It Li "window_index" Ta "#I" Ta "Index of window" 5003.It Li "window_last_flag" Ta "" Ta "1 if window is the last used" 5004.It Li "window_layout" Ta "" Ta "Window layout description, ignoring zoomed window panes" 5005.It Li "window_linked" Ta "" Ta "1 if window is linked across sessions" 5006.It Li "window_linked_sessions" Ta "" Ta "Number of sessions this window is linked to" 5007.It Li "window_linked_sessions_list" Ta "" Ta "List of sessions this window is linked to" 5008.It Li "window_marked_flag" Ta "" Ta "1 if window contains the marked pane" 5009.It Li "window_name" Ta "#W" Ta "Name of window" 5010.It Li "window_offset_x" Ta "" Ta "X offset into window if larger than client" 5011.It Li "window_offset_y" Ta "" Ta "Y offset into window if larger than client" 5012.It Li "window_panes" Ta "" Ta "Number of panes in window" 5013.It Li "window_silence_flag" Ta "" Ta "1 if window has silence alert" 5014.It Li "window_stack_index" Ta "" Ta "Index in session most recent stack" 5015.It Li "window_start_flag" Ta "" Ta "1 if window has the lowest index" 5016.It Li "window_visible_layout" Ta "" Ta "Window layout description, respecting zoomed window panes" 5017.It Li "window_width" Ta "" Ta "Width of window" 5018.It Li "window_zoomed_flag" Ta "" Ta "1 if window is zoomed" 5019.It Li "wrap_flag" Ta "" Ta "Pane wrap flag" 5020.El 5021.Sh STYLES 5022.Nm 5023offers various options to specify the colour and attributes of aspects of the 5024interface, for example 5025.Ic status-style 5026for the status line. 5027In addition, embedded styles may be specified in format options, such as 5028.Ic status-left , 5029by enclosing them in 5030.Ql #[ 5031and 5032.Ql \&] . 5033.Pp 5034A style may be the single term 5035.Ql default 5036to specify the default style (which may come from an option, for example 5037.Ic status-style 5038in the status line) or a space 5039or comma separated list of the following: 5040.Bl -tag -width Ds 5041.It Ic fg=colour 5042Set the foreground colour. 5043The colour is one of: 5044.Ic black , 5045.Ic red , 5046.Ic green , 5047.Ic yellow , 5048.Ic blue , 5049.Ic magenta , 5050.Ic cyan , 5051.Ic white ; 5052if supported the bright variants 5053.Ic brightred , 5054.Ic brightgreen , 5055.Ic brightyellow ; 5056.Ic colour0 5057to 5058.Ic colour255 5059from the 256-colour set; 5060.Ic default 5061for the default colour; 5062.Ic terminal 5063for the terminal default colour; or a hexadecimal RGB string such as 5064.Ql #ffffff . 5065.It Ic bg=colour 5066Set the background colour. 5067.It Ic none 5068Set no attributes (turn off any active attributes). 5069.It Xo Ic acs , 5070.Ic bright 5071(or 5072.Ic bold ) , 5073.Ic dim , 5074.Ic underscore , 5075.Ic blink , 5076.Ic reverse , 5077.Ic hidden , 5078.Ic italics , 5079.Ic overline , 5080.Ic strikethrough , 5081.Ic double-underscore , 5082.Ic curly-underscore , 5083.Ic dotted-underscore , 5084.Ic dashed-underscore 5085.Xc 5086Set an attribute. 5087Any of the attributes may be prefixed with 5088.Ql no 5089to unset. 5090.Ic acs 5091is the terminal alternate character set. 5092.It Xo Ic align=left 5093(or 5094.Ic noalign ) , 5095.Ic align=centre , 5096.Ic align=right 5097.Xc 5098Align text to the left, centre or right of the available space if appropriate. 5099.It Ic fill=colour 5100Fill the available space with a background colour if appropriate. 5101.It Xo Ic list=on , 5102.Ic list=focus , 5103.Ic list=left-marker , 5104.Ic list=right-marker , 5105.Ic nolist 5106.Xc 5107Mark the position of the various window list components in the 5108.Ic status-format 5109option: 5110.Ic list=on 5111marks the start of the list; 5112.Ic list=focus 5113is the part of the list that should be kept in focus if the entire list won't fit 5114in the available space (typically the current window); 5115.Ic list=left-marker 5116and 5117.Ic list=right-marker 5118mark the text to be used to mark that text has been trimmed from the left or 5119right of the list if there is not enough space. 5120.It Xo Ic push-default , 5121.Ic pop-default 5122.Xc 5123Store the current colours and attributes as the default or reset to the previous 5124default. 5125A 5126.Ic push-default 5127affects any subsequent use of the 5128.Ic default 5129term until a 5130.Ic pop-default . 5131Only one default may be pushed (each 5132.Ic push-default 5133replaces the previous saved default). 5134.It Xo Ic range=left , 5135.Ic range=right , 5136.Ic range=window|X , 5137.Ic norange 5138.Xc 5139Mark a range in the 5140.Ic status-format 5141option. 5142.Ic range=left 5143and 5144.Ic range=right 5145are the text used for the 5146.Ql StatusLeft 5147and 5148.Ql StatusRight 5149mouse keys. 5150.Ic range=window|X 5151is the range for a window passed to the 5152.Ql Status 5153mouse key, where 5154.Ql X 5155is a window index. 5156.El 5157.Pp 5158Examples are: 5159.Bd -literal -offset indent 5160fg=yellow bold underscore blink 5161bg=black,fg=default,noreverse 5162.Ed 5163.Sh NAMES AND TITLES 5164.Nm 5165distinguishes between names and titles. 5166Windows and sessions have names, which may be used to specify them in targets 5167and are displayed in the status line and various lists: the name is the 5168.Nm 5169identifier for a window or session. 5170Only panes have titles. 5171A pane's title is typically set by the program running inside the pane using 5172an escape sequence (like it would set the 5173.Xr xterm 1 5174window title in 5175.Xr X 7 ) . 5176Windows themselves do not have titles - a window's title is the title of its 5177active pane. 5178.Nm 5179itself may set the title of the terminal in which the client is running, see 5180the 5181.Ic set-titles 5182option. 5183.Pp 5184A session's name is set with the 5185.Ic new-session 5186and 5187.Ic rename-session 5188commands. 5189A window's name is set with one of: 5190.Bl -enum -width Ds 5191.It 5192A command argument (such as 5193.Fl n 5194for 5195.Ic new-window 5196or 5197.Ic new-session ) . 5198.It 5199An escape sequence (if the 5200.Ic allow-rename 5201option is turned on): 5202.Bd -literal -offset indent 5203$ printf '\e033kWINDOW_NAME\e033\e\e' 5204.Ed 5205.It 5206Automatic renaming, which sets the name to the active command in the window's 5207active pane. 5208See the 5209.Ic automatic-rename 5210option. 5211.El 5212.Pp 5213When a pane is first created, its title is the hostname. 5214A pane's title can be set via the title setting escape sequence, for example: 5215.Bd -literal -offset indent 5216$ printf '\e033]2;My Title\e033\e\e' 5217.Ed 5218.Pp 5219It can also be modified with the 5220.Ic select-pane 5221.Fl T 5222command. 5223.Sh GLOBAL AND SESSION ENVIRONMENT 5224When the server is started, 5225.Nm 5226copies the environment into the 5227.Em global environment ; 5228in addition, each session has a 5229.Em session environment . 5230When a window is created, the session and global environments are merged. 5231If a variable exists in both, the value from the session environment is used. 5232The result is the initial environment passed to the new process. 5233.Pp 5234The 5235.Ic update-environment 5236session option may be used to update the session environment from the client 5237when a new session is created or an old reattached. 5238.Nm 5239also initialises the 5240.Ev TMUX 5241variable with some internal information to allow commands to be executed 5242from inside, and the 5243.Ev TERM 5244variable with the correct terminal setting of 5245.Ql screen . 5246.Pp 5247Variables in both session and global environments may be marked as hidden. 5248Hidden variables are not passed into the environment of new processes and 5249instead can only be used by tmux itself (for example in formats, see the 5250.Sx FORMATS 5251section). 5252.Pp 5253Commands to alter and view the environment are: 5254.Bl -tag -width Ds 5255.It Xo Ic set-environment 5256.Op Fl Fhgru 5257.Op Fl t Ar target-session 5258.Ar name Op Ar value 5259.Xc 5260.D1 (alias: Ic setenv ) 5261Set or unset an environment variable. 5262If 5263.Fl g 5264is used, the change is made in the global environment; otherwise, it is applied 5265to the session environment for 5266.Ar target-session . 5267If 5268.Fl F 5269is present, then 5270.Ar value 5271is expanded as a format. 5272The 5273.Fl u 5274flag unsets a variable. 5275.Fl r 5276indicates the variable is to be removed from the environment before starting a 5277new process. 5278.Fl h 5279marks the variable as hidden. 5280.It Xo Ic show-environment 5281.Op Fl hgs 5282.Op Fl t Ar target-session 5283.Op Ar variable 5284.Xc 5285.D1 (alias: Ic showenv ) 5286Display the environment for 5287.Ar target-session 5288or the global environment with 5289.Fl g . 5290If 5291.Ar variable 5292is omitted, all variables are shown. 5293Variables removed from the environment are prefixed with 5294.Ql - . 5295If 5296.Fl s 5297is used, the output is formatted as a set of Bourne shell commands. 5298.Fl h 5299shows hidden variables (omitted by default). 5300.El 5301.Sh STATUS LINE 5302.Nm 5303includes an optional status line which is displayed in the bottom line of each 5304terminal. 5305.Pp 5306By default, the status line is enabled and one line in height (it may be 5307disabled or made multiple lines with the 5308.Ic status 5309session option) and contains, from left-to-right: the name of the current 5310session in square brackets; the window list; the title of the active pane 5311in double quotes; and the time and date. 5312.Pp 5313Each line of the status line is configured with the 5314.Ic status-format 5315option. 5316The default is made of three parts: configurable left and right sections (which 5317may contain dynamic content such as the time or output from a shell command, 5318see the 5319.Ic status-left , 5320.Ic status-left-length , 5321.Ic status-right , 5322and 5323.Ic status-right-length 5324options below), and a central window list. 5325By default, the window list shows the index, name and (if any) flag of the 5326windows present in the current session in ascending numerical order. 5327It may be customised with the 5328.Ar window-status-format 5329and 5330.Ar window-status-current-format 5331options. 5332The flag is one of the following symbols appended to the window name: 5333.Bl -column "Symbol" "Meaning" -offset indent 5334.It Sy "Symbol" Ta Sy "Meaning" 5335.It Li "*" Ta "Denotes the current window." 5336.It Li "-" Ta "Marks the last window (previously selected)." 5337.It Li "#" Ta "Window activity is monitored and activity has been detected." 5338.It Li "\&!" Ta "Window bells are monitored and a bell has occurred in the window." 5339.It Li "~" Ta "The window has been silent for the monitor-silence interval." 5340.It Li "M" Ta "The window contains the marked pane." 5341.It Li "Z" Ta "The window's active pane is zoomed." 5342.El 5343.Pp 5344The # symbol relates to the 5345.Ic monitor-activity 5346window option. 5347The window name is printed in inverted colours if an alert (bell, activity or 5348silence) is present. 5349.Pp 5350The colour and attributes of the status line may be configured, the entire 5351status line using the 5352.Ic status-style 5353session option and individual windows using the 5354.Ic window-status-style 5355window option. 5356.Pp 5357The status line is automatically refreshed at interval if it has changed, the 5358interval may be controlled with the 5359.Ic status-interval 5360session option. 5361.Pp 5362Commands related to the status line are as follows: 5363.Bl -tag -width Ds 5364.It Xo Ic command-prompt 5365.Op Fl 1ikNTW 5366.Op Fl I Ar inputs 5367.Op Fl p Ar prompts 5368.Op Fl t Ar target-client 5369.Op Ar template 5370.Xc 5371Open the command prompt in a client. 5372This may be used from inside 5373.Nm 5374to execute commands interactively. 5375.Pp 5376If 5377.Ar template 5378is specified, it is used as the command. 5379If present, 5380.Fl I 5381is a comma-separated list of the initial text for each prompt. 5382If 5383.Fl p 5384is given, 5385.Ar prompts 5386is a comma-separated list of prompts which are displayed in order; otherwise 5387a single prompt is displayed, constructed from 5388.Ar template 5389if it is present, or 5390.Ql \&: 5391if not. 5392.Pp 5393Before the command is executed, the first occurrence of the string 5394.Ql %% 5395and all occurrences of 5396.Ql %1 5397are replaced by the response to the first prompt, all 5398.Ql %2 5399are replaced with the response to the second prompt, and so on for further 5400prompts. 5401Up to nine prompt responses may be replaced 5402.Po 5403.Ql %1 5404to 5405.Ql %9 5406.Pc . 5407.Ql %%% 5408is like 5409.Ql %% 5410but any quotation marks are escaped. 5411.Pp 5412.Fl 1 5413makes the prompt only accept one key press, in this case the resulting input 5414is a single character. 5415.Fl k 5416is like 5417.Fl 1 5418but the key press is translated to a key name. 5419.Fl N 5420makes the prompt only accept numeric key presses. 5421.Fl i 5422executes the command every time the prompt input changes instead of when the 5423user exits the command prompt. 5424.Fl T 5425tells 5426.Nm 5427that the prompt is for a target which affects what completions are offered when 5428.Em Tab 5429is pressed; 5430.Fl W 5431is similar but indicates the prompt is for a window. 5432.Pp 5433The following keys have a special meaning in the command prompt, depending 5434on the value of the 5435.Ic status-keys 5436option: 5437.Bl -column "FunctionXXXXXXXXXXXXXXXXXXXXXXXXX" "viXXXX" "emacsX" -offset indent 5438.It Sy "Function" Ta Sy "vi" Ta Sy "emacs" 5439.It Li "Cancel command prompt" Ta "q" Ta "Escape" 5440.It Li "Delete from cursor to start of word" Ta "" Ta "C-w" 5441.It Li "Delete entire command" Ta "d" Ta "C-u" 5442.It Li "Delete from cursor to end" Ta "D" Ta "C-k" 5443.It Li "Execute command" Ta "Enter" Ta "Enter" 5444.It Li "Get next command from history" Ta "" Ta "Down" 5445.It Li "Get previous command from history" Ta "" Ta "Up" 5446.It Li "Insert top paste buffer" Ta "p" Ta "C-y" 5447.It Li "Look for completions" Ta "Tab" Ta "Tab" 5448.It Li "Move cursor left" Ta "h" Ta "Left" 5449.It Li "Move cursor right" Ta "l" Ta "Right" 5450.It Li "Move cursor to end" Ta "$" Ta "C-e" 5451.It Li "Move cursor to next word" Ta "w" Ta "M-f" 5452.It Li "Move cursor to previous word" Ta "b" Ta "M-b" 5453.It Li "Move cursor to start" Ta "0" Ta "C-a" 5454.It Li "Transpose characters" Ta "" Ta "C-t" 5455.El 5456.It Xo Ic confirm-before 5457.Op Fl p Ar prompt 5458.Op Fl t Ar target-client 5459.Ar command 5460.Xc 5461.D1 (alias: Ic confirm ) 5462Ask for confirmation before executing 5463.Ar command . 5464If 5465.Fl p 5466is given, 5467.Ar prompt 5468is the prompt to display; otherwise a prompt is constructed from 5469.Ar command . 5470It may contain the special character sequences supported by the 5471.Ic status-left 5472option. 5473.Pp 5474This command works only from inside 5475.Nm . 5476.It Xo Ic display-menu 5477.Op Fl O 5478.Op Fl c Ar target-client 5479.Op Fl t Ar target-pane 5480.Op Fl T Ar title 5481.Op Fl x Ar position 5482.Op Fl y Ar position 5483.Ar name 5484.Ar key 5485.Ar command 5486.Ar ... 5487.Xc 5488.D1 (alias: Ic menu ) 5489Display a menu on 5490.Ar target-client . 5491.Ar target-pane 5492gives the target for any commands run from the menu. 5493.Pp 5494A menu is passed as a series of arguments: first the menu item name, 5495second the key shortcut (or empty for none) and third the command 5496to run when the menu item is chosen. 5497The name and command are formats, see the 5498.Sx FORMATS 5499and 5500.Sx STYLES 5501sections. 5502If the name begins with a hyphen (-), then the item is disabled (shown dim) and 5503may not be chosen. 5504The name may be empty for a separator line, in which case both the key and 5505command should be omitted. 5506.Pp 5507.Fl T 5508is a format for the menu title (see 5509.Sx FORMATS ) . 5510.Pp 5511.Fl x 5512and 5513.Fl y 5514give the position of the menu. 5515Both may be a row or column number, or one of the following special values: 5516.Bl -column "XXXXX" "XXXX" -offset indent 5517.It Sy "Value" Ta Sy "Flag" Ta Sy "Meaning" 5518.It Li "C" Ta "Both" Ta "The centre of the terminal" 5519.It Li "R" Ta Fl x Ta "The right side of the terminal" 5520.It Li "P" Ta "Both" Ta "The bottom left of the pane" 5521.It Li "M" Ta "Both" Ta "The mouse position" 5522.It Li "W" Ta "Both" Ta "The window position on the status line" 5523.It Li "S" Ta Fl y Ta "The line above or below the status line" 5524.El 5525.Pp 5526Or a format, which is expanded including the following additional variables: 5527.Bl -column "XXXXXXXXXXXXXXXXXXXXXXXXXX" -offset indent 5528.It Sy "Variable name" Ta Sy "Replaced with" 5529.It Li "popup_centre_x" Ta "Centered in the client" 5530.It Li "popup_centre_y" Ta "Centered in the client" 5531.It Li "popup_height" Ta "Height of menu or popup" 5532.It Li "popup_mouse_bottom" Ta "Bottom of at the mouse" 5533.It Li "popup_mouse_centre_x" Ta "Horizontal centre at the mouse" 5534.It Li "popup_mouse_centre_y" Ta "Vertical centre at the mouse" 5535.It Li "popup_mouse_top" Ta "Top at the mouse" 5536.It Li "popup_mouse_x" Ta "Mouse X position" 5537.It Li "popup_mouse_y" Ta "Mouse Y position" 5538.It Li "popup_pane_bottom" Ta "Bottom of the pane" 5539.It Li "popup_pane_left" Ta "Left of the pane" 5540.It Li "popup_pane_right" Ta "Right of the pane" 5541.It Li "popup_pane_top" Ta "Top of the pane" 5542.It Li "popup_status_line_y" Ta "Above or below the status line" 5543.It Li "popup_width" Ta "Width of menu or popup" 5544.It Li "popup_window_status_line_x" Ta "At the window position in status line" 5545.It Li "popup_window_status_line_y" Ta "At the status line showing the window" 5546.El 5547.Pp 5548Each menu consists of items followed by a key shortcut shown in brackets. 5549If the menu is too large to fit on the terminal, it is not displayed. 5550Pressing the key shortcut chooses the corresponding item. 5551If the mouse is enabled and the menu is opened from a mouse key binding, 5552releasing the mouse button with an item selected chooses that item and 5553releasing the mouse button without an item selected closes the menu. 5554.Fl O 5555changes this behaviour so that the menu does not close when the mouse button is 5556released without an item selected the menu is not closed and a mouse button 5557must be clicked to choose an item. 5558.Pp 5559The following keys are also available: 5560.Bl -column "Key" "Function" -offset indent 5561.It Sy "Key" Ta Sy "Function" 5562.It Li "Enter" Ta "Choose selected item" 5563.It Li "Up" Ta "Select previous item" 5564.It Li "Down" Ta "Select next item" 5565.It Li "q" Ta "Exit menu" 5566.El 5567.It Xo Ic display-message 5568.Op Fl aINpv 5569.Op Fl c Ar target-client 5570.Op Fl d Ar delay 5571.Op Fl t Ar target-pane 5572.Op Ar message 5573.Xc 5574.D1 (alias: Ic display ) 5575Display a message. 5576If 5577.Fl p 5578is given, the output is printed to stdout, otherwise it is displayed in the 5579.Ar target-client 5580status line for up to 5581.Ar delay 5582milliseconds. 5583If 5584.Ar delay 5585is not given, the 5586.Ic message-time 5587option is used; a delay of zero waits for a key press. 5588.Ql N 5589ignores key presses and closes only after the delay expires. 5590The format of 5591.Ar message 5592is described in the 5593.Sx FORMATS 5594section; information is taken from 5595.Ar target-pane 5596if 5597.Fl t 5598is given, otherwise the active pane. 5599.Pp 5600.Fl v 5601prints verbose logging as the format is parsed and 5602.Fl a 5603lists the format variables and their values. 5604.Pp 5605.Fl I 5606forwards any input read from stdin to the empty pane given by 5607.Ar target-pane . 5608.It Xo Ic display-popup 5609.Op Fl CE 5610.Op Fl c Ar target-client 5611.Op Fl d Ar start-directory 5612.Op Fl h Ar height 5613.Op Fl t Ar target-pane 5614.Op Fl w Ar width 5615.Op Fl x Ar position 5616.Op Fl y Ar position 5617.Op Ar shell-command 5618.Xc 5619.D1 (alias: Ic popup ) 5620Display a popup running 5621.Ar shell-command 5622on 5623.Ar target-client . 5624A popup is a rectangular box drawn over the top of any panes. 5625Panes are not updated while a popup is present. 5626.Pp 5627.Fl E 5628closes the popup automatically when 5629.Ar shell-command 5630exits. 5631Two 5632.Fl E 5633closes the popup only if 5634.Ar shell-command 5635exited with success. 5636.Pp 5637.Fl x 5638and 5639.Fl y 5640give the position of the popup, they have the same meaning as for the 5641.Ic display-menu 5642command. 5643.Fl w 5644and 5645.Fl h 5646give the width and height - both may be a percentage (followed by 5647.Ql % ) . 5648If omitted, half of the terminal size is used. 5649.Pp 5650The 5651.Fl C 5652flag closes any popup on the client. 5653.El 5654.Sh BUFFERS 5655.Nm 5656maintains a set of named 5657.Em paste buffers . 5658Each buffer may be either explicitly or automatically named. 5659Explicitly named buffers are named when created with the 5660.Ic set-buffer 5661or 5662.Ic load-buffer 5663commands, or by renaming an automatically named buffer with 5664.Ic set-buffer 5665.Fl n . 5666Automatically named buffers are given a name such as 5667.Ql buffer0001 , 5668.Ql buffer0002 5669and so on. 5670When the 5671.Ic buffer-limit 5672option is reached, the oldest automatically named buffer is deleted. 5673Explicitly named buffers are not subject to 5674.Ic buffer-limit 5675and may be deleted with the 5676.Ic delete-buffer 5677command. 5678.Pp 5679Buffers may be added using 5680.Ic copy-mode 5681or the 5682.Ic set-buffer 5683and 5684.Ic load-buffer 5685commands, and pasted into a window using the 5686.Ic paste-buffer 5687command. 5688If a buffer command is used and no buffer is specified, the most 5689recently added automatically named buffer is assumed. 5690.Pp 5691A configurable history buffer is also maintained for each window. 5692By default, up to 2000 lines are kept; this can be altered with the 5693.Ic history-limit 5694option (see the 5695.Ic set-option 5696command above). 5697.Pp 5698The buffer commands are as follows: 5699.Bl -tag -width Ds 5700.It Xo 5701.Ic choose-buffer 5702.Op Fl NZr 5703.Op Fl F Ar format 5704.Op Fl f Ar filter 5705.Op Fl K Ar key-format 5706.Op Fl O Ar sort-order 5707.Op Fl t Ar target-pane 5708.Op Ar template 5709.Xc 5710Put a pane into buffer mode, where a buffer may be chosen interactively from 5711a list. 5712Each buffer is shown on one line. 5713A shortcut key is shown on the left in brackets allowing for immediate choice, 5714or the list may be navigated and an item chosen or otherwise manipulated using 5715the keys below. 5716.Fl Z 5717zooms the pane. 5718The following keys may be used in buffer mode: 5719.Bl -column "Key" "Function" -offset indent 5720.It Sy "Key" Ta Sy "Function" 5721.It Li "Enter" Ta "Paste selected buffer" 5722.It Li "Up" Ta "Select previous buffer" 5723.It Li "Down" Ta "Select next buffer" 5724.It Li "C-s" Ta "Search by name or content" 5725.It Li "n" Ta "Repeat last search" 5726.It Li "t" Ta "Toggle if buffer is tagged" 5727.It Li "T" Ta "Tag no buffers" 5728.It Li "C-t" Ta "Tag all buffers" 5729.It Li "p" Ta "Paste selected buffer" 5730.It Li "P" Ta "Paste tagged buffers" 5731.It Li "d" Ta "Delete selected buffer" 5732.It Li "D" Ta "Delete tagged buffers" 5733.It Li "e" Ta "Open the buffer in an editor" 5734.It Li "f" Ta "Enter a format to filter items" 5735.It Li "O" Ta "Change sort field" 5736.It Li "r" Ta "Reverse sort order" 5737.It Li "v" Ta "Toggle preview" 5738.It Li "q" Ta "Exit mode" 5739.El 5740.Pp 5741After a buffer is chosen, 5742.Ql %% 5743is replaced by the buffer name in 5744.Ar template 5745and the result executed as a command. 5746If 5747.Ar template 5748is not given, "paste-buffer -b '%%'" is used. 5749.Pp 5750.Fl O 5751specifies the initial sort field: one of 5752.Ql time , 5753.Ql name 5754or 5755.Ql size . 5756.Fl r 5757reverses the sort order. 5758.Fl f 5759specifies an initial filter: the filter is a format - if it evaluates to zero, 5760the item in the list is not shown, otherwise it is shown. 5761If a filter would lead to an empty list, it is ignored. 5762.Fl F 5763specifies the format for each item in the list and 5764.Fl K 5765a format for each shortcut key; both are evaluated once for each line. 5766.Fl N 5767starts without the preview. 5768This command works only if at least one client is attached. 5769.It Ic clear-history Op Fl t Ar target-pane 5770.D1 (alias: Ic clearhist ) 5771Remove and free the history for the specified pane. 5772.It Ic delete-buffer Op Fl b Ar buffer-name 5773.D1 (alias: Ic deleteb ) 5774Delete the buffer named 5775.Ar buffer-name , 5776or the most recently added automatically named buffer if not specified. 5777.It Xo Ic list-buffers 5778.Op Fl F Ar format 5779.Op Fl f Ar filter 5780.Xc 5781.D1 (alias: Ic lsb ) 5782List the global buffers. 5783.Fl F 5784specifies the format of each line and 5785.Fl f 5786a filter. 5787Only buffers for which the filter is true are shown. 5788See the 5789.Sx FORMATS 5790section. 5791.It Xo Ic load-buffer 5792.Op Fl w 5793.Op Fl b Ar buffer-name 5794.Op Fl t Ar target-client 5795.Ar path 5796.Xc 5797.D1 (alias: Ic loadb ) 5798Load the contents of the specified paste buffer from 5799.Ar path . 5800If 5801.Fl w 5802is given, the buffer is also sent to the clipboard for 5803.Ar target-client 5804using the 5805.Xr xterm 1 5806escape sequence, if possible. 5807.It Xo Ic paste-buffer 5808.Op Fl dpr 5809.Op Fl b Ar buffer-name 5810.Op Fl s Ar separator 5811.Op Fl t Ar target-pane 5812.Xc 5813.D1 (alias: Ic pasteb ) 5814Insert the contents of a paste buffer into the specified pane. 5815If not specified, paste into the current one. 5816With 5817.Fl d , 5818also delete the paste buffer. 5819When output, any linefeed (LF) characters in the paste buffer are replaced with 5820a separator, by default carriage return (CR). 5821A custom separator may be specified using the 5822.Fl s 5823flag. 5824The 5825.Fl r 5826flag means to do no replacement (equivalent to a separator of LF). 5827If 5828.Fl p 5829is specified, paste bracket control codes are inserted around the 5830buffer if the application has requested bracketed paste mode. 5831.It Xo Ic save-buffer 5832.Op Fl a 5833.Op Fl b Ar buffer-name 5834.Ar path 5835.Xc 5836.D1 (alias: Ic saveb ) 5837Save the contents of the specified paste buffer to 5838.Ar path . 5839The 5840.Fl a 5841option appends to rather than overwriting the file. 5842.It Xo Ic set-buffer 5843.Op Fl aw 5844.Op Fl b Ar buffer-name 5845.Op Fl t Ar target-client 5846.Op Fl n Ar new-buffer-name 5847.Ar data 5848.Xc 5849.D1 (alias: Ic setb ) 5850Set the contents of the specified buffer to 5851.Ar data . 5852If 5853.Fl w 5854is given, the buffer is also sent to the clipboard for 5855.Ar target-client 5856using the 5857.Xr xterm 1 5858escape sequence, if possible. 5859The 5860.Fl a 5861option appends to rather than overwriting the buffer. 5862The 5863.Fl n 5864option renames the buffer to 5865.Ar new-buffer-name . 5866.It Xo Ic show-buffer 5867.Op Fl b Ar buffer-name 5868.Xc 5869.D1 (alias: Ic showb ) 5870Display the contents of the specified buffer. 5871.El 5872.Sh MISCELLANEOUS 5873Miscellaneous commands are as follows: 5874.Bl -tag -width Ds 5875.It Ic clock-mode Op Fl t Ar target-pane 5876Display a large clock. 5877.It Xo Ic if-shell 5878.Op Fl bF 5879.Op Fl t Ar target-pane 5880.Ar shell-command command 5881.Op Ar command 5882.Xc 5883.D1 (alias: Ic if ) 5884Execute the first 5885.Ar command 5886if 5887.Ar shell-command 5888returns success or the second 5889.Ar command 5890otherwise. 5891Before being executed, 5892.Ar shell-command 5893is expanded using the rules specified in the 5894.Sx FORMATS 5895section, including those relevant to 5896.Ar target-pane . 5897With 5898.Fl b , 5899.Ar shell-command 5900is run in the background. 5901.Pp 5902If 5903.Fl F 5904is given, 5905.Ar shell-command 5906is not executed but considered success if neither empty nor zero (after formats 5907are expanded). 5908.It Ic lock-server 5909.D1 (alias: Ic lock ) 5910Lock each client individually by running the command specified by the 5911.Ic lock-command 5912option. 5913.It Xo Ic run-shell 5914.Op Fl bC 5915.Op Fl d Ar delay 5916.Op Fl t Ar target-pane 5917.Op Ar shell-command 5918.Xc 5919.D1 (alias: Ic run ) 5920Execute 5921.Ar shell-command 5922or (with 5923.Fl C ) 5924a 5925.Nm 5926command in the background without creating a window. 5927Before being executed, 5928.Ar shell-command 5929is expanded using the rules specified in the 5930.Sx FORMATS 5931section. 5932With 5933.Fl b , 5934the command is run in the background. 5935.Fl d 5936waits for 5937.Ar delay 5938seconds before starting the command. 5939If 5940.Fl C 5941is not given, any output to stdout is displayed in view mode (in the pane 5942specified by 5943.Fl t 5944or the current pane if omitted) after the command finishes. 5945If the command fails, the exit status is also displayed. 5946.It Xo Ic wait-for 5947.Op Fl L | S | U 5948.Ar channel 5949.Xc 5950.D1 (alias: Ic wait ) 5951When used without options, prevents the client from exiting until woken using 5952.Ic wait-for 5953.Fl S 5954with the same channel. 5955When 5956.Fl L 5957is used, the channel is locked and any clients that try to lock the same 5958channel are made to wait until the channel is unlocked with 5959.Ic wait-for 5960.Fl U . 5961.El 5962.Sh EXIT MESSAGES 5963When a 5964.Nm 5965client detaches, it prints a message. 5966This may be one of: 5967.Bl -tag -width Ds 5968.It detached (from session ...) 5969The client was detached normally. 5970.It detached and SIGHUP 5971The client was detached and its parent sent the 5972.Dv SIGHUP 5973signal (for example with 5974.Ic detach-client 5975.Fl P ) . 5976.It lost tty 5977The client's 5978.Xr tty 4 5979or 5980.Xr pty 4 5981was unexpectedly destroyed. 5982.It terminated 5983The client was killed with 5984.Dv SIGTERM . 5985.It too far behind 5986The client is in control mode and became unable to keep up with the data from 5987.Nm . 5988.It exited 5989The server exited when it had no sessions. 5990.It server exited 5991The server exited when it received 5992.Dv SIGTERM . 5993.It server exited unexpectedly 5994The server crashed or otherwise exited without telling the client the reason. 5995.El 5996.Sh TERMINFO EXTENSIONS 5997.Nm 5998understands some unofficial extensions to 5999.Xr terminfo 5 . 6000It is not normally necessary to set these manually, instead the 6001.Ic terminal-features 6002option should be used. 6003.Bl -tag -width Ds 6004.It Em \&AX 6005An existing extension that tells 6006.Nm 6007the terminal supports default colours. 6008.It Em \&Bidi 6009Tell 6010.Nm 6011that the terminal supports the VTE bidirectional text extensions. 6012.It Em \&Cs , Cr 6013Set the cursor colour. 6014The first takes a single string argument and is used to set the colour; 6015the second takes no arguments and restores the default cursor colour. 6016If set, a sequence such as this may be used 6017to change the cursor colour from inside 6018.Nm : 6019.Bd -literal -offset indent 6020$ printf '\e033]12;red\e033\e\e' 6021.Ed 6022.It Em \&Cmg, \&Clmg, \&Dsmg , \&Enmg 6023Set, clear, disable or enable DECSLRM margins. 6024These are set automatically if the terminal reports it is 6025.Em VT420 6026compatible. 6027.It Em \&Dsbp , \&Enbp 6028Disable and enable bracketed paste. 6029These are set automatically if the 6030.Em XT 6031capability is present. 6032.It Em \&Dseks , \&Eneks 6033Disable and enable extended keys. 6034.It Em \&Dsfcs , \&Enfcs 6035Disable and enable focus reporting. 6036These are set automatically if the 6037.Em XT 6038capability is present. 6039.It Em \&Smol 6040Enable the overline attribute. 6041.It Em \&Smulx 6042Set a styled underscore. 6043The single parameter is one of: 0 for no underscore, 1 for normal 6044underscore, 2 for double underscore, 3 for curly underscore, 4 for dotted 6045underscore and 5 for dashed underscore. 6046.It Em \&Setulc , \&ol 6047Set the underscore colour or reset to the default. 6048The argument is (red * 65536) + (green * 256) + blue where each is between 0 6049and 255. 6050.It Em \&Ss , Se 6051Set or reset the cursor style. 6052If set, a sequence such as this may be used 6053to change the cursor to an underline: 6054.Bd -literal -offset indent 6055$ printf '\e033[4 q' 6056.Ed 6057.Pp 6058If 6059.Em Se 6060is not set, \&Ss with argument 0 will be used to reset the cursor style instead. 6061.It Em \&Sync 6062Start (parameter is 1) or end (parameter is 2) a synchronized update. 6063.It Em \&Tc 6064Indicate that the terminal supports the 6065.Ql direct colour 6066RGB escape sequence (for example, \ee[38;2;255;255;255m). 6067.Pp 6068If supported, this is used for the initialize colour escape sequence (which 6069may be enabled by adding the 6070.Ql initc 6071and 6072.Ql ccc 6073capabilities to the 6074.Nm 6075.Xr terminfo 5 6076entry). 6077.Pp 6078This is equivalent to the 6079.Em RGB 6080.Xr terminfo 5 6081capability. 6082.It Em \&Ms 6083Store the current buffer in the host terminal's selection (clipboard). 6084See the 6085.Em set-clipboard 6086option above and the 6087.Xr xterm 1 6088man page. 6089.It Em \&XT 6090This is an existing extension capability that tmux uses to mean that the 6091terminal supports the 6092.Xr xterm 1 6093title set sequences and to automatically set some of the capabilities above. 6094.El 6095.Sh CONTROL MODE 6096.Nm 6097offers a textual interface called 6098.Em control mode . 6099This allows applications to communicate with 6100.Nm 6101using a simple text-only protocol. 6102.Pp 6103In control mode, a client sends 6104.Nm 6105commands or command sequences terminated by newlines on standard input. 6106Each command will produce one block of output on standard output. 6107An output block consists of a 6108.Em %begin 6109line followed by the output (which may be empty). 6110The output block ends with a 6111.Em %end 6112or 6113.Em %error . 6114.Em %begin 6115and matching 6116.Em %end 6117or 6118.Em %error 6119have three arguments: an integer time (as seconds from epoch), command number and 6120flags (currently not used). 6121For example: 6122.Bd -literal -offset indent 6123%begin 1363006971 2 1 61240: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active) 6125%end 1363006971 2 1 6126.Ed 6127.Pp 6128The 6129.Ic refresh-client 6130.Fl C 6131command may be used to set the size of a client in control mode. 6132.Pp 6133In control mode, 6134.Nm 6135outputs notifications. 6136A notification will never occur inside an output block. 6137.Pp 6138The following notifications are defined: 6139.Bl -tag -width Ds 6140.It Ic %client-detached Ar client 6141The client has detached. 6142.It Ic %client-session-changed Ar client session-id name 6143The client is now attached to the session with ID 6144.Ar session-id , 6145which is named 6146.Ar name . 6147.It Ic %continue Ar pane-id 6148The pane has been continued after being paused (if the 6149.Ar pause-after 6150flag is set, see 6151.Ic refresh-client 6152.Fl A ) . 6153.It Ic %exit Op Ar reason 6154The 6155.Nm 6156client is exiting immediately, either because it is not attached to any session 6157or an error occurred. 6158If present, 6159.Ar reason 6160describes why the client exited. 6161.It Ic %extended-output Ar pane-id Ar age Ar ... \& : Ar value 6162New form of 6163.Ic %output 6164sent when the 6165.Ar pause-after 6166flag is set. 6167.Ar age 6168is the time in milliseconds for which tmux had buffered the output before it was sent. 6169Any subsequent arguments up until a single 6170.Ql \&: 6171are for future use and should be ignored. 6172.It Ic %layout-change Ar window-id Ar window-layout Ar window-visible-layout Ar window-flags 6173The layout of a window with ID 6174.Ar window-id 6175changed. 6176The new layout is 6177.Ar window-layout . 6178The window's visible layout is 6179.Ar window-visible-layout 6180and the window flags are 6181.Ar window-flags . 6182.It Ic %output Ar pane-id Ar value 6183A window pane produced output. 6184.Ar value 6185escapes non-printable characters and backslash as octal \\xxx. 6186.It Ic %pane-mode-changed Ar pane-id 6187The pane with ID 6188.Ar pane-id 6189has changed mode. 6190.It Ic %pause Ar pane-id 6191The pane has been paused (if the 6192.Ar pause-after 6193flag is set). 6194.It Ic %session-changed Ar session-id Ar name 6195The client is now attached to the session with ID 6196.Ar session-id , 6197which is named 6198.Ar name . 6199.It Ic %session-renamed Ar name 6200The current session was renamed to 6201.Ar name . 6202.It Ic %session-window-changed Ar session-id Ar window-id 6203The session with ID 6204.Ar session-id 6205changed its active window to the window with ID 6206.Ar window-id . 6207.It Ic %sessions-changed 6208A session was created or destroyed. 6209.It Xo Ic %subscription-changed 6210.Ar name 6211.Ar session-id 6212.Ar window-id 6213.Ar window-index 6214.Ar pane-id ... \& : 6215.Ar value 6216.Xc 6217The value of the format associated with subscription 6218.Ar name 6219has changed to 6220.Ar value . 6221See 6222.Ic refresh-client 6223.Fl B . 6224Any arguments after 6225.Ar pane-id 6226up until a single 6227.Ql \&: 6228are for future use and should be ignored. 6229.It Ic %unlinked-window-add Ar window-id 6230The window with ID 6231.Ar window-id 6232was created but is not linked to the current session. 6233.It Ic %window-add Ar window-id 6234The window with ID 6235.Ar window-id 6236was linked to the current session. 6237.It Ic %window-close Ar window-id 6238The window with ID 6239.Ar window-id 6240closed. 6241.It Ic %window-pane-changed Ar window-id Ar pane-id 6242The active pane in the window with ID 6243.Ar window-id 6244changed to the pane with ID 6245.Ar pane-id . 6246.It Ic %window-renamed Ar window-id Ar name 6247The window with ID 6248.Ar window-id 6249was renamed to 6250.Ar name . 6251.El 6252.Sh ENVIRONMENT 6253When 6254.Nm 6255is started, it inspects the following environment variables: 6256.Bl -tag -width LC_CTYPE 6257.It Ev EDITOR 6258If the command specified in this variable contains the string 6259.Ql vi 6260and 6261.Ev VISUAL 6262is unset, use vi-style key bindings. 6263Overridden by the 6264.Ic mode-keys 6265and 6266.Ic status-keys 6267options. 6268.It Ev HOME 6269The user's login directory. 6270If unset, the 6271.Xr passwd 5 6272database is consulted. 6273.It Ev LC_CTYPE 6274The character encoding 6275.Xr locale 1 . 6276It is used for two separate purposes. 6277For output to the terminal, UTF-8 is used if the 6278.Fl u 6279option is given or if 6280.Ev LC_CTYPE 6281contains 6282.Qq UTF-8 6283or 6284.Qq UTF8 . 6285Otherwise, only ASCII characters are written and non-ASCII characters 6286are replaced with underscores 6287.Pq Ql _ . 6288For input, 6289.Nm 6290always runs with a UTF-8 locale. 6291If en_US.UTF-8 is provided by the operating system it is used and 6292.Ev LC_CTYPE 6293is ignored for input. 6294Otherwise, 6295.Ev LC_CTYPE 6296tells 6297.Nm 6298what the UTF-8 locale is called on the current system. 6299If the locale specified by 6300.Ev LC_CTYPE 6301is not available or is not a UTF-8 locale, 6302.Nm 6303exits with an error message. 6304.It Ev LC_TIME 6305The date and time format 6306.Xr locale 1 . 6307It is used for locale-dependent 6308.Xr strftime 3 6309format specifiers. 6310.It Ev PWD 6311The current working directory to be set in the global environment. 6312This may be useful if it contains symbolic links. 6313If the value of the variable does not match the current working 6314directory, the variable is ignored and the result of 6315.Xr getcwd 3 6316is used instead. 6317.It Ev SHELL 6318The absolute path to the default shell for new windows. 6319See the 6320.Ic default-shell 6321option for details. 6322.It Ev TMUX_TMPDIR 6323The parent directory of the directory containing the server sockets. 6324See the 6325.Fl L 6326option for details. 6327.It Ev VISUAL 6328If the command specified in this variable contains the string 6329.Ql vi , 6330use vi-style key bindings. 6331Overridden by the 6332.Ic mode-keys 6333and 6334.Ic status-keys 6335options. 6336.El 6337.Sh FILES 6338.Bl -tag -width "/etc/tmux.confXXX" -compact 6339.It Pa ~/.tmux.conf 6340Default 6341.Nm 6342configuration file. 6343.It Pa /etc/tmux.conf 6344System-wide configuration file. 6345.El 6346.Sh EXAMPLES 6347To create a new 6348.Nm 6349session running 6350.Xr vi 1 : 6351.Pp 6352.Dl $ tmux new-session vi 6353.Pp 6354Most commands have a shorter form, known as an alias. 6355For new-session, this is 6356.Ic new : 6357.Pp 6358.Dl $ tmux new vi 6359.Pp 6360Alternatively, the shortest unambiguous form of a command is accepted. 6361If there are several options, they are listed: 6362.Bd -literal -offset indent 6363$ tmux n 6364ambiguous command: n, could be: new-session, new-window, next-window 6365.Ed 6366.Pp 6367Within an active session, a new window may be created by typing 6368.Ql C-b c 6369(Ctrl 6370followed by the 6371.Ql b 6372key 6373followed by the 6374.Ql c 6375key). 6376.Pp 6377Windows may be navigated with: 6378.Ql C-b 0 6379(to select window 0), 6380.Ql C-b 1 6381(to select window 1), and so on; 6382.Ql C-b n 6383to select the next window; and 6384.Ql C-b p 6385to select the previous window. 6386.Pp 6387A session may be detached using 6388.Ql C-b d 6389(or by an external event such as 6390.Xr ssh 1 6391disconnection) and reattached with: 6392.Pp 6393.Dl $ tmux attach-session 6394.Pp 6395Typing 6396.Ql C-b \&? 6397lists the current key bindings in the current window; up and down may be used 6398to navigate the list or 6399.Ql q 6400to exit from it. 6401.Pp 6402Commands to be run when the 6403.Nm 6404server is started may be placed in the 6405.Pa ~/.tmux.conf 6406configuration file. 6407Common examples include: 6408.Pp 6409Changing the default prefix key: 6410.Bd -literal -offset indent 6411set-option -g prefix C-a 6412unbind-key C-b 6413bind-key C-a send-prefix 6414.Ed 6415.Pp 6416Turning the status line off, or changing its colour: 6417.Bd -literal -offset indent 6418set-option -g status off 6419set-option -g status-style bg=blue 6420.Ed 6421.Pp 6422Setting other options, such as the default command, 6423or locking after 30 minutes of inactivity: 6424.Bd -literal -offset indent 6425set-option -g default-command "exec /bin/ksh" 6426set-option -g lock-after-time 1800 6427.Ed 6428.Pp 6429Creating new key bindings: 6430.Bd -literal -offset indent 6431bind-key b set-option status 6432bind-key / command-prompt "split-window 'exec man %%'" 6433bind-key S command-prompt "new-window -n %1 'ssh %1'" 6434.Ed 6435.Sh SEE ALSO 6436.Xr pty 4 6437.Sh AUTHORS 6438.An Nicholas Marriott Aq Mt nicholas.marriott@gmail.com 6439