[tmux.app]
tmux 3.8

Reference · tmux 3.8

tmux config: the .tmux.conf file explained

tmux reads ~/.tmux.conf (or ~/.config/tmux/tmux.conf) once, when its server starts. Put one command per line in it, then run tmux source-file ~/.tmux.conf to apply your changes to the sessions that are already running.

Updated Tested on tmux 3.813 min read

On this page
  1. tmux config essentials
  2. Where is the tmux config file?
  3. Reload .tmux.conf without restarting
  4. set, setw and set -s: option scopes
  5. Key bindings: bind, unbind and key tables
  6. Customize the status bar
  7. Themes and colors: the tmux 3.8 theme option
  8. True color (24-bit RGB)
  9. Mouse mode
  10. Build a config with the generator
  11. Complete option reference
  12. Popular .tmux.conf snippets
  13. Common .tmux.conf mistakes
  14. Frequently asked questions

Quick answer

Where is the tmux config file, and how do I reload it?

Your config is ~/.tmux.conf or ~/.config/tmux/tmux.conf (tmux loads both if both exist, after /etc/tmux.conf). Neither file exists until you create it. After editing, reload without losing anything:

shell
tmux source-file ~/.tmux.conf

Inside tmux you can also press Ctrl+b : and type source-file ~/.tmux.conf.

Watch: write your first .tmux.conf live, with mouse, Ctrl+a prefix, smarter splits, true colour and a reload key.

tmux config essentials

A tmux config is a plain text file of tmux commands, one per line, run in order when the server starts. Lines starting with # are comments. Anything you can type at the Ctrl+b : prompt works in the file, so most configs are a list of set (change an option) and bind (change a key) lines.

tmux 3.8 needs less config than older versions. The mouse is on by default (new in 3.8), escape-time is already 10 ms (since 3.5, so Vim no longer lags after Esc), and default-terminal is already tmux-256color. This starter file only contains lines that still change something on 3.8:

~/.tmux.conf (starter for tmux 3.8)
# Number windows and panes from 1, to match the keyboard
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on

# More scrollback (the default is 2000 lines)
set -g history-limit 50000

# Prefix + r reloads this file
bind r source-file ~/.tmux.conf \; display-message "Config reloaded"

# Split panes in the current directory
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"

# 24-bit color in terminals whose TERM is xterm-256color
set -as terminal-features ",xterm-256color:RGB"
LineWhat it changesNeeded on
base-index 1, pane-base-index 1The first window is Ctrl+b 1 instead of Ctrl+b 0, which sits at the far end of the keyboard.All versions
renumber-windows onClosing window 2 of 1, 2, 3 leaves 1, 2 instead of a gap.All versions
history-limit 50000Lines of scrollback per pane. Only panes created after the line runs get the new limit.All versions
bind r source-file …Reload with Ctrl+b r. This replaces the default r (redraw the client).All versions
split-window -c "#{pane_current_path}"New panes start in the directory you are in, not the one the session started in.All versions
terminal-features …:RGBLets Neovim and other programs use 24-bit color. See true color.3.2+; on 3.6+ only if your terminal does not set COLORTERM=truecolor
set -g mouse onClick panes and windows, drag borders, scroll.3.7 and older (on by default in 3.8)
set -s escape-time 10Removes the half-second wait after Esc in Vim.3.4 and older (default 10 since 3.5)

If you run Ubuntu 24.04 (tmux 3.4) or anything older than 3.8, add the last two lines too. The config generator does this for you: pick your version and it leaves out what your tmux already does.

  1. Create the file

    Open ~/.tmux.conf in your editor; it does not exist until you create it. Prefer XDG folders? Use ~/.config/tmux/tmux.conf instead (mkdir -p ~/.config/tmux first).

    shell
    nano ~/.tmux.conf
  2. Add your settings

    Paste the starter above, a snippet, or a file from the generator. One command per line; # starts a comment.

  3. Reload it

    Run tmux source-file ~/.tmux.conf, or start tmux if it is not running. Mistakes are reported with the file name and line number.

Where is the tmux config file?

tmux has no config file until you make one, and it does not create one for you. When the server starts it checks four paths and loads every one that exists, in this order:

The order in which tmux loads its configuration files When the tmux server starts it reads /etc/tmux.conf, then ~/.tmux.conf, then $XDG_CONFIG_HOME/tmux/tmux.conf, then ~/.config/tmux/tmux.conf. Every file that exists is loaded, in that order, and a later setting overrides an earlier one. Starting tmux with -f FILE replaces the whole list with that file. tmux server starts 1 /etc/tmux.conf system-wide 2 ~/.tmux.conf most common 3 $XDG_CONFIG_HOME/ tmux/tmux.conf 4 ~/.config/tmux/ tmux.conf Every file that exists is loaded, left to right. A missing file is skipped silently. A later line overrides an earlier one. 3 is used only when $XDG_CONFIG_HOME is set (and is skipped if it is ~/.config). tmux -f ~/test.conf replaces 1 to 4 with just this file Already running? nothing is read again until source-file Checked on tmux 3.8 and 3.4: with both 2 and 4 present, both load. See which ran: tmux display -p '#{config_files}'
tmux 3.8 and 3.4 load the system file and then every user file that exists. Verified by putting a different setting in each file in a temporary home directory.
PathUsed forNotes
/etc/tmux.confSystem-wide settings for every userHomebrew builds use $(brew --prefix)/etc/tmux.conf instead
~/.tmux.confYour config: the classic locationWorks on every tmux version
$XDG_CONFIG_HOME/tmux/tmux.confYour config, XDG styleOnly when XDG_CONFIG_HOME is set; tmux 3.2+
~/.config/tmux/tmux.confYour config, XDG defaultSupported since tmux 3.1

