Configuration Reference & Builder

Master Your tmux Configuration

The ~/.tmux.conf file is the brain of your terminal environment. It controls everything from your prefix key and mouse behaviour to status bar content, TrueColor rendering, and copy-mode keybindings. Use our interactive generator or choose from battle-tested production snippets below.

Every snippet on this page loads without errors in tmux 3.7c (checked October 2026)

tmux config essentials

A tmux config is just a list of options in ~/.tmux.conf. The four most common are turning on the mouse, starting window numbering at 1, raising the scrollback limit, and lowering escape-time so Vim and Neovim respond instantly to Esc (tmux 3.5 and newer already default to 10 ms). The popular snippets below cover these and more, and the config generator writes the file for you if you would rather not edit it by hand.

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

Config File Location & Reloading

Where tmux looks for its configuration file and how to apply changes without restarting.

📁 File Locations

When the server starts, tmux first loads the system-wide file (if present), then the first user file it finds:

  • /etc/tmux.conf — system-wide (Homebrew: $(brew --prefix)/etc/tmux.conf)
  • ~/.tmux.conf — user config (most common)
  • $XDG_CONFIG_HOME/tmux/tmux.conf — XDG path
  • ~/.config/tmux/tmux.conf — XDG fallback (tmux 3.1+)

Config is read once, when the server starts. Edits do nothing until you reload or run tmux kill-server.

🔄 Reload Without Restarting

After editing your config, reload it inside tmux without losing sessions:

bash / tmux command mode

# From outside tmux

$ tmux source-file ~/.tmux.conf


# From inside tmux (command mode)

$ Ctrl+b : source-file ~/.tmux.conf


# Bind reload to Ctrl+b r (add to .tmux.conf)

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

Interactive .tmux.conf Generator

Tweak the controls and get a live, syntax-highlighted .tmux.conf preview. Copy or download your config in one click.

⚙ Options

~/.tmux.conf


                

Complete Option Reference

Every commonly used set-option and set-window-option documented with type, default, and description.

Option Command Default Description
prefixset -g prefix C-bC-bThe key combination used to send commands to tmux.
mouseset -g mouse onoffEnable mouse support: click to select panes/windows, scroll, resize panes. Also needed to move and resize floating panes (3.7+).
base-indexset -g base-index 10Starting index for window numbers. 1 is more ergonomic for keyboard switching.
pane-base-indexsetw -g pane-base-index 10Starting index for pane numbers within windows.
history-limitset -g history-limit 500002000Number of lines to keep in scrollback buffer per pane.
statusset -g status ononShow or hide the status bar.
status-positionset -g status-position topbottomPosition of the status bar (top or bottom).
status-intervalset -g status-interval 515How often (seconds) to refresh the status bar.
status-leftset -g status-left " #S "[#{session_name}] Content displayed on the left side of the status bar. Supports format variables.
status-rightset -g status-right " %H:%M %d-%b "pane title + time + dateContent displayed on the right side of the status bar. Supports strftime codes such as %H:%M.
status-styleset -g status-style "bg=#1e1e2e,fg=#cdd6f4"bg=green,fg=blackColour and attributes of the status bar background.
window-status-formatsetw -g window-status-format " #I:#W "#I:#W#F (index:name+flags)Format string for inactive window entries in the status bar.
window-status-current-formatsetw -g window-status-current-format " #I:#W* "#I:#W#FFormat string for the active window entry in the status bar.
pane-border-styleset -g pane-border-style "fg=#3b4261"defaultVisual style of inactive pane borders.
pane-active-border-styleset -g pane-active-border-style "fg=#7aa2f7"green (yellow in copy mode, red when synchronized)Visual style of the active (focused) pane border.
message-styleset -g message-style "bg=#f38ba8,fg=#1e1e2e,fill=#f38ba8"bg=yellow,fg=black,fill=yellowStyle of messages and the command prompt. tmux 3.7+: include fill= or the colour only covers the message text, not the whole status line.
mode-keyssetw -g mode-keys viemacsKey mode for copy mode and command mode (emacs or vi).
escape-timeset -sg escape-time 1010 (500 before tmux 3.5)Time (ms) tmux waits after Escape to tell it apart from a key sequence. On tmux 3.4 and older, set it to 10 to remove the Vim/Neovim Esc lag; raise it a little on slow SSH links.
default-terminalset -g default-terminal "tmux-256color"tmux-256color if installed, else screen (tmux 3.3+)The TERM value inside tmux. tmux-256color enables italics and 256 colours; use screen-256color on old systems without that terminfo entry.
terminal-featuresset -as terminal-features ",xterm-256color:RGB"—Tell tmux the outside terminal supports 24-bit colour (tmux 3.2+). On older versions use set -ga terminal-overrides ",*256col*:Tc".
renumber-windowsset -g renumber-windows onoffAutomatically renumber windows when one is closed, keeping numbers sequential.
aggressive-resizesetw -g aggressive-resize onoffResize window to the smallest attached client only when viewing that window.
Debugging & Best Practices

Crucial .tmux.conf Configuration Gotchas

Avoid the most common configuration pitfalls when setting up your terminal multiplexer.

🔄 Hot-Reloading Without Session Loss

Never terminate running build jobs to test a config edit. Add this hotkey to reload changes instantly:

bind r source-file ~/.tmux.conf \; display-message "✅ Config reloaded!"
⚠️ Status Bar Interval CPU Spikes

Setting status-interval 1 runs status line shell scripts every second. On battery power, this can drain CPU. Use 5 to 15 seconds for ideal balance.

set -g status-interval 10
📦 Plugin Loading Order Rule

When using TPM (Tmux Plugin Manager), the line run '~/.tmux/plugins/tpm/tpm' MUST always be the very last line of ~/.tmux.conf. Any options declared after it will be ignored by plugins.

Advanced Configuration Guides