C.W.K.
Stream
Lesson 01 of 03 · published

What Is Tmux and Why Use It

~11 min · tmux, philosophy, terminal

Level 0Trapped
0 XP0/35 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

tmux = terminal multiplexer

A multiplexer takes one input and serves multiple outputs from it. tmux takes one terminal connection (your local terminal, or a single SSH session) and gives you multiple persistent windows and panes inside it. You log into a server once; you have ten shells running in there, and they all stay alive after you log out.

The killer features in plain English

  • Persistent sessions. Detach from a session, close your terminal, walk away for two days — every running process, every open file, every cursor position is exactly where you left it. This is why people get evangelical about tmux.
  • SSH disconnects don't kill your work. Your Wi-Fi drops mid-deploy? In a non-tmux SSH session, your script dies. In a tmux session on the remote box, your script keeps running; you just reattach when you reconnect.
  • Split panes without a fancy terminal. Built-in splits work the same on macOS Terminal, an SSH session into a Linux VPS, or a Raspberry Pi over serial.
  • Multiple windows. Like browser tabs, but for shells.
  • Scriptable layouts. Define a workspace once ("open editor + dev server + tail logs in three panes") and spin it up in one shell command.
  • Pair programming. Two users SSH into the same machine and attach to the same tmux session — both see each other's keystrokes in real time.

Why "learn tmux now" is the right answer

Modern terminals (iTerm2, Wezterm, Ghostty, Kitty) have splits and tabs of their own. They're great. But they only run locally. The moment you SSH into a server, those features don't help. tmux runs on the remote machine, so your splits, persistence, and layouts come with you regardless of which terminal emulator you're currently sitting in front of.

The hierarchy

Three nested concepts; learn the words now, the keys come next lesson:

  • Session — a named workspace. Usually one per project. "work", "cwk-pippa", "vim-tmux-quest."
  • Window — like a browser tab inside a session. Sessions can have many windows.
  • Pane — a split inside a window. Multiple shells visible at the same time.
tmux's job: never lose state. Editors come and go; tmux is the layer below them that keeps your context alive. Once you've felt the "my Wi-Fi died and nothing was lost" moment, you're tmux-pilled forever.

Code

Install tmux·bash
# macOS
brew install tmux

# Ubuntu / Debian
sudo apt install tmux

# Fedora
sudo dnf install tmux

# Arch / Manjaro
sudo pacman -S tmux

# Verify (should be 3.4+ in 2026; many modern features assume 3.0+)
tmux -V
First minute with tmux·bash
tmux                # start a session
# (you're now inside tmux — bottom green bar = status line)

# Type some shell stuff, run htop, whatever.
# Now detach (the magic key combo):
Ctrl-b d            # press Ctrl-b, release, press d
# You're back in your normal shell. Tmux session is still alive.

tmux ls             # list sessions — your session is still there
tmux attach         # reattach to the most recent session
# Boom — htop is still running, output is still there.

External links

Exercise

Install tmux. Run tmux with no arguments, then in the session run a long-running command like top or tail -f /var/log/syslog. Press Ctrl-b d to detach. Verify the command is still running with tmux ls. Reattach with tmux attach. Then close your terminal application entirely, reopen a fresh terminal, and run tmux attach again — your session is still there.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.