To see which files the running server read, ask it. On 3.8 this lists every path tmux checked; on 3.4 only the files that exist:

shell
tmux display-message -p '#{config_files}'
/etc/tmux.conf,/home/dev/.tmux.conf,/home/dev/.config/tmux/tmux.conf

Use a different file, or none at all, with -f. It replaces the whole list above, including /etc/tmux.conf, and only matters when it starts a new server, so combine it with -L to get a separate server:

shell
# Test a config without touching your real sessions
tmux -L test -f ~/new.tmux.conf
# Plain tmux with every default (no config at all)
tmux -L clean -f /dev/null

There is no "default config file" to copy: the defaults are built into tmux. To list them, print the options of a server started with -f /dev/null, for example tmux -L clean -f /dev/null start-server \; show-options -g. On macOS the paths are the same; ~ is /Users/you.

Reload .tmux.conf without restarting

Quick answer

How do I apply changes to .tmux.conf?

Run tmux source-file ~/.tmux.conf (short form tmux source ~/.tmux.conf) from any shell, or add a reload key and press Ctrl+b r:

~/.tmux.conf
bind r source-file ~/.tmux.conf \; display-message "Config reloaded"

The \; chains two commands in one binding. Use your real path (for example ~/.config/tmux/tmux.conf) in the binding. Without a binding, press Ctrl+b :, type source-file ~/.tmux.conf and press Enter.

What reloading does and does not do:

  • It only adds. Every line runs again, but a line you deleted is not undone: a removed key binding or option stays until the server restarts. Run tmux kill-server (it closes all sessions) and start tmux again for a clean slate, or undo it explicitly with unbind or set -u.
  • Some options only affect new things. history-limit, default-shell and default-command apply to panes created afterwards.
  • set -a appends again. Lines like set -as terminal-features … add a duplicate entry on every reload. That is harmless for terminal features; for strings you append to (such as status-right) prefer plain set.
  • Errors name the line. A bad line prints something like ~/.tmux.conf:12: invalid option: foo and the rest of the file still loads.

Two more source-file flags are useful: -q skips a file that does not exist (handy for an optional local file), and -nv parses the file and prints each command without running it. Parsing catches syntax errors such as a missing quote, but not misspelled option names; those only show up when the file is really loaded.

