tmux Cheatsheet
3.4Essential tmux shortcuts for sessions, windows, and panes
Official docs →If you've ever closed a terminal tab and watched a long-running process vanish into the void, tmux is the fix you didn't know you needed. It's a terminal multiplexer — a fancy way of saying it lets you run multiple terminal sessions inside a single window, split your screen into panes, and (here's the killer feature) detach from everything and come back later with your entire workspace intact. SSH into a server, start a job, detach, close your laptop, go home, reattach. It's all still there.
The learning curve is real. tmux speaks its own language of prefix keys, and at first it feels like you're typing incantations. The default prefix is Ctrl-b, which means almost every command starts with that combo followed by another key. It's awkward at first — your fingers will rebel — but muscle memory kicks in faster than you'd expect. Within a week or two, you'll be splitting panes and jumping between sessions without thinking.
This cheatsheet covers the shortcuts you'll reach for daily. We're skipping the obscure stuff and focusing on what actually matters: managing sessions so your work survives disconnects, juggling windows like browser tabs, splitting panes for side-by-side workflows, and copy mode for when you need to scroll or grab text. If you pair tmux with a good editor like Neovim, you've basically built yourself a custom IDE that runs anywhere with a terminal.
Sessions
Sessions are your top-level workspaces. Think of them like separate desktops — one for each project.
Windows
Windows are tabs inside a session. Each window fills the whole terminal.
Panes
Panes split a window into multiple terminals. This is where tmux really shines.
Copy Mode
Copy mode lets you scroll through output, search, and copy text — no mouse required.
Custom Prefix Key
The default Ctrl-b prefix works, but many people remap it. Here are common patterns.
Tips
Add set -g mouse on to your ~/.tmux.conf to enable mouse support. You'll be able to click panes, resize by dragging borders, and scroll with your wheel. It's not cheating — it's practical.
The tmux-resurrect plugin saves your entire tmux environment (sessions, windows, panes, even running programs) and restores it after a reboot. Pair it with tmux-continuum for automatic saving. Install both via TPM (Tmux Plugin Manager) and never lose a layout again.
Working with nested tmux sessions (local tmux + remote tmux over SSH)? Press your prefix twice to send it to the inner session. If your prefix is Ctrl-b, hitting Ctrl-b Ctrl-b sends the prefix to the remote tmux. Alternatively, remap the remote prefix to something different to avoid the gymnastics entirely.
Copy mode uses vi-style keybindings by default if your $EDITOR is set to vi/vim/nvim. Otherwise it uses emacs-style. Force vi mode with set -g mode-keys vi in your config — it pairs perfectly if you're already a Neovim user.
Use Ctrl-b z (zoom) constantly. It toggles the current pane to fill the whole window and back. Perfect for when you need to focus on one pane's output without rearranging your layout. The zoomed pane gets a Z flag in the status bar so you don't forget.
Start tmux with tmux new -s project-name instead of bare tmux. Named sessions are infinitely easier to manage when you're juggling multiple projects. tmux ls becomes actually useful when your sessions have real names instead of 0, 1, 2.
Add set -g base-index 1 and set -g pane-base-index 1 to your config. This makes window and pane numbering start at 1 instead of 0, which matches the physical layout of number keys on your keyboard. Reaching for Ctrl-b 1 to get your first window just feels right.