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.
On this page
- tmux config essentials
- Where is the tmux config file?
- Reload .tmux.conf without restarting
- set, setw and set -s: option scopes
- Key bindings: bind, unbind and key tables
- Customize the status bar
- Themes and colors: the tmux 3.8 theme option
- True color (24-bit RGB)
- Mouse mode
- Build a config with the generator
- Complete option reference
- Popular .tmux.conf snippets
- Common .tmux.conf mistakes
- 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:
tmux source-file ~/.tmux.confInside tmux you can also press Ctrl+b : and type source-file ~/.tmux.conf.
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:
# 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"| Line | What it changes | Needed on |
|---|---|---|
base-index 1, pane-base-index 1 | The first window is Ctrl+b 1 instead of Ctrl+b 0, which sits at the far end of the keyboard. | All versions |
renumber-windows on | Closing window 2 of 1, 2, 3 leaves 1, 2 instead of a gap. | All versions |
history-limit 50000 | Lines 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 …:RGB | Lets 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 on | Click panes and windows, drag borders, scroll. | 3.7 and older (on by default in 3.8) |
set -s escape-time 10 | Removes 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.
Create the file
Open
~/.tmux.confin your editor; it does not exist until you create it. Prefer XDG folders? Use~/.config/tmux/tmux.confinstead (mkdir -p ~/.config/tmuxfirst).shellnano ~/.tmux.confReload 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:
| Path | Used for | Notes |
|---|---|---|
/etc/tmux.conf | System-wide settings for every user | Homebrew builds use $(brew --prefix)/etc/tmux.conf instead |
~/.tmux.conf | Your config: the classic location | Works on every tmux version |
$XDG_CONFIG_HOME/tmux/tmux.conf | Your config, XDG style | Only when XDG_CONFIG_HOME is set; tmux 3.2+ |
~/.config/tmux/tmux.conf | Your config, XDG default | Supported 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:
tmux display-message -p '#{config_files}'
/etc/tmux.conf,/home/dev/.tmux.conf,/home/dev/.config/tmux/tmux.confUse 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:
# 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/nullThere 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:
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 withunbindorset -u. - Some options only affect new things.
history-limit,default-shellanddefault-commandapply to panes created afterwards. set -aappends again. Lines likeset -as terminal-features …add a duplicate entry on every reload. That is harmless for terminal features; for strings you append to (such asstatus-right) prefer plainset.- Errors name the line. A bad line prints something like
~/.tmux.conf:12: invalid option: fooand 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.
# 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/*.confMaking one file work on several tmux versions? Wrap newer lines in a version check, which tmux 3.0 and later understand:
%if #{>=:#{version},3.8}
set -s theme dark
%endifset, 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:
| Command | Changes | Example |
|---|---|---|
set -s | A server option | set -s escape-time 10 |
set -g | A global session option: the value every session uses unless it has its own | set -g prefix C-a |
set (no -g) | The current session only (or -t work) | set -t work status off |
setw -g or set -wg | A global window option | setw -g mode-keys vi |
set -p | One pane | set -p remain-on-exit on |
set -a | Appends to a string or array instead of replacing it | set -as terminal-features ",foot:RGB" |
set -u | Unsets: back to the inherited or default value | set -gu status-left |
set -o | Sets only if not already set (error otherwise) | set -go @theme dark |
set -q | Quiet: no error for an unknown option, handy for options an older tmux lacks | set -gq allow-passthrough on |
set -F | Expands formats in the value first | set -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:

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 CKey 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.
# 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 table | When it is used | Bind with |
|---|---|---|
prefix | After the prefix key | bind x … |
root | Always, with no prefix. Keys bound here never reach programs | bind -n M-x … |
copy-mode-vi, copy-mode | In copy mode with vi or emacs keys | bind -T copy-mode-vi y … |
| Your own table | After switch-client -T name, for chords like Ctrl+b g then a key | bind -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:
The pieces you can use in status-left, status-right and the window formats:
| Write | Shows |
|---|---|
#S or #{session_name} | Session name |
#I, #W, #F | Window index, window name, window flags (* current, - last, Z zoomed) |
#h, #H | Short and full host name |
#P, #T | Pane index, pane title |
#{pane_current_path} | Directory of the active pane (any format variable works) |
%H:%M, %d-%b, %Y-%m-%d | Time 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:
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 olderThe 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:
| Name | Dark theme (256+ colors) | Light theme (256+ colors) | Used by default for |
|---|---|---|---|
themegreen | yellowgreen | seagreen | Status line, active pane border |
themeblack | gray5 | gray10 | Status line text |
themeyellow | darkgoldenrod | darkgoldenrod | Messages, copy mode selection |
themecyan | cadetblue | darkcyan | Copy mode search matches |
themelightgrey | gray70 | gray80 | Inactive pane borders |
themedarkgrey | gray15 | gray45 | Scrollbars |
themered, themeblue, thememagenta, themewhite | indianred, skyblue3, mediumpurple, gray90 | indianred4, steelblue, purple4, gray95 | Active 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:
# 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):
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:
set -g mouse onWith 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.
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
| Option | Default in 3.8 | What it does |
|---|---|---|
backspacekey | C-? | Set the key sent by tmux for backspace. |
buffer-limitnumber | 50 | Set 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] | on | When 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-aliasname=value | split-pane=split-window, splitp=split-window, "server-info=show-messages -J | This is an array of custom aliases for commands. If an unknown command matches name, it is replaced with value. |
copy-commandshell-command | '' | Give the command to pipe to if the copy-pipe copy mode command is used without arguments. |
theme[detect | terminal | light | dark] | detect | Whether tmux should use the detected client theme (detect), use terminal ANSI colours (terminal), or force the light or dark theme. |
default-client-commandcommand | new-session | Set the default command to run when tmux is called without a command. The default is new-session. |
default-terminalterminal | tmux-256color | Set 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-timetime | 10 | Set 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. |
editorshell-command | /usr/bin/vi | Set the command used when tmux runs an editor. |
exit-empty[on | off] | on | If enabled (the default), the server will exit when there are no active sessions. |
exit-unattached[on | off] | off | If enabled, the server will exit when there are no attached clients. |
extended-keys[on | off | always] | off | Controls 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] | xterm | Selects 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] | off | When 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] | buffer | Controls the behaviour when an application requests the clipboard from tmux. |
history-filepath | '' | If not empty, a file to which tmux will write command prompt history on exit and load it from on start. |
input-buffer-sizebytes | 1048576 | Maximum of bytes allowed to read in escape and control sequences. Once reached, the sequence will be discarded. |
message-limitnumber | 1000 | Set the number of error or information messages to save in the message log for each client. |
prompt-history-limitnumber | 100 | Set the number of history items to save in the history file for each type of command prompt. |
set-clipboard[on | external | off] | external | Attempt 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-featuresstring | xterm*:clipboard:ccolour:cstyle:focus:title, screen*:title, rxvt*:ignorefkeys | Set terminal features for terminal types read from terminfo(5). tmux has a set of named terminal features. |
terminal-overridesstring | 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] | on | Always 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-timeouttime | 0 | Set 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
| Option | Default in 3.8 | What it does |
|---|---|---|
focus-follows-mouse[on | off] | off | When enabled and mouse is on, moving the mouse into a pane selects it. |
activity-action[any | none | current | other] | other | Set 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-timemilliseconds | 1 | If 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-indexindex | 0 | Set 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] | any | Set action on a bell in a window when monitor-bell is on. The values are the same as those for activity-action. |
default-commandshell-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-shellpath | /bin/bash | Specify 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-sizeXxY | 80x24 | Set 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] | off | If 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] | on | If 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-timetime | 750 | Set 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-limitlines | 2000 | Set the maximum number of lines held in pane history. |
initial-repeat-timetime | 0 | Set 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-tablekey-table | root | Set the default key table to key-table instead of root. |
lock-after-timenumber | 0 | Lock the session (like the lock-session command) after number seconds of inactivity. The default is not to lock (set to 0). |
lock-commandshell-command | "lock -np" | Command to run when locking each client. The default is to run lock(1) with -np. |
message-command-stylestyle | "bg=themeblack,fg=themeyellow,#{?#{m/r:(^|#,)IS(PANE|MODE)($|#,),#{prompt_f | Set status line message command style. This is used for the command prompt with vi(1) keys when in command mode. |
message-formatstring | "#[#{?#{command_prompt},#{E:message-command-style},#{E:message-style}}]#{me | Set 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] | 0 | Set line on which status line messages and the command prompt are shown. |
message-stylestyle | "bg=themeyellow,fg=themeblack,#{?#{m/r:(^|#,)IS(PANE|MODE)($|#,),#{prompt_f | Set status line message style. This is used for messages and for the command prompt. |
mouse[on | off] | on | If on, tmux captures the mouse and allows mouse events to be bound as key bindings. See the MOUSE SUPPORT section for details. |
prefixkey | C-b | Set 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. |
prefix2key | None | Set a secondary key accepted as a prefix key. Like prefix, prefix2 can be set to ‘None’. |
prompt-cursor-colourcolour | '' | Set the colour of the cursor in the command prompt. |
prompt-command-cursor-colourcolour | '' | 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-stylestyle | default | Set the style of the cursor in the command prompt. See the cursor-style options for available styles. |
prompt-command-cursor-stylestyle | default | Set 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] | off | If 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-timetime | 500 | Allow 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] | off | Attempt 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-stringstring | "#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] | other | Set 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] | on | Show 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-formatformat | "#[align=left range=left #{E:status-left-style}]#[push-default]#{T;=/#{stat | Specify 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-intervalinterval | 15 | Update the status line every interval seconds. By default, updates will occur every 15 seconds. |
status-justify[left | centre | right | absolute-centre] | left | Set 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] | emacs | Use 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-leftstring | "[#{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-lengthlength | 10 | Set the maximum length of the left component of the status line. The default is 10. |
status-left-stylestyle | default | Set the style of the left part of the status line. For how to specify style, see the STYLES section. |
status-position[top | bottom] | bottom | Set the position of the status line. |
status-rightstring | "#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,}\"#{=21:p | Display 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-lengthlength | 40 | Set the maximum length of the right component of the status line. The default is 40. |
status-right-stylestyle | default | Set the style of the right part of the status line. For how to specify style, see the STYLES section. |
status-stylestyle | bg=themegreen,fg=themeblack | Set status line style. For how to specify style, see the STYLES section. |
update-environmentvariable | DISPLAY, KRB5CCNAME, MSYSTEM, SSH_ASKPASS, SSH_AUTH_SOCK, SSH_AGENT_PID, SSH_CON | Set 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] | off | If 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] | off | If 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] | off | If 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-separatorsstring | "!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~" | 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
| Option | Default in 3.8 | What it does |
|---|---|---|
menu-stylestyle | bg=themedarkgrey,fg=themewhite | Set the menu style. See the STYLES section on how to specify style. |
menu-selected-stylestyle | bg=themeyellow,fg=themeblack | Set the selected menu item style. See the STYLES section on how to specify style. |
menu-border-stylestyle | bg=themedarkgrey,fg=themelightgrey | Set the menu border style. See the STYLES section on how to specify style. |
menu-border-linestype | single | Set the type of characters used for drawing menu borders. See popup-border-lines for possible values for border-lines. |
aggressive-resize[on | off] | off | Aggressively 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] | on | Control automatic window renaming. When this setting is enabled, tmux will rename the window automatically using the format specified by automatic-rename-format. |
automatic-rename-formatformat | "#{?pane_in_mode,[tmux],#{pane_current_command}}#{?pane_dead,[dead],}" | The format (see FORMATS) used when the automatic-rename option is enabled. |
clock-mode-colourcolour | themeblue | Set clock colour. |
clock-mode-style[12 | 24 | 12-with-seconds | 24-with-seconds] | 24 | Set clock hour format. |
display-panes-active-colourcolour | themered | Set the colour used by the display-panes command to show the indicator for the active pane. |
display-panes-border-stylestyle | bg=themedarkgrey,fg=themelightgrey | Set the style of borders in panes mode used by the display-panes command. For how to specify style, see the STYLES section. |
display-panes-colourcolour | themeblue | Set the colour used by the display-panes command to show the indicators for inactive panes. |
display-panes-formatformat | "#[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-timetime | 1000 | Set the time in milliseconds for which the indicators shown by the display-panes command appear. |
fill-characterformat | "#{?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-heightheight | 24 | |
main-pane-widthwidth | 80 | Set 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-stylestyle | bg=themecyan,fg=themeblack | Set the style of search matches in copy mode. For how to specify style, see the STYLES section. |
copy-mode-mark-stylestyle | bg=themeyellow,fg=themeblack | Set the style of the line containing the mark in copy mode. For how to specify style, see the STYLES section. |
copy-mode-current-match-stylestyle | bg=thememagenta,fg=themeblack | Set the style of the current search match in copy mode. For how to specify style, see the STYLES section. |
copy-mode-position-formatformat | "#[align=right]#{t/p:top_line_time}#{?#{e|>:#{top_line_time},0}, ,}[#{co | Format of the position indicator in copy mode. |
copy-mode-position-stylestyle | "#{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-stylestyle | "#{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-stylestyle | fg=themeyellow | Set style of current line number in copy mode. For how to specify style, see the STYLES section. |
copy-mode-current-line-stylestyle | default | Set the style of the line containing the cursor in copy mode. For how to specify style, see the STYLES section. |
copy-mode-line-number-stylestyle | fg=themelightgrey,dim | Set 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] | off | Show 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] | emacs | Use vi or emacs-style key bindings in copy mode. The default is emacs, unless VISUAL or EDITOR contains ‘vi’. |
mode-stylestyle | noattr,bg=themeyellow,fg=themeblack | Set window modes style. For how to specify style, see the STYLES section. |
monitor-activity[on | off] | off | Monitor for activity in the window. Windows with activity are highlighted in the status line. |
monitor-bell[on | off] | on | Monitor for a bell in the window. Windows with a bell are highlighted in the status line. |
monitor-silence[interval] | 0 | Monitor 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-heightheight | 0 | Set 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-widthwidth | 0 | Like other-pane-height, but set the width of other panes in the main-vertical and main-vertical-mirrored layouts. |
pane-active-border-stylestyle | "fg=#{?pane_modal_flag,themeblue,#{?pane_marked,thememagenta,#{?synchronize | Set the pane border style for the currently active pane. For how to specify style, see the STYLES section. |
pane-base-indexindex | 0 | Like base-index, but set the starting index for pane numbers. |
pane-border-formatformat | "#{?pane_active,#[reverse],}#{pane_index}#[default] \"#{pane_title}\&q | Set the text shown in pane border status lines. |
pane-border-indicators[off | colour | arrows | both] | colour | Indicate 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-linestype | single | Set the type of characters used for drawing pane borders. type may be one of: |
pane-border-status[off | top | bottom | top-floating | bottom-floating] | off | Turn 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-stylestyle | fg=themelightgrey | Set the pane border style for panes aside from the active pane. For how to specify style, see the STYLES section. |
popup-stylestyle | bg=themedarkgrey,fg=themewhite | Set the popup style. See the STYLES section on how to specify style. |
popup-border-stylestyle | bg=themedarkgrey,fg=themelightgrey | Set the popup border style. See the STYLES section on how to specify style. |
popup-border-linestype | single | Set the type of characters used for drawing popup borders. type may be one of: |
pane-scrollbars[off | modal | on | auto-hide] | off | When 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] | right | Sets which side of the pane to display pane scrollbars on. |
pane-scrollbars-stylestyle | bg=themedarkgrey,fg=themelightgrey,width=1,pad=0 | Set the scrollbars style. For how to specify style, see the STYLES section. |
pane-scrollbars-timeouttime | 500 | Set the time in milliseconds before scrollbars are hidden when pane-scrollbars is modal or auto-hide. |
pane-status-current-stylestyle | underscore | Set status line style for the currently active pane. For how to specify style, see the STYLES section. |
pane-status-stylestyle | default | Set status line style for a single pane. For how to specify style, see the STYLES section. |
session-status-current-stylestyle | underscore | Set status line style for the currently active session. For how to specify style, see the STYLES section. |
session-status-stylestyle | default | Set status line style for a single session. For how to specify style, see the STYLES section. |
tiled-layout-max-columnsnumber | 0 | Set the maximum number of columns in the tiled layout. A value of 0 (the default) means no limit. |
tree-mode-border-stylestyle | bg=themedarkgrey,fg=themelightgrey | Set the style of borders in tree mode. For how to specify style, see the STYLES section. |
tree-mode-preview-formatformat | "#{?pane_format,#{pane_index}:#{pane_title},#{window_index}:#{window_name}} | Format of the preview indicator in tree mode. |
tree-mode-preview-stylestyle | "fg=#{?#{||:#{&&:#{pane_format},#{pane_active}},#{&&:#{wind | Set the style of the preview indicator in tree mode. For how to specify style, see the STYLES section. |
tree-mode-selection-stylestyle | "#{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-stylestyle | reverse | Set status line style for windows with an activity alert. For how to specify style, see the STYLES section. |
window-status-bell-stylestyle | reverse | Set status line style for windows with a bell alert. For how to specify style, see the STYLES section. |
window-status-current-formatstring | "#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-stylestyle | underscore | Set status line style for the currently active window. For how to specify style, see the STYLES section. |
window-status-formatstring | "#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-stylestyle | default | Set status line style for the last active window. For how to specify style, see the STYLES section. |
window-status-separatorstring | " " | Sets the separator drawn between windows in the status line. The default is a single space character. |
window-status-stylestyle | default | Set status line style for a single window. For how to specify style, see the STYLES section. |
window-sizelargest | smallest | manual | latest | latest | Configure 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. |
wrap-search[on | off] | on | If this option is set, searches will wrap around the end of the pane contents. The default is on. |
allow-passthrough[on | off | all] | off | Allow programs in the pane to bypass tmux using a terminal escape sequence (\ePtmux;.\e\\). |
allow-rename[on | off] | off | Allow programs in the pane to change the window name using a terminal escape sequence (\ek.\e\\). |
allow-set-title[on | off] | on | Allow programs in the pane to change the title using the terminal escape sequences (\e]2;.\e\\ or \e]0;. |
alternate-screen[on | off] | on | This 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-colourcolour | '' | Set the colour of the cursor. |
cursor-stylestyle | default | Set 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] | off | A 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-formatstring | "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] | on | When the entire screen is cleared and this option is on, scroll the contents of the screen into history before clearing it. |
switch-mode-match-stylestyle | "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] | off | Duplicate 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-stylestyle | default | Set the pane style when it is the active pane. For how to specify style, see the STYLES section. |
window-stylestyle | default | Set the pane style. For how to specify style, see the STYLES section. |
window-pane-status-formatstring | "#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-formatstring | "#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.
Popular .tmux.conf snippets
Each block loads without errors in tmux 3.8 and 3.4 (checked 28 October 2026 by loading it with source-file into both). Plugin lines need TPM, with run '~/.tmux/plugins/tpm/tpm' as the last line of the file.
Sensible defaults
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
set -g history-limit 50000
set -g display-time 2000
set -s focus-events on
# Needed on tmux 3.7 and older only:
set -g mouse on
set -s escape-time 10Change the prefix to Ctrl+a
unbind C-b
set -g prefix C-a
# Ctrl+a twice sends Ctrl+a (start of line in bash)
bind C-a send-prefixPrefer Ctrl+Space? Use C-Space in all three lines.
Mouse on, with a toggle
set -g mouse on
bind m set -g mouse \; display "mouse #{?mouse,on,off}"Vi copy mode
setw -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancelEnter copy mode with Ctrl+b [. More in copy mode.
Pane navigation and splits
# Alt+arrows, no prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Vim keys after the prefix
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# | and - split in the current directory
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"Resurrect and continuum
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Restore the last save when tmux starts
set -g @continuum-restore 'on'
run '~/.tmux/plugins/tpm/tpm'Ctrl+b Ctrl+s saves, Ctrl+b Ctrl+r restores; continuum saves every 15 minutes.
24-bit true color
# Use your outer $TERM; add one line per terminal type
set -as terminal-features ",xterm-256color:RGB"
set -as terminal-features ",xterm-ghostty:RGB"System clipboard
# Let Neovim and SSH sessions set the clipboard (OSC 52)
set -s set-clipboard on
# Or pipe copies to a program (pick one)
set -s copy-command 'pbcopy'
# set -s copy-command 'wl-copy'
# set -s copy-command 'xclip -selection clipboard -in'
# set -s copy-command 'clip.exe'copy-command (tmux 3.2+) is used by every copy binding. Details: clipboard.
Catppuccin theme
set -g @plugin 'catppuccin/tmux#v2.3.2'
set -g @catppuccin_flavor 'mocha'
set -g @catppuccin_window_status_style 'rounded'Pinned to a release, as the Catppuccin README recommends. Flavors: latte, frappe, macchiato, mocha.
Tokyo Night theme
set -g @plugin 'janoamaral/tokyo-night-tmux'
set -g @tokyo-night-tmux_theme stormThemes: night, storm, moon, day. Needs a Nerd Font and Bash 4.2+. tmux-powerkit also has Tokyo Night as one of its themes.
Dracula theme
set -g @plugin 'dracula/tmux'
set -g @dracula-show-powerline true
set -g @dracula-plugins "cpu-usage ram-usage time"Status line at the top, pane titles
set -g status-position top
set -g status-justify centre
setw -g pane-border-status top
setw -g pane-border-format " #P: #{pane_current_command} "
setw -g pane-border-lines heavyCommon .tmux.conf mistakes
- Editing a file tmux is not reading. Check
tmux display -p '#{config_files}'. If you edit~/.tmux.confbut 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, ortmux kill-serverand start again. - Options from a newer tmux.
invalid option: themeon Ubuntu's 3.4 means the line needs 3.8. Checktmux -V, useset -qor a%ifversion check, or upgrade tmux. - Old options from tmux 1.x.
mode-mouse,mouse-select-pane,mouse-resize-paneandmouse-select-windowwere replaced byset -g mouse onin tmux 2.1;utf8andstatus-utf8are gone too. Delete them. - TPM's
runline not last. Plugin options set afterrun '~/.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-intervalwith#(). 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-terminaltoxterm-256color. Programs inside tmux should seetmux-256color(the default) orscreen-256color; claiming to be xterm causes drawing bugs. Fix colors withterminal-featuresinstead.
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.