~/.tmux.conf
# Optional per-machine settings, no error if the file is missing
source-file -q ~/.tmux.local.conf
# Several files at once: glob patterns work, -q skips a pattern with no match
source-file -q ~/.config/tmux/conf.d/*.conf

Making one file work on several tmux versions? Wrap newer lines in a version check, which tmux 3.0 and later understand:

~/.tmux.conf
%if #{>=:#{version},3.8}
set -s theme dark
%endif

set, setw and set -s: option scopes

set is short for set-option, and setw is short for set-window-option. Every option belongs to one of four scopes, and the flags say which one, and whether you change the global value or one session, window or pane:

tmux option scopes: server, session, window and pane Server options are set with set -s and apply to the whole tmux server. Session options are set with set -g for every session or with set -t for one session. Window options are set with setw -g or set -w, and pane options with set -p. When tmux looks up a value it checks the pane, then its window, then the global window options; for sessions it checks the session, then the global session options. Serverset -s escape-time, default-terminal, theme, extended-keys Sessionset -g prefix, mouse, base-index, history-limit, status-* Windowsetw -g mode-keys, pane-base-index, pane-border-* Paneset -p remain-on-exit, allow-passthrough, window-style (for a single pane) How a value is found the pane (set -p) its window (set -w) global window (setw -g) Sessions: the session (set -t), then global (set -g). A .tmux.conf almost always uses the global (-g) level.
Options nest: server, session, window, pane. A value set on a pane hides the window value, which hides the global window value.
CommandChangesExample
set -sA server optionset -s escape-time 10
set -gA global session option: the value every session uses unless it has its ownset -g prefix C-a
set (no -g)The current session only (or -t work)set -t work status off
setw -g or set -wgA global window optionsetw -g mode-keys vi
set -pOne paneset -p remain-on-exit on
set -aAppends to a string or array instead of replacing itset -as terminal-features ",foot:RGB"
set -uUnsets: back to the inherited or default valueset -gu status-left
set -oSets only if not already set (error otherwise)set -go @theme dark
set -qQuiet: no error for an unknown option, handy for options an older tmux lacksset -gq allow-passthrough on
set -FExpands formats in the value firstset -gF @host "#{host_short}"

In a config file you almost always want -g, because no session exists yet when the file runs. Modern tmux works out the scope from the option's name, so set -g mode-keys vi and setw -g mode-keys vi do the same thing, and set -g escape-time 10 sets the server option. The flags still make a config easier to read. Options that start with @ are user options, which tmux ignores but plugins read (set -g @plugin …).

To read options back, use show-options (show) with the same flags: tmux show -g lists global session options, tmux show -gw window options, tmux show -s server options, and tmux show -gv history-limit prints just one value. Or press Ctrl+b C for customize mode, a browsable list where you can change any option live:

Real screenshot · tmux 3.8Prefix C opens customize mode: every option and its current value.
Prefix C opens customize mode: every option and its current value.
How this was captured

Captured 2026-10-28 17:54 UTC from a real xterm window running tmux 3.8 on Ubuntu 24.04. Nothing is mocked up. The commands that set up the screen:

tmux new-session -d -s work -n editor -x 110 -y 29
(typed in the terminal) C-b C

Key bindings: bind, unbind and key tables

bind (bind-key) maps a key to a command. By default the key goes in the prefix table, so it works after you press the prefix. Binding a key that is already bound replaces it; unbind removes it.

~/.tmux.conf
# Prefix + | splits left/right
bind | split-window -h -c "#{pane_current_path}"
# Alt+arrows switch panes with no prefix (-n = root table)
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
# Repeatable: Prefix + H, then H H H without the prefix (-r)
bind -r H resize-pane -L 5
# A key in vi copy mode (-T picks the table)
bind -T copy-mode-vi v send-keys -X begin-selection
# Remove a binding
unbind '"'
# Change the prefix to Ctrl+a; Ctrl+a twice sends it to the program
unbind C-b
set -g prefix C-a
bind C-a send-prefix
Key tableWhen it is usedBind with
prefixAfter the prefix keybind x …
rootAlways, with no prefix. Keys bound here never reach programsbind -n M-x …
copy-mode-vi, copy-modeIn copy mode with vi or emacs keysbind -T copy-mode-vi y …
Your own tableAfter switch-client -T name, for chords like Ctrl+b g then a keybind -T name x …

Key names: C-a is Ctrl+a, M-a is Alt (Meta)+a, S-Left is Shift+Left, and special keys are Up, Down, Left, Right, Enter, Space, Tab, BTab (Shift+Tab), Escape, PPage/NPage (Page Up/Down), F1 to F12. Quote keys that mean something to the parser: '"', ';', '#'. Mouse events are keys too, such as MouseDown1Pane.

See what a key does with Ctrl+b ? (or tmux list-keys -T prefix), and tmux list-keys -N lists every key with a short description. Add your own description with bind -N "Reload config" r …. The cheat sheet lists all 93 default prefix keys.

Customize the status bar

The status line has three parts: status-left, the window list, and status-right. Colors come from status-style and the window list from window-status-format and window-status-current-format. Type in the boxes to see the result live:

Try
~/.tmux.conf

The pieces you can use in status-left, status-right and the window formats:

WriteShows
#S or #{session_name}Session name
#I, #W, #FWindow index, window name, window flags (* current, - last, Z zoomed)
#h, #HShort and full host name
#P, #TPane index, pane title
#{pane_current_path}Directory of the active pane (any format variable works)
%H:%M, %d-%b, %Y-%m-%dTime and date (strftime codes; write %% for a literal %)
#(command)Output of a shell command, rerun every status-interval seconds (15 by default)
#[fg=red,bg=default,bold]Change colors from here on; #[default] resets
#{?client_prefix,P,}Conditional: shows P while the prefix is pressed

Colors can be names (red, brightblue), colour0 to colour255, hex such as #7aa2f7, or on 3.8 the theme names below. status-left is cut to status-left-length characters (10 by default) and status-right to status-right-length (40), so raise those for longer content. Other useful options: status-position top, status-justify centre, status off to hide the bar, and status 2 for a second line.

Themes and colors: the tmux 3.8 theme option

tmux 3.8 has built-in light and dark color themes. With the default theme detect, tmux asks the terminal whether its background is light or dark and picks colors that read well on it; a terminal that does not answer is treated as dark. Force a choice with the server option theme:

~/.tmux.conf
set -s theme dark       # or light; detect is the default
set -s theme terminal   # use the terminal's own 16 colors, like tmux 3.7 and older

The default styles now use theme color names instead of fixed colors. status-style is bg=themegreen,fg=themeblack, which is yellow-green on a 256-color terminal with the dark theme, where 3.7 and older used plain green. You can use the names in your own styles, and change what each name means with the dark-theme-* and light-theme-* server options:

NameDark theme (256+ colors)Light theme (256+ colors)Used by default for
themegreenyellowgreenseagreenStatus line, active pane border
themeblackgray5gray10Status line text
themeyellowdarkgoldenroddarkgoldenrodMessages, copy mode selection
themecyancadetbluedarkcyanCopy mode search matches
themelightgreygray70gray80Inactive pane borders
themedarkgreygray15gray45Scrollbars
themered, themeblue, thememagenta, themewhiteindianred, skyblue3, mediumpurple, gray90indianred4, steelblue, purple4, gray95Active border when panes are synchronized (red), in a modal pane (blue) or marked (magenta)

On terminals with fewer than 256 colors each name falls back to the plain color (themegreen is green). Values from tmux show -s on tmux 3.8. To change one:

~/.tmux.conf
# A blue status bar in dark mode, a softer one in light mode
set -s dark-theme-green "#7aa2f7"
set -s light-theme-green "#2e7de9"

Want to react when the terminal switches between light and dark? tmux 3.6 and later run the client-dark-theme and client-light-theme hooks. On tmux 3.7 and older, none of the theme names or the theme option exist (you get invalid option: theme), so use fixed colors there. Complete themes such as Catppuccin, Dracula and Nord are plugins; see the snippets below.

True color (24-bit RGB)

Quick answer

How do I get true color in tmux?

Tell tmux your terminal supports RGB, using the value of $TERM outside tmux (usually xterm-256color):

~/.tmux.conf
set -as terminal-features ",xterm-256color:RGB"

tmux 3.6 and later also turn RGB on when the terminal sets COLORTERM=truecolor (or 24bit), which many current terminals do, so on 3.6+ you may need nothing. Check with echo $COLORTERM outside tmux. Leave default-terminal alone: tmux-256color is already the default and is what programs inside tmux should see.

terminal-features (tmux 3.2+) is the modern replacement for the old set -ga terminal-overrides ",*256col*:Tc" line found in many configs. The old line still works, but RGB in terminal-features is the documented way. To check from inside tmux, run tmux display -p '#{client_termfeatures}' and look for RGB. If colors still look wrong, the troubleshooting guide covers terminfo and SSH cases.

Mouse mode

On tmux 3.8 the mouse is on out of the box: click a pane or window to select it, drag a border to resize, scroll to enter copy mode. On 3.7 and older, turn it on yourself:

~/.tmux.conf
set -g mouse on

With the mouse on, tmux receives clicks and drags, so selecting text selects inside tmux. Hold Shift (Option in iTerm2) while dragging to use your terminal's own selection instead. Turn it off with set -g mouse off, or bind a toggle: bind m set -g mouse \; display "mouse #{?mouse,on,off}". Copying, scrolling and clipboards are covered in scroll and copy mode.

Build a config with the generator

Rather click than type? The config generator writes a commented .tmux.conf for tmux 3.4, 3.6 or 3.8, with presets (Minimal, Sensible, Vim user, Screen refugee, Power user), a live status line preview, TPM plugins and themes, and a link you can share.

Open the config generator →

Complete option reference

All 157 options of tmux 3.8 with their default values, taken from show-options on a server started with no config and described from the tmux 3.8 manual. Filter by name or by words in the description:

Server options 25 set -s name value

OptionDefault in 3.8What it does
backspace
key
C-?Set the key sent by tmux for backspace.
buffer-limit
number
50Set the number of buffers; as new buffers are added to the top of the stack, old ones are removed from the bottom if necessary to maintain this maximum length.
clear-on-attach
[on | off]
onWhen enabled (the default), the client terminal switches to the alternate screen and clears it when a client is attached. When disabled, tmux does not enter the alternate screen; instead the existing terminal content is scrolled into the scrollback buffer so it remains accessible.
command-alias
name=value
split-pane=split-window, splitp=split-window, "server-info=show-messages -JThis is an array of custom aliases for commands. If an unknown command matches name, it is replaced with value.
copy-command
shell-command
''Give the command to pipe to if the copy-pipe copy mode command is used without arguments.
theme
[detect | terminal | light | dark]
detectWhether tmux should use the detected client theme (detect), use terminal ANSI colours (terminal), or force the light or dark theme.
default-client-command
command
new-sessionSet the default command to run when tmux is called without a command. The default is new-session.
default-terminal
terminal
tmux-256colorSet the default terminal for new windows created in this session - the default value of the TERM environment variable. For tmux to work correctly, this must be set to ‘screen’, ‘tmux’ or a derivative of them.
escape-time
time
10Set the time in milliseconds for which tmux waits after an escape is input to determine if it is part of a function or meta key sequences.
editor
shell-command
/usr/bin/viSet the command used when tmux runs an editor.
exit-empty
[on | off]
onIf enabled (the default), the server will exit when there are no active sessions.
exit-unattached
[on | off]
offIf enabled, the server will exit when there are no attached clients.
extended-keys
[on | off | always]
offControls how modified keys (keys pressed together with Control, Meta, or Shift) are reported. This is the equivalent of the modifyOtherKeys xterm(1) resource.
extended-keys-format
[csi-u | xterm]
xtermSelects one of the two possible formats for reporting modified keys to applications. This is the equivalent of the formatOtherKeys xterm(1) resource.
focus-events
[on | off]
offWhen enabled, focus events are requested from the terminal if supported and passed through to applications running in tmux. Attached clients should be detached and attached again after changing this option.
get-clipboard
[both | request | buffer | off]
bufferControls the behaviour when an application requests the clipboard from tmux.
history-file
path
''If not empty, a file to which tmux will write command prompt history on exit and load it from on start.
input-buffer-size
bytes
1048576Maximum of bytes allowed to read in escape and control sequences. Once reached, the sequence will be discarded.
message-limit
number
1000Set the number of error or information messages to save in the message log for each client.
prompt-history-limit
number
100Set the number of history items to save in the history file for each type of command prompt.
set-clipboard
[on | external | off]
externalAttempt to set the terminal clipboard content using the xterm(1) escape sequence, if there is an Ms entry in the terminfo(5) description (see the TERMINFO EXTENSIONS section).
terminal-features
string
xterm*:clipboard:ccolour:cstyle:focus:title, screen*:title, rxvt*:ignorefkeysSet terminal features for terminal types read from terminfo(5). tmux has a set of named terminal features.
terminal-overrides
string
linux*:AX@Allow terminal descriptions read using terminfo(5) to be overridden. Each entry is a colon-separated string made up of a terminal type pattern (matched using glob(7) patterns) and a set of name=value entries.
variation-selector-always-wide
[on | off]
onAlways treat Unicode variation selector 16 as marking a wide character. This is a feature of some terminals as part of their Unicode 14 support.
prefix-timeout
time
0Set the time in milliseconds for which tmux waits after prefix is input before dismissing it. Can be set to zero to disable any timeout.

Session options 50 set -g name value

OptionDefault in 3.8What it does
focus-follows-mouse
[on | off]
offWhen enabled and mouse is on, moving the mouse into a pane selects it.
activity-action
[any | none | current | other]
otherSet action on window activity when monitor-activity is on. any means activity in any window linked to a session causes a bell or message (depending on visual-activity) in the current window of that session, none means all activity is ignored (equivalent to monitor-activity being off), current means only activity in windows other than the current window are ignored and other means activity in the current window is ignored but not those in other windows.
assume-paste-time
milliseconds
1If keys are entered faster than one in milliseconds, they are assumed to have been pasted rather than typed and tmux key bindings are not processed. The default is one millisecond and zero disables.
base-index
index
0Set the base index from which an unused index should be searched when a new window is created. The default is zero.
bell-action
[any | none | current | other]
anySet action on a bell in a window when monitor-bell is on. The values are the same as those for activity-action.
default-command
shell-command
''Set the command used for new windows (if not specified when the window is created) to shell-command, which may be any sh(1) command. The default is an empty string, which instructs tmux to create a login shell using the value of the default-shell option.
default-shell
path
/bin/bashSpecify the default shell. This is used as the login shell for new windows when the default-command option is set to empty, and must be the full path of the executable.
default-size
XxY
80x24Set the default size of new windows when the window-size option is set to manual or when a session is created with new-session -d. The value is the width and height separated by an ‘x’ character.
destroy-unattached
[off | on | keep-last | keep-group]
offIf on, destroy the session after the last client has detached. If off (the default), leave the session orphaned.
detach-on-destroy
[off | on | no-detached | previous | next]
onIf on (the default), the client is detached when the session it is attached to is destroyed. If off, the client is switched to the most recently active of the remaining sessions.
display-time
time
750Set the amount of time for which status line messages and other on-screen indicators are displayed. If set to 0, messages and indicators are displayed until a key is pressed.
history-limit
lines
2000Set the maximum number of lines held in pane history.
initial-repeat-time
time
0Set the time in milliseconds for the initial repeat when a key is bound with the -r flag. This allows multiple commands to be entered without pressing the prefix key again.
key-table
key-table
rootSet the default key table to key-table instead of root.
lock-after-time
number
0Lock the session (like the lock-session command) after number seconds of inactivity. The default is not to lock (set to 0).
lock-command
shell-command
"lock -np"Command to run when locking each client. The default is to run lock(1) with -np.
message-command-style
style
"bg=themeblack,fg=themeyellow,#{?#{m/r:(^|#,)IS(PANE|MODE)($|#,),#{prompt_fSet status line message command style. This is used for the command prompt with vi(1) keys when in command mode.
message-format
string
"#[#{?#{command_prompt},#{E:message-command-style},#{E:message-style}}]#{meSet the format string for the prompt and message area. The special placeholder ‘#{message}’ expands to the interactive prompt or message text and ‘#{command_prompt}’ is set to 1 when the prompt is in command mode (vi).
message-line
[0 | 1 | 2 | 3 | 4]
0Set line on which status line messages and the command prompt are shown.
message-style
style
"bg=themeyellow,fg=themeblack,#{?#{m/r:(^|#,)IS(PANE|MODE)($|#,),#{prompt_fSet status line message style. This is used for messages and for the command prompt.
mouse
[on | off]
onIf on, tmux captures the mouse and allows mouse events to be bound as key bindings. See the MOUSE SUPPORT section for details.
prefix
key
C-bSet the key accepted as a prefix key. In addition to the standard keys described under KEY BINDINGS, prefix can be set to the special key ‘None’ to set no prefix.
prefix2
key
NoneSet a secondary key accepted as a prefix key. Like prefix, prefix2 can be set to ‘None’.
prompt-cursor-colour
colour
''Set the colour of the cursor in the command prompt.
prompt-command-cursor-colour
colour
''Set the colour of the cursor in the command prompt when vi(1) keys are enabled and the prompt is in command mode.
prompt-cursor-style
style
defaultSet the style of the cursor in the command prompt. See the cursor-style options for available styles.
prompt-command-cursor-style
style
defaultSet the style of the cursor in the command prompt when vi(1) keys are enabled and the prompt is in command mode. See the cursor-style options for available styles.
renumber-windows
[on | off]
offIf on, when a window is closed in a session, automatically renumber the other windows in numerical order. This respects the base-index option if it has been set.
repeat-time
time
500Allow multiple commands to be entered without pressing the prefix key again in the specified time milliseconds (the default is 500). Whether a key repeats may be set when it is bound using the -r flag to bind-key.
set-titles
[on | off]
offAttempt to set the client terminal title using the tsl and fsl terminfo(5) entries if they exist. tmux automatically sets these to the \e]0;.
set-titles-string
string
"#S:#I:#W - \"#T\" #{session_alerts}"String used to set the client terminal title if set-titles is on. Formats are expanded, see the FORMATS section.
silence-action
[any | none | current | other]
otherSet action on window silence when monitor-silence is on. The values are the same as those for activity-action.
status
[off | on | 2 | 3 | 4 | 5]
onShow or hide the status line or specify its size. Using on gives a status line one row in height; 2, 3, 4 or 5 more rows.
status-format
format
"#[align=left range=left #{E:status-left-style}]#[push-default]#{T;=/#{statSpecify the format to be used for each line of the status line. The default builds the top status line from the various individual status options below.
status-interval
interval
15Update the status line every interval seconds. By default, updates will occur every 15 seconds.
status-justify
[left | centre | right | absolute-centre]
leftSet the position of the window list in the status line: left, centre or right. centre puts the window list in the relative centre of the available free space; absolute-centre uses the centre of the entire horizontal space.
status-keys
[vi | emacs]
emacsUse vi or emacs-style key bindings in the status line, for example at the command prompt. The default is emacs, unless the VISUAL or EDITOR environment variables are set and contain the string ‘vi’.
status-left
string
"[#{session_name}] "Display string (by default the session name) to the left of the status line. string will be passed through strftime(3).
status-left-length
length
10Set the maximum length of the left component of the status line. The default is 10.
status-left-style
style
defaultSet the style of the left part of the status line. For how to specify style, see the STYLES section.
status-position
[top | bottom]
bottomSet the position of the status line.
status-right
string
"#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,}\"#{=21:pDisplay string to the right of the status line. By default, the current pane title in double quotes, the date and the time are shown.
status-right-length
length
40Set the maximum length of the right component of the status line. The default is 40.
status-right-style
style
defaultSet the style of the right part of the status line. For how to specify style, see the STYLES section.
status-style
style
bg=themegreen,fg=themeblackSet status line style. For how to specify style, see the STYLES section.
update-environment
variable
DISPLAY, KRB5CCNAME, MSYSTEM, SSH_ASKPASS, SSH_AUTH_SOCK, SSH_AGENT_PID, SSH_CONSet list of environment variables to be copied into the session environment when a new session is created or an existing session is attached. Any variables that do not exist in the source environment are set to be removed from the session environment (as if -r was given to the set-environment command).
visual-activity
[on | off | both]
offIf on, display a message instead of sending a bell when activity occurs in a window for which the monitor-activity window option is enabled. If set to both, a bell and a message are produced.
visual-bell
[on | off | both]
offIf on, a message is shown on a bell in a window for which the monitor-bell window option is enabled instead of it being passed through to the terminal (which normally makes a sound). If set to both, a bell and a message are produced.
visual-silence
[on | off | both]
offIf monitor-silence is enabled, prints a message after the interval has expired on a given window instead of sending a bell. If set to both, a bell and a message are produced.
word-separators
string
"!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~"Sets the session's conception of what characters are considered word separators, for the purposes of the next and previous word commands in copy mode. A space in string matches any character with the Unicode White_Space property.

Window & pane options 82 setw -g name value

OptionDefault in 3.8What it does
menu-style
style
bg=themedarkgrey,fg=themewhiteSet the menu style. See the STYLES section on how to specify style.
menu-selected-style
style
bg=themeyellow,fg=themeblackSet the selected menu item style. See the STYLES section on how to specify style.
menu-border-style
style
bg=themedarkgrey,fg=themelightgreySet the menu border style. See the STYLES section on how to specify style.
menu-border-lines
type
singleSet the type of characters used for drawing menu borders. See popup-border-lines for possible values for border-lines.
aggressive-resize
[on | off]
offAggressively resize the chosen window. This means that tmux will resize the window to the size of the smallest or largest session (see the window-size option) for which it is the current window, rather than the session to which it is attached.
automatic-rename
[on | off]
onControl automatic window renaming. When this setting is enabled, tmux will rename the window automatically using the format specified by automatic-rename-format.
automatic-rename-format
format
"#{?pane_in_mode,[tmux],#{pane_current_command}}#{?pane_dead,[dead],}"The format (see FORMATS) used when the automatic-rename option is enabled.
clock-mode-colour
colour
themeblueSet clock colour.
clock-mode-style
[12 | 24 | 12-with-seconds | 24-with-seconds]
24Set clock hour format.
display-panes-active-colour
colour
themeredSet the colour used by the display-panes command to show the indicator for the active pane.
display-panes-border-style
style
bg=themedarkgrey,fg=themelightgreySet the style of borders in panes mode used by the display-panes command. For how to specify style, see the STYLES section.
display-panes-colour
colour
themeblueSet the colour used by the display-panes command to show the indicators for inactive panes.
display-panes-format
format
"#[align=right]#{pane_unzoomed_width}x#{pane_unzoomed_height}"Set the format of the text shown by the display-panes command, expanded for each pane.
display-panes-time
time
1000Set the time in milliseconds for which the indicators shown by the display-panes command appear.
fill-character
format
"#{?is_inside,#[bg=themedarkgrey] ,#[fg=themelightgrey]#[acs]~}"Set the format used to fill areas of the terminal unused by a pane. The format is expanded once for areas inside the window with ‘is_inside’ set, and once for areas outside the window with ‘is_outside’ set.
main-pane-height
height
24
main-pane-width
width
80Set the width or height of the main (left or top) pane in the main-horizontal, main-horizontal-mirrored, main-vertical, or main-vertical-mirrored layouts. If suffixed by ‘%’, this is a percentage of the window size.
copy-mode-match-style
style
bg=themecyan,fg=themeblackSet the style of search matches in copy mode. For how to specify style, see the STYLES section.
copy-mode-mark-style
style
bg=themeyellow,fg=themeblackSet the style of the line containing the mark in copy mode. For how to specify style, see the STYLES section.
copy-mode-current-match-style
style
bg=thememagenta,fg=themeblackSet the style of the current search match in copy mode. For how to specify style, see the STYLES section.
copy-mode-position-format
format
"#[align=right]#{t/p:top_line_time}#{?#{e|>:#{top_line_time},0}, ,}[#{coFormat of the position indicator in copy mode.
copy-mode-position-style
style
"#{E:mode-style}"Set the style of the position indicator in copy mode. For how to specify style, see the STYLES section.
copy-mode-selection-style
style
"#{E:mode-style}"Set the style of the selection in copy mode. For how to specify style, see the STYLES section.
copy-mode-current-line-number-style
style
fg=themeyellowSet style of current line number in copy mode. For how to specify style, see the STYLES section.
copy-mode-current-line-style
style
defaultSet the style of the line containing the cursor in copy mode. For how to specify style, see the STYLES section.
copy-mode-line-number-style
style
fg=themelightgrey,dimSet style of line numbers in copy mode. For how to specify style, see the STYLES section.
copy-mode-line-numbers
[off | default | absolute | relative | hybrid]
offShow line numbers in copy mode. off hides line numbers, default shows line numbers matching the copy mode position indicator and goto-line, absolute shows absolute line numbers, relative shows line numbers relative to the cursor, and hybrid shows the current line number as absolute and other line numbers as relative.
mode-keys
[vi | emacs]
emacsUse vi or emacs-style key bindings in copy mode. The default is emacs, unless VISUAL or EDITOR contains ‘vi’.
mode-style
style
noattr,bg=themeyellow,fg=themeblackSet window modes style. For how to specify style, see the STYLES section.
monitor-activity
[on | off]
offMonitor for activity in the window. Windows with activity are highlighted in the status line.
monitor-bell
[on | off]
onMonitor for a bell in the window. Windows with a bell are highlighted in the status line.
monitor-silence
[interval]
0Monitor for silence (no activity) in the window within interval seconds. Windows that have been silent for the interval are highlighted in the status line.
other-pane-height
height
0Set the height of the other panes (not the main pane) in the main-horizontal and main-horizontal-mirrored layouts. If this option is set to 0 (the default), it will have no effect.
other-pane-width
width
0Like other-pane-height, but set the width of other panes in the main-vertical and main-vertical-mirrored layouts.
pane-active-border-style
style
"fg=#{?pane_modal_flag,themeblue,#{?pane_marked,thememagenta,#{?synchronizeSet the pane border style for the currently active pane. For how to specify style, see the STYLES section.
pane-base-index
index
0Like base-index, but set the starting index for pane numbers.
pane-border-format
format
"#{?pane_active,#[reverse],}#{pane_index}#[default] \"#{pane_title}\&qSet the text shown in pane border status lines.
pane-border-indicators
[off | colour | arrows | both]
colourIndicate active pane by colouring only half of the border in windows with exactly two panes, by displaying arrow markers, by drawing both or neither.
pane-border-lines
type
singleSet the type of characters used for drawing pane borders. type may be one of:
pane-border-status
[off | top | bottom | top-floating | bottom-floating]
offTurn pane border status lines off or set their position. If set to top-floating or bottom-floating, status lines are shown only on floating panes.
pane-border-style
style
fg=themelightgreySet the pane border style for panes aside from the active pane. For how to specify style, see the STYLES section.
popup-style
style
bg=themedarkgrey,fg=themewhiteSet the popup style. See the STYLES section on how to specify style.
popup-border-style
style
bg=themedarkgrey,fg=themelightgreySet the popup border style. See the STYLES section on how to specify style.
popup-border-lines
type
singleSet the type of characters used for drawing popup borders. type may be one of:
pane-scrollbars
[off | modal | on | auto-hide]
offWhen enabled, a character based scrollbar appears on the left or right of each pane. A filled section of the scrollbar, known as the ‘slider’, represents the position and size of the visible part of the pane content.
pane-scrollbars-position
[left | right]
rightSets which side of the pane to display pane scrollbars on.
pane-scrollbars-style
style
bg=themedarkgrey,fg=themelightgrey,width=1,pad=0Set the scrollbars style. For how to specify style, see the STYLES section.
pane-scrollbars-timeout
time
500Set the time in milliseconds before scrollbars are hidden when pane-scrollbars is modal or auto-hide.
pane-status-current-style
style
underscoreSet status line style for the currently active pane. For how to specify style, see the STYLES section.
pane-status-style
style
defaultSet status line style for a single pane. For how to specify style, see the STYLES section.
session-status-current-style
style
underscoreSet status line style for the currently active session. For how to specify style, see the STYLES section.
session-status-style
style
defaultSet status line style for a single session. For how to specify style, see the STYLES section.
tiled-layout-max-columns
number
0Set the maximum number of columns in the tiled layout. A value of 0 (the default) means no limit.
tree-mode-border-style
style
bg=themedarkgrey,fg=themelightgreySet the style of borders in tree mode. For how to specify style, see the STYLES section.
tree-mode-preview-format
format
"#{?pane_format,#{pane_index}:#{pane_title},#{window_index}:#{window_name}}Format of the preview indicator in tree mode.
tree-mode-preview-style
style
"fg=#{?#{||:#{&&:#{pane_format},#{pane_active}},#{&&:#{windSet the style of the preview indicator in tree mode. For how to specify style, see the STYLES section.
tree-mode-selection-style
style
"#{E:mode-style}"Set the style of the selected line in tree mode. For how to specify style, see the STYLES section.
window-status-activity-style
style
reverseSet status line style for windows with an activity alert. For how to specify style, see the STYLES section.
window-status-bell-style
style
reverseSet status line style for windows with a bell alert. For how to specify style, see the STYLES section.
window-status-current-format
string
"#I:#W#{?window_flags,#{window_flags}, }"Like window-status-format, but is the format used when the window is the current window.
window-status-current-style
style
underscoreSet status line style for the currently active window. For how to specify style, see the STYLES section.
window-status-format
string
"#I:#W#{?window_flags,#{window_flags}, }"Set the format in which the window is displayed in the status line window list. See the FORMATS and STYLES sections.
window-status-last-style
style
defaultSet status line style for the last active window. For how to specify style, see the STYLES section.
window-status-separator
string
" "Sets the separator drawn between windows in the status line. The default is a single space character.
window-status-style
style
defaultSet status line style for a single window. For how to specify style, see the STYLES section.
window-size
largest | smallest | manual | latest
latestConfigure how tmux determines the window size. If set to largest, the size of the largest attached session is used; if smallest, the size of the smallest.
allow-passthrough
[on | off | all]
offAllow programs in the pane to bypass tmux using a terminal escape sequence (\ePtmux;.\e\\).
allow-rename
[on | off]
offAllow programs in the pane to change the window name using a terminal escape sequence (\ek.\e\\).
allow-set-title
[on | off]
onAllow programs in the pane to change the title using the terminal escape sequences (\e]2;.\e\\ or \e]0;.
alternate-screen
[on | off]
onThis option configures whether programs running inside the pane may use the terminal alternate screen feature, which allows the smcup and rmcup terminfo(5) capabilities. The alternate screen feature preserves the contents of the window when an interactive application starts and restores it on exit, so that any output visible before the application starts reappears unchanged after it exits.
cursor-colour
colour
''Set the colour of the cursor.
cursor-style
style
defaultSet the style of the cursor. Available styles are: default, blinking-block, block, blinking-underline, underline, blinking-bar, bar.
remain-on-exit
[on | off | failed | key | failed-key]
offA pane with this flag set is not destroyed when the program running in it exits. If set to failed, then only when the program exit status is not zero.
remain-on-exit-format
string
"Pane is dead (#{?#{!=:#{pane_dead_status},},status #{pane_dead_status},}#{Set the text shown at the bottom of exited panes when remain-on-exit is enabled.
scroll-on-clear
[on | off]
onWhen the entire screen is cleared and this option is on, scroll the contents of the screen into history before clearing it.
switch-mode-match-style
style
"bg=cyan fg=black"Set the style of characters matched by the filter in switch-mode. For how to specify style, see the STYLES section.
synchronize-panes
[on | off]
offDuplicate input to all other panes in the same window where this option is also on (only for panes that are not in any mode).
window-active-style
style
defaultSet the pane style when it is the active pane. For how to specify style, see the STYLES section.
window-style
style
defaultSet the pane style. For how to specify style, see the STYLES section.
window-pane-status-format
string
"#P:[#T]#{?pane_flags,#{pane_flags}, }"Set the format in which the window pane is displayed in the status line window pane list. See the FORMATS and STYLES sections.
window-pane-current-status-format
string
"#P:[#T]#{?pane_flags,#{pane_flags}, }"Like window-status-format, but is the format used when the window is the current window.

Window options set with setw -g can also be set for one pane with set -p. A few options are not in this list: the dark-theme-* and light-theme-* colors (see themes), and the deprecated status-bg and status-fg, which still work but are folded into status-style.

Common .tmux.conf mistakes

  • Editing a file tmux is not reading. Check tmux display -p '#{config_files}'. If you edit ~/.tmux.conf but also have ~/.config/tmux/tmux.conf, the second one loads last and wins.
  • Expecting a running server to notice. Starting a new terminal does not reload anything while a tmux server is running. Run source-file, or tmux kill-server and start again.
  • Options from a newer tmux. invalid option: theme on Ubuntu's 3.4 means the line needs 3.8. Check tmux -V, use set -q or a %if version check, or upgrade tmux.
  • Old options from tmux 1.x. mode-mouse, mouse-select-pane, mouse-resize-pane and mouse-select-window were replaced by set -g mouse on in tmux 2.1; utf8 and status-utf8 are gone too. Delete them.
  • TPM's run line not last. Plugin options set after run '~/.tmux/plugins/tpm/tpm' are read too late. Keep it on the final line.
  • Unquoted special characters. # after a space starts a comment and ; ends a command, so quote values like "#[fg=red]" and keys like '"', and write \; to chain commands in a binding.
  • A fast status-interval with #(). A shell command in the status line runs every interval for every client. One second with several scripts costs real CPU on laptops; 5 to 15 is plenty.
  • Setting default-terminal to xterm-256color. Programs inside tmux should see tmux-256color (the default) or screen-256color; claiming to be xterm causes drawing bugs. Fix colors with terminal-features instead.

Frequently asked questions

Where is the tmux configuration file located?

In your home directory: ~/.tmux.conf, or ~/.config/tmux/tmux.conf (also $XDG_CONFIG_HOME/tmux/tmux.conf). tmux reads /etc/tmux.conf first and then every one of those that exists. None exist until you create one; run tmux display -p '#{config_files}' to see what your server read.

How do I reload .tmux.conf without restarting?

Run tmux source-file ~/.tmux.conf from a shell, or press Ctrl+b : and type source-file ~/.tmux.conf. Add bind r source-file ~/.tmux.conf \; display "Reloaded" to your config to reload with Ctrl+b r. Reloading keeps your sessions but does not undo lines you removed.

What is the default tmux config?

There is no default file: the defaults are built into tmux, and ~/.tmux.conf only lists your changes. See every default with tmux -L clean -f /dev/null start-server \; show-options -g, or browse the option reference above, which shows the tmux 3.8 default of every option.

What is the difference between set, set-option and setw?

set is the short alias of set-option. setw (set-window-option) is the same as set -w and sets window options. tmux works out an option's scope from its name, so in a config set -g mode-keys vi and setw -g mode-keys vi behave the same; -s marks server options and -g makes a setting global.

How do I see my current tmux settings?

tmux show -g (session options), tmux show -gw (window options) and tmux show -s (server options) print every value in effect. tmux show -gv history-limit prints one. Inside tmux, Ctrl+b C opens customize mode, where you can browse and change options and key bindings.

How do I reset tmux to its default settings?

Move your config aside (mv ~/.tmux.conf ~/.tmux.conf.old) and restart the server with tmux kill-server, which closes every session. To try the defaults without closing anything, start a separate server: tmux -L clean -f /dev/null.

Does tmux support ~/.config/tmux/tmux.conf?

Yes, since tmux 3.1 (and $XDG_CONFIG_HOME/tmux/tmux.conf since 3.2). Both it and ~/.tmux.conf load if both exist, so use one of them.

Should I use Oh my tmux or write my own config?

Oh my tmux is a large ready-made config with a Powerline-style status bar; you customize it in a separate .local file. A short config of your own is easier to understand and debug. Compare them in the Oh my tmux guide.

Keep learning

Something wrong or out of date on this page? Email hello@tmux.app and we will fix it.