Skip to main content

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.

Core Idea

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
note

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 shell
  • monitoring — htop, logs, tail -f
  • deploy — deployment script, rollback shell

3. Windows

A window is like a tab in a browser. It fills the whole terminal area.

Default ShortcutModification ShortcutAction
Ctrl+b cCtrl+Space WCreate new window
Ctrl+b ,Prefix e wRename current window
Ctrl+b nAlt+PageDownNext window
Ctrl+b pAlt+PageUpPrevious window
Ctrl+b 0-9Alt+1/2/3 or Ctrl+Space 0-9Switch to window by number
Ctrl+b wCtrl+Space wInteractive 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 ShortcutModification ShortcutAction
Ctrl+b %`Ctrl+Space`
Ctrl+b "Ctrl+Space -Split pane horizontally (top/bottom)
Ctrl+b arrowAlt+arrows or Alt+h/j/k/lMove focus between panes
Ctrl+b xCtrl+Space xKill current pane
Ctrl+b zCtrl+Space z or Alt+zZoom/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
warning

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 ShortcutModification ShortcutAction
Ctrl+b dCtrl+Space dDetach (keeps session alive)
Ctrl+b cCtrl+Space WNew 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

ConceptWhat it isManaged with
ServerBackground daemonAuto-managed
SessionNamed workspacetmux new, tmux ls, tmux attach
WindowTab inside sessionCtrl+b c, Ctrl+b n/p
PaneSplit inside windowCtrl+b %, Ctrl+b "
PrefixCommand initiatorCtrl+b (default)

What's Next