1001Ferramentas
🪟 Dev

tmux.conf Generator

Create a custom tmux.conf: prefix key, status bar, mouse, splits and pane navigation shortcuts.

A .tmux.conf that fixes the defaults that annoy everyone

tmux keeps terminal sessions alive even when an SSH connection drops, which is why it became required equipment for anyone administering servers. Its factory configuration, though, carries decisions from the 1980s that get in the way today: the Ctrl-B prefix is awkward and clashes with editor shortcuts, window numbering starts at zero while the keyboard starts at one, and the mouse is off.

Pick your options and the page assembles the file. Switching the prefix to Ctrl-A is the most common change — it is the key GNU Screen used, it sits next to Ctrl and it stays out of the way of editing shortcuts. Turning the mouse on lets you select panes, resize by dragging the divider and scroll the history with the wheel. Starting numbering at 1 lines the windows up with the number row.

There are also the pane split bindings, which by default are % and quote, two symbols with no visual relationship to what they do: the | and - options make it obvious which split is which. Save the result as ~/.tmux.conf and reload with tmux source-file ~/.tmux.conf, or exit every session — configuration is not reapplied to a session that is already running.

Frequently asked questions

Does switching the prefix to Ctrl-A break anything?
One thing: Ctrl-A is the "go to start of line" shortcut in bash and any shell with emacs-style editing. That is why the generated configuration includes bind C-a send-prefix, which makes pressing Ctrl-A twice send the original character through to the program inside.
Why are colours wrong inside tmux?
It is nearly always the TERM variable. The 256-colour option sets default-terminal to screen-256color, which is the minimum for vim and other colourful programs to behave. For 24-bit colour you also need a terminal-overrides line with the Tc capability.
Does this replace screen?
It does the same basic job and goes further on pane splitting and session scripting. screen still ships preinstalled on older systems, and knowing both helps; if you are starting from scratch, tmux has simpler configuration and active development.

Related Tools