Tmux Key Concepts
Before you can use tmux fluently, you need to internalize five core concepts: the server, sessions, windows, panes, and the prefix key.
Tmux organizes terminal real estate in a strict hierarchy: Server → Sessions → Windows → Panes.
The Five Core Concepts
1. The Tmux Server
Tmux runs as a background daemon the moment you start your first session. It persists independently of any terminal.
# you can see it as a process
pgrep -la tmux
The server starts automatically on first use. You do not need to manage it manually.
2. Sessions
A session is a named workspace. It groups windows together.
tmux new -s work # create session named "work"
tmux new -s monitoring # another session
tmux ls # list all sessions
tmux switch -t monitoring # switch between sessions
When to use multiple sessions:
work— editor, development shellmonitoring— htop, logs, tail -fdeploy— deployment script, rollback shell
3. Windows
A window is like a tab in a browser. It fills the whole terminal area.
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b c | Ctrl+Space W | Create new window |
Ctrl+b , | Prefix e w | Rename current window |
Ctrl+b n | Alt+PageDown | Next window |
Ctrl+b p | Alt+PageUp | Previous window |
Ctrl+b 0-9 | Alt+1/2/3 or Ctrl+Space 0-9 | Switch to window by number |
Ctrl+b w | Ctrl+Space w | Interactive window list |
# from shell (outside tmux)
tmux new-window -t work:2 -n "logs"
4. Panes
A pane is a split section inside a window. You can have multiple terminals visible simultaneously.
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b % | `Ctrl+Space | ` |
Ctrl+b " | Ctrl+Space - | Split pane horizontally (top/bottom) |
Ctrl+b arrow | Alt+arrows or Alt+h/j/k/l | Move focus between panes |
Ctrl+b x | Ctrl+Space x | Kill current pane |
Ctrl+b z | Ctrl+Space z or Alt+z | Zoom/unzoom current pane (fullscreen toggle) |
5. The Prefix Key
Every tmux shortcut starts with the prefix key (Ctrl+b by default), followed by a command key.
Ctrl+b → release → command key
You must press and release Ctrl+b before pressing the command key. Do not hold all three at once.
Practice the most important shortcuts:
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b d | Ctrl+Space d | Detach (keeps session alive) |
Ctrl+b c | Ctrl+Space W | New window |
Ctrl+b % | `Ctrl+Space | ` |
Ctrl+b " | Ctrl+Space - | Horizontal split |
Ctrl+b [ | Ctrl+Space [ | Enter copy/scroll mode |
Ctrl+b : | Ctrl+Space : | Open tmux command prompt |
Ctrl+b ? | Ctrl+Space ? | Show all key bindings |
Command Mode
Pressing Ctrl+b : opens the tmux command prompt at the bottom of your screen. You can type any tmux command here:
# at the Ctrl+b : prompt:
new-window -n "logs"
split-window -h
kill-pane
This is equivalent to running tmux <command> from your shell.
The Config File
Tmux loads its configuration from ~/.tmux.conf at startup.
# check if you have one
cat ~/.tmux.conf 2>/dev/null || echo "no config yet"
# reload config without restarting
tmux source-file ~/.tmux.conf
# or with Ctrl+b :
# source-file ~/.tmux.conf
Concept Map at a Glance
Quick Reference Summary
| Concept | What it is | Managed with |
|---|---|---|
| Server | Background daemon | Auto-managed |
| Session | Named workspace | tmux new, tmux ls, tmux attach |
| Window | Tab inside session | Ctrl+b c, Ctrl+b n/p |
| Pane | Split inside window | Ctrl+b %, Ctrl+b " |
| Prefix | Command initiator | Ctrl+b (default) |