From Screen to Supreme: The Evolution of Terminal Multiplexing Source
Markdown source
1---2title: "From Screen to Supreme: The Evolution of Terminal Multiplexing"3date: "2026-03-31"4published: true5tags: ["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---910# From Screen to Supreme: The Evolution of Terminal Multiplexing1112Once 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.1314Then 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.1516This is part tutorial, part cheat sheet, and part love letter to a tool that changed how I work.1718---1920## What Is a Terminal Multiplexer?2122A terminal multiplexer lets you run multiple terminal sessions inside one window. Think of it as a window manager for your terminal.2324**What you can do:**25- Split one terminal into multiple panes26- Create windows (tabs) and switch between them27- Detach from a session and leave everything running28- Reattach later from anywhere — even a different machine29- Share sessions with other users3031**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.3233---3435## Installation3637```bash38# macOS39brew install tmux4041# Ubuntu/Debian42sudo apt install tmux43```4445---4647## The Basics: Getting Started4849Tmux uses a **prefix key** to send commands. By default, it's `Ctrl+b`. Press this, then the command key.5051### Sessions5253A session is a collection of windows. Start one:5455```bash56tmux # New session57tmux new -s myproject # Named session58tmux ls # List sessions59tmux attach # Attach to last session60tmux attach -t myproject # Attach to specific session61```6263Inside tmux, prefix these commands:6465| Key | Action |66|-----|--------|67| `d` | Detach from session |68| `$` | Rename session |69| `s` | Session chooser (interactive list) |70| `(` | Previous session |71| `)` | Next session |7273### Windows (Tabs)7475Windows are like tabs in a browser. Each window fills the entire screen.7677| 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 |8687### Panes (Splits)8889Panes let you see multiple terminals at once.9091| 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 |102103**Directional pane movement:**104105| Key | Action |106|-----|--------|107| `↑` | Move up |108| `↓` | Move down |109| `←` | Move left |110| `→` | Move right |111112Hold `Ctrl+b`, then press arrow keys.113114### Resizing Panes115116Hold `Ctrl+b`, then:117118| Key | Action |119|-----|--------|120| `Ctrl+↑` | Resize up |121| `Ctrl+↓` | Resize down |122| `Ctrl+←` | Resize left |123| `Ctrl+→` | Resize right |124125Or use the mouse if enabled (see configuration below).126127---128129## Copy Mode130131Tmux has its own scrollback buffer. Enter copy mode to scroll, search, and copy text.132133| Key | Action |134|-----|--------|135| `[` | Enter copy mode |136| `]` | Paste from buffer |137| `=` | Choose buffer to paste |138139**In copy mode:**140141| 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 |151152---153154## Configuration155156Create `~/.tmux.conf` to customize tmux.157158### Sensible Defaults159160```bash161# Change prefix to Ctrl+a (easier to reach, screen-compatible)162unbind C-b163set -g prefix C-a164bind C-a send-prefix165166# Enable mouse support167set -g mouse on168169# Start window numbering at 1170set -g base-index 1171setw -g pane-base-index 1172173# Renumber windows when one is closed174set -g renumber-windows on175176# Increase scrollback buffer177set -g history-limit 10000178179# Use 256 colors180set -g default-terminal "screen-256color"181182# Status bar styling183set -g status-style bg=black,fg=white184set -g window-status-current-style bg=blue,fg=white,bold185186# Easier pane splitting187bind | split-window -h -c "#{pane_current_path}"188bind - split-window -v -c "#{pane_current_path}"189unbind '"'190unbind %191192# Reload config with prefix + r193bind r source-file ~/.tmux.conf \; display "Config reloaded!"194195# Vim-style pane navigation196bind h select-pane -L197bind j select-pane -D198bind k select-pane -U199bind l select-pane -R200201# Vim-style window navigation202bind -r C-h select-window -t :-203bind -r C-l select-window -t :+204205# Faster key repetition206set -s escape-time 0207208# Activity monitoring209setw -g monitor-activity on210set -g visual-activity on211```212213### Modern Tmux (Tmux Plugin Manager)214215Install [TPM](https://github.com/tmux-plugins/tpm) for easy plugin management:216217```bash218git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm219```220221Add to `~/.tmux.conf`:222223```bash224# List of plugins225set -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'230231# Resurrect saves and restores sessions232set -g @resurrect-capture-pane-contents 'on'233234# Continuum auto-saves every 15 minutes235set -g @continuum-restore 'on'236237# Initialize TPM (keep at bottom)238run '~/.tmux/plugins/tpm/tpm'239```240241**Install plugins:** `Ctrl+b` then `I` (capital I)242243**Key plugins:**244- **tmux-sensible** — Sensible defaults everyone agrees on245- **tmux-resurrect** — Save and restore sessions after reboot246- **tmux-continuum** — Auto-save sessions periodically247- **tmux-yank** — Copy to system clipboard248249---250251## iTerm2 Integration252253iTerm2 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.254255### How It Works256257When you run tmux with the `-CC` (control center) flag, iTerm2 takes over:258259- Tmux windows become iTerm2 **tabs**260- Tmux panes become iTerm2 **split panes**261- You use iTerm2's native keyboard shortcuts262- The visual result is seamless — no more ASCII borders263264### Starting Integrated Mode265266```bash267tmux -CC new -s mysession # New session268tmux -CC attach -t mysession # Attach to existing269```270271Or configure iTerm2 to always use integration:272273```274iTerm2 → Preferences → General → tmux275☑️ Open tmux windows as native tabs in a new window276☑️ Automatically bury the tmux client session after connecting277```278279### What You Get280281- **Native tabs** — Cmd+T creates new tmux windows282- **Native splits** — Cmd+D (vertical), Cmd+Shift+D (horizontal)283- **Mouse integration** — Drag to resize panes, click to focus284- **Better rendering** — No ASCII art borders, proper anti-aliasing285- **Reconnect support** — Disconnect and reconnect keeps your layout286287### The Trade-off288289iTerm2 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.290291---292293## Quick Cheat Sheet294295### Sessions296297```bash298tmux new -s name # New named session299tmux attach -t name # Attach to session300tmux attach -d -t name # Attach, detach others301tmux ls # List sessions302tmux kill-session -t name # Kill session303tmux rename-session -t old new304```305306### Inside Tmux (Prefix: Ctrl+b)307308| 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 |335336### Command Mode337338Press `Ctrl+b` then `:` to enter command mode.339340```341:set mouse on # Enable mouse342:set mouse off # Disable mouse343:set -g status off # Hide status bar344:set -g status on # Show status bar345:resize-pane -D 10 # Resize down 10 cells346:swap-pane -U # Swap with previous pane347:join-pane -s :1 # Join window 1 to current348:break-pane # Break pane to new window349```350351---352353## Advanced Tips354355### Synchronize Panes356357Send the same input to all panes in a window — useful for running commands on multiple servers:358359```360Ctrl+b :setw synchronize-panes on361```362363Type once, appears everywhere. Turn off with `off`.364365### Pair Programming366367Two users can attach to the same session:368369```bash370# User 1371tmux -S /tmp/shared new -s pair372chmod 777 /tmp/shared373374# User 2375tmux -S /tmp/shared attach376```377378Both see and control the same terminal.379380### Tmuxinator (Session Management)381382Define sessions in YAML, start them with one command:383384```bash385gem install tmuxinator386mux new myproject387```388389Edit `~/.config/tmuxinator/myproject.yml`:390391```yaml392name: myproject393root: ~/projects/myproject394395windows:396 - editor:397 layout: main-vertical398 panes:399 - vim400 - git status401 - server:402 panes:403 - rails server404 - logs:405 panes:406 - tail -f log/development.log407```408409Start it: `mux myproject`410411---412413## Zellij: The New Contender414415Zellij 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.416417### What Makes Zellij Different418419**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.420421**Built-in UI:** Zellij shows a toolbar at the bottom with available commands. No more forgetting keybindings — they're always visible.422423**Layouts:** Define complex pane arrangements in YAML and load them instantly:424425```yaml426# ~/.config/zellij/layouts/dev.kdl427layout {428 pane split_direction="vertical" {429 pane {430 command "nvim"431 }432 pane split_direction="horizontal" {433 pane434 pane435 }436 }437}438```439440**Floating panes:** Pop a pane out as an overlay, like a modal dialog. Close it and you're back where you were.441442**Stacked panes:** Stack panes in one slot, switch between them like tabs within a tab.443444**WebAssembly plugins:** Write plugins in any language that compiles to WASM. There's already a growing ecosystem — file explorers, resource monitors, git dashboards.445446### Installation447448```bash449# macOS450brew install zellij451452# Linux453cargo install zellij454# Or download binary from GitHub releases455```456457### Quick Start458459```bash460zellij # New session461zellij attach # Attach to existing462zellij --layout dev # Start with a layout463```464465**Default keybindings:**466467| 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 |477478### When to Choose Zellij Over Tmux479480| 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 |487488Zellij's session resurrection is coming but not as mature as tmux-resurrect. The plugin system is promising but young.489490---491492## Why Tmux Wins (For Now)493494I've tried the alternatives:495496- **Screen** — Functional but clunky497- **iTerm2 native tabs** — Great, but macOS only498- **Zellij** — Impressive, fast, innovative — watch this space499500Tmux wins because it's everywhere, it's fast, and it does one thing exceptionally well: keep your terminal environment alive and organized.501502The 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.503504---505506## Resources507508- [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