From Screen to Supreme: The Evolution of Terminal Multiplexing Source

1---
2title: "From Screen to Supreme: The Evolution of Terminal Multiplexing"
3date: "2026-03-31"
4published: true
5tags: ["tmux", "terminal", "multiplexer", "zellij", "linux", "macos", "productivity", "cli", "iterm2"]
6author: "Gavin Jackson"
7excerpt: "A practical guide to tmux and Zellij — what they are, why you need them, and how to use them. Plus cheat sheet, configuration tips, and iTerm2 integration."
8---
9
10# From Screen to Supreme: The Evolution of Terminal Multiplexing
11
12Once upon a time, we used `screen`. It worked. It kept processes running when you disconnected. But using it felt like operating heavy machinery without a manual.
13
14Then came **tmux** — the terminal multiplexer that made terminal multiplexing actually pleasant. What started as a cleaner alternative to screen has become an essential tool for anyone who lives in the terminal.
15
16This is part tutorial, part cheat sheet, and part love letter to a tool that changed how I work.
17
18---
19
20## What Is a Terminal Multiplexer?
21
22A terminal multiplexer lets you run multiple terminal sessions inside one window. Think of it as a window manager for your terminal.
23
24**What you can do:**
25- Split one terminal into multiple panes
26- Create windows (tabs) and switch between them
27- Detach from a session and leave everything running
28- Reattach later from anywhere — even a different machine
29- Share sessions with other users
30
31**The killer feature:** Your work survives disconnection. Close your laptop, lose WiFi, battery dies — your processes keep running. Reattach and everything is exactly as you left it.
32
33---
34
35## Installation
36
37```bash
38# macOS
39brew install tmux
40
41# Ubuntu/Debian
42sudo apt install tmux
43```
44
45---
46
47## The Basics: Getting Started
48
49Tmux uses a **prefix key** to send commands. By default, it's `Ctrl+b`. Press this, then the command key.
50
51### Sessions
52
53A session is a collection of windows. Start one:
54
55```bash
56tmux                    # New session
57tmux new -s myproject   # Named session
58tmux ls                 # List sessions
59tmux attach             # Attach to last session
60tmux attach -t myproject # Attach to specific session
61```
62
63Inside tmux, prefix these commands:
64
65| Key | Action |
66|-----|--------|
67| `d` | Detach from session |
68| `$` | Rename session |
69| `s` | Session chooser (interactive list) |
70| `(` | Previous session |
71| `)` | Next session |
72
73### Windows (Tabs)
74
75Windows are like tabs in a browser. Each window fills the entire screen.
76
77| Key | Action |
78|-----|--------|
79| `c` | Create new window |
80| `,` | Rename current window |
81| `n` | Next window |
82| `p` | Previous window |
83| `0-9` | Switch to window number |
84| `w` | Window chooser (interactive list) |
85| `&` | Kill current window |
86
87### Panes (Splits)
88
89Panes let you see multiple terminals at once.
90
91| Key | Action |
92|-----|--------|
93| `%` | Split vertically (left/right) |
94| `"` | Split horizontally (top/bottom) |
95| `o` | Cycle through panes |
96| `;` | Toggle to last active pane |
97| `x` | Kill current pane |
98| `z` | Zoom pane (fullscreen toggle) |
99| `q` | Show pane numbers (press number to jump) |
100| `{` | Swap with previous pane |
101| `}` | Swap with next pane |
102
103**Directional pane movement:**
104
105| Key | Action |
106|-----|--------|
107| `↑` | Move up |
108| `↓` | Move down |
109| `←` | Move left |
110| `→` | Move right |
111
112Hold `Ctrl+b`, then press arrow keys.
113
114### Resizing Panes
115
116Hold `Ctrl+b`, then:
117
118| Key | Action |
119|-----|--------|
120| `Ctrl+↑` | Resize up |
121| `Ctrl+↓` | Resize down |
122| `Ctrl+←` | Resize left |
123| `Ctrl+→` | Resize right |
124
125Or use the mouse if enabled (see configuration below).
126
127---
128
129## Copy Mode
130
131Tmux has its own scrollback buffer. Enter copy mode to scroll, search, and copy text.
132
133| Key | Action |
134|-----|--------|
135| `[` | Enter copy mode |
136| `]` | Paste from buffer |
137| `=` | Choose buffer to paste |
138
139**In copy mode:**
140
141| Key | Action |
142|-----|--------|
143| `↑/↓` or `PgUp/PgDn` | Scroll |
144| `/` | Search down |
145| `?` | Search up |
146| `n` | Next search result |
147| `N` | Previous search result |
148| `Space` | Start selection |
149| `Enter` | Copy selection |
150| `q` | Quit copy mode |
151
152---
153
154## Configuration
155
156Create `~/.tmux.conf` to customize tmux.
157
158### Sensible Defaults
159
160```bash
161# Change prefix to Ctrl+a (easier to reach, screen-compatible)
162unbind C-b
163set -g prefix C-a
164bind C-a send-prefix
165
166# Enable mouse support
167set -g mouse on
168
169# Start window numbering at 1
170set -g base-index 1
171setw -g pane-base-index 1
172
173# Renumber windows when one is closed
174set -g renumber-windows on
175
176# Increase scrollback buffer
177set -g history-limit 10000
178
179# Use 256 colors
180set -g default-terminal "screen-256color"
181
182# Status bar styling
183set -g status-style bg=black,fg=white
184set -g window-status-current-style bg=blue,fg=white,bold
185
186# Easier pane splitting
187bind | split-window -h -c "#{pane_current_path}"
188bind - split-window -v -c "#{pane_current_path}"
189unbind '"'
190unbind %
191
192# Reload config with prefix + r
193bind r source-file ~/.tmux.conf \; display "Config reloaded!"
194
195# Vim-style pane navigation
196bind h select-pane -L
197bind j select-pane -D
198bind k select-pane -U
199bind l select-pane -R
200
201# Vim-style window navigation
202bind -r C-h select-window -t :-
203bind -r C-l select-window -t :+
204
205# Faster key repetition
206set -s escape-time 0
207
208# Activity monitoring
209setw -g monitor-activity on
210set -g visual-activity on
211```
212
213### Modern Tmux (Tmux Plugin Manager)
214
215Install [TPM](https://github.com/tmux-plugins/tpm) for easy plugin management:
216
217```bash
218git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
219```
220
221Add to `~/.tmux.conf`:
222
223```bash
224# List of plugins
225set -g @plugin 'tmux-plugins/tpm'
226set -g @plugin 'tmux-plugins/tmux-sensible'
227set -g @plugin 'tmux-plugins/tmux-resurrect'
228set -g @plugin 'tmux-plugins/tmux-continuum'
229set -g @plugin 'tmux-plugins/tmux-yank'
230
231# Resurrect saves and restores sessions
232set -g @resurrect-capture-pane-contents 'on'
233
234# Continuum auto-saves every 15 minutes
235set -g @continuum-restore 'on'
236
237# Initialize TPM (keep at bottom)
238run '~/.tmux/plugins/tpm/tpm'
239```
240
241**Install plugins:** `Ctrl+b` then `I` (capital I)
242
243**Key plugins:**
244- **tmux-sensible** — Sensible defaults everyone agrees on
245- **tmux-resurrect** — Save and restore sessions after reboot
246- **tmux-continuum** — Auto-save sessions periodically
247- **tmux-yank** — Copy to system clipboard
248
249---
250
251## iTerm2 Integration
252
253iTerm2 on macOS has native tmux integration that's genuinely impressive. Instead of tmux drawing its own interface with ASCII borders, iTerm2 renders tmux windows as native tabs and panes.
254
255### How It Works
256
257When you run tmux with the `-CC` (control center) flag, iTerm2 takes over:
258
259- Tmux windows become iTerm2 **tabs**
260- Tmux panes become iTerm2 **split panes**
261- You use iTerm2's native keyboard shortcuts
262- The visual result is seamless — no more ASCII borders
263
264### Starting Integrated Mode
265
266```bash
267tmux -CC new -s mysession      # New session
268tmux -CC attach -t mysession   # Attach to existing
269```
270
271Or configure iTerm2 to always use integration:
272
273```
274iTerm2 → Preferences → General → tmux
275☑️ Open tmux windows as native tabs in a new window
276☑️ Automatically bury the tmux client session after connecting
277```
278
279### What You Get
280
281- **Native tabs** — Cmd+T creates new tmux windows
282- **Native splits** — Cmd+D (vertical), Cmd+Shift+D (horizontal)
283- **Mouse integration** — Drag to resize panes, click to focus
284- **Better rendering** — No ASCII art borders, proper anti-aliasing
285- **Reconnect support** — Disconnect and reconnect keeps your layout
286
287### The Trade-off
288
289iTerm2 integration only works when running tmux locally or through SSH from iTerm2. If you SSH into a server and run tmux there without the `-CC` flag, you get standard tmux. This is usually fine — the integration shines for local development or when you're primarily working on one remote host.
290
291---
292
293## Quick Cheat Sheet
294
295### Sessions
296
297```bash
298tmux new -s name          # New named session
299tmux attach -t name       # Attach to session
300tmux attach -d -t name    # Attach, detach others
301tmux ls                   # List sessions
302tmux kill-session -t name # Kill session
303tmux rename-session -t old new
304```
305
306### Inside Tmux (Prefix: Ctrl+b)
307
308| Key | Action |
309|-----|--------|
310| **Session** ||
311| `d` | Detach |
312| `$` | Rename session |
313| `s` | Session chooser |
314| **Windows** ||
315| `c` | New window |
316| `,` | Rename window |
317| `n` | Next window |
318| `p` | Previous window |
319| `0-9` | Go to window |
320| `w` | Window chooser |
321| `&` | Kill window |
322| **Panes** ||
323| `%` | Split vertical |
324| `"` | Split horizontal |
325| `o` | Next pane |
326| `;` | Last pane |
327| `x` | Kill pane |
328| `z` | Zoom pane |
329| `q` | Show pane numbers |
330| `Space` | Cycle layouts |
331| **Copy Mode** ||
332| `[` | Enter copy mode |
333| `]` | Paste |
334| `=` | Choose buffer |
335
336### Command Mode
337
338Press `Ctrl+b` then `:` to enter command mode.
339
340```
341:set mouse on           # Enable mouse
342:set mouse off          # Disable mouse
343:set -g status off      # Hide status bar
344:set -g status on       # Show status bar
345:resize-pane -D 10      # Resize down 10 cells
346:swap-pane -U           # Swap with previous pane
347:join-pane -s :1        # Join window 1 to current
348:break-pane             # Break pane to new window
349```
350
351---
352
353## Advanced Tips
354
355### Synchronize Panes
356
357Send the same input to all panes in a window — useful for running commands on multiple servers:
358
359```
360Ctrl+b :setw synchronize-panes on
361```
362
363Type once, appears everywhere. Turn off with `off`.
364
365### Pair Programming
366
367Two users can attach to the same session:
368
369```bash
370# User 1
371tmux -S /tmp/shared new -s pair
372chmod 777 /tmp/shared
373
374# User 2
375tmux -S /tmp/shared attach
376```
377
378Both see and control the same terminal.
379
380### Tmuxinator (Session Management)
381
382Define sessions in YAML, start them with one command:
383
384```bash
385gem install tmuxinator
386mux new myproject
387```
388
389Edit `~/.config/tmuxinator/myproject.yml`:
390
391```yaml
392name: myproject
393root: ~/projects/myproject
394
395windows:
396  - editor:
397      layout: main-vertical
398      panes:
399        - vim
400        - git status
401  - server:
402      panes:
403        - rails server
404  - logs:
405      panes:
406        - tail -f log/development.log
407```
408
409Start it: `mux myproject`
410
411---
412
413## Zellij: The New Contender
414
415Zellij is a Rust-based terminal multiplexer that reimagines what a modern multiplexer should be. It's not just a tmux clone — it has genuinely innovative features.
416
417### What Makes Zellij Different
418
419**Mode-based navigation:** Instead of a prefix key, Zellij uses modes. Press `Ctrl+g` to enter "locked" mode, `Ctrl+p` for pane mode, `Ctrl+t` for tab mode. Each mode has its own keybindings displayed on screen.
420
421**Built-in UI:** Zellij shows a toolbar at the bottom with available commands. No more forgetting keybindings — they're always visible.
422
423**Layouts:** Define complex pane arrangements in YAML and load them instantly:
424
425```yaml
426# ~/.config/zellij/layouts/dev.kdl
427layout {
428    pane split_direction="vertical" {
429        pane {
430            command "nvim"
431        }
432        pane split_direction="horizontal" {
433            pane
434            pane
435        }
436    }
437}
438```
439
440**Floating panes:** Pop a pane out as an overlay, like a modal dialog. Close it and you're back where you were.
441
442**Stacked panes:** Stack panes in one slot, switch between them like tabs within a tab.
443
444**WebAssembly plugins:** Write plugins in any language that compiles to WASM. There's already a growing ecosystem — file explorers, resource monitors, git dashboards.
445
446### Installation
447
448```bash
449# macOS
450brew install zellij
451
452# Linux
453cargo install zellij
454# Or download binary from GitHub releases
455```
456
457### Quick Start
458
459```bash
460zellij                    # New session
461zellij attach             # Attach to existing
462zellij --layout dev       # Start with a layout
463```
464
465**Default keybindings:**
466
467| Mode | How to Enter | What You Can Do |
468|------|--------------|-----------------|
469| Normal | Default | Navigate panes with arrows |
470| Locked | `Ctrl+g` | Pass keys through to terminal |
471| Pane | `Ctrl+p` | Split, resize, close panes |
472| Tab | `Ctrl+t` | Create, switch, rename tabs |
473| Resize | `Ctrl+n` | Resize panes with arrows |
474| Move | `Ctrl+h` | Move panes between positions |
475| Search | `Ctrl+s` | Search scrollback |
476| Session | `Ctrl+o` | Detach, switch sessions |
477
478### When to Choose Zellij Over Tmux
479
480| Choose Zellij if... | Stick with Tmux if... |
481|---------------------|----------------------|
482| You want discoverable keybindings | You have years of muscle memory |
483| Layouts are important to your workflow | You need maximum compatibility |
484| Floating/stacked panes appeal to you | You rely on extensive plugins |
485| You want a modern Rust codebase | You need iTerm2 integration |
486| WebAssembly plugins excite you | You need session resurrection now |
487
488Zellij's session resurrection is coming but not as mature as tmux-resurrect. The plugin system is promising but young.
489
490---
491
492## Why Tmux Wins (For Now)
493
494I've tried the alternatives:
495
496- **Screen** — Functional but clunky
497- **iTerm2 native tabs** — Great, but macOS only
498- **Zellij** — Impressive, fast, innovative — watch this space
499
500Tmux wins because it's everywhere, it's fast, and it does one thing exceptionally well: keep your terminal environment alive and organized.
501
502The learning curve is real — those first few days of hitting `Ctrl+b` will feel awkward. But stick with it. Within a week, muscle memory takes over. Within a month, you'll wonder how you worked without it.
503
504---
505
506## Resources
507
508- [Tmux GitHub](https://github.com/tmux/tmux)
509- [Tmuxinator](https://github.com/tmuxinator/tmuxinator)
510- [Tmux Plugin Manager](https://github.com/tmux-plugins/tpm)
511- [iTerm2 Tmux Integration](https://iterm2.com/documentation-tmux-integration.html)
512- [Tmux Cheat Sheet](https://tmuxcheatsheet.com/)
513