tmux
A terminal multiplexer that lets you run and manage multiple terminal sessions inside one window.
π Detach & reattach sessions
π§© Split panes & multiple windows
π§ Persistent workflows
π₯οΈ Great over SSH
What is tmux?
tmux (terminal multiplexer) allows you to create a session that contains multiple windows and panes. You can split your terminal into side-by-side panes, keep long-running commands alive, and even disconnect (detach) and reconnect (attach) later β especially useful when working on remote servers over SSH.
Why people use it
- Persistence: run builds, logs, and servers without losing them when your terminal closes.
- Organization: group related tasks into windows/panes (editor, tests, logs, git).
- Remote-friendly: detach before you lose connection; reattach when youβre back.
- Efficiency: navigate with keyboard shortcuts instead of juggling many terminal tabs.
Quick start cheatsheet
# Create a new session
tmux new -s work
# Detach (default prefix is Ctrl-b, then d)
Ctrl-b d
# List sessions
tmux ls
# Attach to a session
tmux attach -t work
# Split panes (Ctrl-b then % or ")
Ctrl-b % # vertical split
Ctrl-b " # horizontal split
# Switch panes
Ctrl-b o
# Create a new window
Ctrl-b c
# Rename current window
Ctrl-b ,
Tip: Most tmux commands use the prefix key (default Ctrl-b), followed by another key.
You can remap the prefix in your ~/.tmux.conf if you prefer.
Resources
- tmux on GitHub (source, releases, issues)
- tmux man page (online)
- tmux Wiki (tips, docs, examples)
- TPM β Tmux Plugin Manager
- tmuxinator (project/session templates)
Common next steps
- Create a
~/.tmux.confto customize keys, status bar, and behavior. - Install TPM for plugins.
- Try a session template tool like tmuxinator.
Example minimal ~/.tmux.conf
# Mouse support (optional)
set -g mouse on
# Faster key response
set -sg escape-time 10
# Better pane navigation
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R