⌥+⌃AltPlusCtrl

tmux Keyboard Shortcuts

Every tmux command starts with the prefix. By default that is Ctrl+B, pressed and released, followed by a second key that names the action — so creating a window is Ctrl+B then C, not a three-key chord. This indirection is the single thing to understand before anything else on this page, and it is also what makes tmux feel unnatural for the first hour: no other program you use asks you to announce that a command is coming before issuing it. The reason is that tmux sits between your terminal and the programs running inside it, and it has to be able to send every keystroke through untouched. A shell needs Ctrl+C, Ctrl+D, Ctrl+A and Ctrl+E. Vim needs almost everything. If tmux claimed combinations directly it would break the software it exists to host, so instead it claims exactly one and requires you to lead with it. Everything else passes through. What you get for that inconvenience is the feature no terminal emulator provides: sessions that outlive their connection. A tmux session runs on the machine rather than in the window, so closing the terminal, losing an SSH connection or shutting the laptop leaves everything running. Reattaching puts you back exactly where you were, panes and scroll positions intact. That is why tmux remains standard on remote servers even now that terminal emulators have tabs and splits of their own — those handle layout, and this handles persistence. A note on the default prefix. Ctrl+B is widely disliked, because B is an awkward reach with the left hand and Ctrl+B is meaningful in Emacs and in readline, where it moves the cursor back a character. The most common remap is Ctrl+A, which is more comfortable and conflicts instead with readline's move-to-line-start and with GNU screen's own prefix. Some people use Ctrl+Space to avoid both. There is no correct answer; what matters is knowing that the prefix is configurable, because a large fraction of published tmux advice assumes a remapped prefix without saying so. Every binding below is written as 'prefix' followed by the key. Substitute whatever prefix your configuration uses. Pressing prefix then ? lists the current bindings, which is the authoritative reference for your setup.

Sessions

ActionWindowsMacDescription
The prefix keyCtrl+B (WSL)Ctrl+BAnnounces that the next keystroke is a tmux command rather than input for the program inside. Pressed and released before the command key, not held — the most common beginner error is holding Ctrl through both.
Detach from the sessionprefix dprefix dLeaves the session running on the machine and returns you to the ordinary shell. Nothing stops — this is the defining tmux action, and the difference between detaching and exiting is the difference between coming back to your work and losing it.
List and switch sessionsprefix sprefix sShows an interactive tree of sessions, windows and panes to pick from. More useful than the paired parenthesis bindings once you have more than two sessions, because it shows what is actually in each one.
Previous / next sessionprefix ( / prefix )prefix ( / prefix )Steps between sessions without opening the list. Quick when two sessions are in play and unhelpful beyond that, since there is no indication of what you are moving to.
Rename the sessionprefix $prefix $Replaces the numeric default with a name. Worth doing the moment you have more than one — 'api' and 'logs' are navigable where '0' and '1' require opening each to remember which is which.
Open the command promptprefix :prefix :Accepts any tmux command by name, including the many with no default binding. The route to things like resize-pane with exact values, and to testing a configuration change before writing it to the config file.
List all key bindingsprefix ?prefix ?Shows every binding currently active, including anything your configuration has changed. The authoritative answer for your setup, which matters because published tmux advice frequently assumes a remapped prefix without saying so.

Windows

ActionWindowsMacDescription
Create a windowprefix cprefix cOpens a new window, tmux's equivalent of a tab, running a fresh shell. Windows fill the whole terminal; panes divide a window — the two are separate levels of the hierarchy and are easy to conflate at first.
Next / previous windowprefix n / prefix pprefix n / prefix pSteps forward and back through the window list. Prefix followed by L jumps to the last window you were in, which is faster than stepping when you are alternating between two.
Jump to a window by numberprefix 0 through prefix 9prefix 0 through prefix 9Selects a window by its index, shown in the status bar. Numbering starts at zero by default, which trips people up often enough that starting at one is among the most common configuration changes.
Rename the current windowprefix ,prefix ,Sets the window's name in the status bar. Left alone, tmux names windows after the running process, which means every window is called bash or zsh and the status bar tells you nothing.
Close the current windowprefix &prefix &Closes the window and everything in it, after a confirmation prompt. The confirmation is deliberate — a window may hold several panes with work in progress, so this is not a keystroke tmux lets you press by accident.

Panes Copy

ActionWindowsMacDescription
Split into left and right panesprefix %prefix %Divides the current pane with a vertical line, producing side-by-side panes. The naming causes endless confusion: this is the 'vertical split' because the divider is vertical, not because the panes stack vertically.
Split into top and bottom panesprefix "prefix "Divides with a horizontal line, stacking panes one above the other. Together with the percent binding this is the pair most people remap first, usually to the | and - characters that visually match the result.
Move between panesprefix Arrowprefix ArrowMoves focus in the arrow's direction. Prefix followed by O cycles instead, and prefix followed by Q briefly shows a number on each pane that you can press to jump straight to it.
Zoom a pane to full windowprefix zprefix zTemporarily expands the focused pane to fill the window, and restores the layout when pressed again. Nothing is closed or resized permanently, which makes it the right answer for reading long output in a cramped four-pane layout.
Enter copy modeprefix [prefix [Enters a scrollback-navigation mode where the arrow keys, Page Up and search all work. This is how you scroll inside tmux at all — the terminal's own scrollback is not what you are looking at once tmux is running.
Paste the tmux bufferprefix ]prefix ]Pastes whatever was copied in copy mode. Note this is tmux's own buffer, separate from the system clipboard — bridging the two requires configuration, and their separation is a frequent source of frustration.
Close the current paneprefix xprefix xCloses the focused pane after confirming. Typing exit in the shell does the same without a prompt, which is what most people use for a pane they have deliberately finished with.

Frequently Asked Questions

What exactly is the prefix, and why does tmux need one?

The prefix is a keystroke that tells tmux the next key is a command for it rather than input for the program inside. It exists because tmux sits between your terminal and everything running in it, and has to pass keystrokes through untouched — a shell needs Ctrl+C and Ctrl+D, Vim needs almost everything. Claiming combinations directly would break the software tmux exists to host, so it claims exactly one and requires you to lead with it. Press and release the prefix, then press the command key; holding Ctrl through both is the classic first mistake.

How do I change the prefix from Ctrl+B?

Add three lines to ~/.tmux.conf: unbind C-b, set-option -g prefix C-a, and bind-key C-a send-prefix. The third line is what most people forget — it lets pressing the prefix twice send the literal keystroke through to the program inside, which you need if anything you run uses Ctrl+A. Ctrl+A is the most common replacement because it is an easier reach, though it collides with readline's move-to-line-start; Ctrl+Space avoids both conflicts and is the other popular choice.

Why is % a vertical split when the panes end up side by side?

Because the naming describes the divider, not the arrangement. Prefix % draws a vertical line, producing left and right panes. Prefix " draws a horizontal line, producing top and bottom. Almost everyone finds this backwards on first encounter, and it is among the most commonly remapped bindings — usually to | for a vertical divider and - for a horizontal one, which match the shape of the result rather than the orientation of the line.

What is the difference between detaching and exiting?

Detaching with prefix d leaves the session running on the machine and returns you to your ordinary shell; everything inside keeps executing, and `tmux attach` puts you back exactly where you were. Exiting closes the shells and the session ends with them. This distinction is the entire point of tmux: a session belongs to the machine rather than to the terminal window, which is what makes it survive a dropped SSH connection or a closed laptop.

How do I scroll up in tmux?

Prefix [ enters copy mode, where arrow keys, Page Up and search all work; q or Escape leaves it. The mouse wheel does nothing useful by default, because tmux is drawing its own screen and the terminal's native scrollback contains only what tmux painted. Setting `set -g mouse on` in your configuration enables wheel scrolling and pane selection with the mouse, which is one of the few settings almost everyone eventually adds.

Why does copying in tmux not reach my system clipboard?

Because tmux maintains its own paste buffers, entirely separate from the operating system's clipboard. Prefix ] pastes from tmux's buffer, and nothing has been placed on the system clipboard for other applications to see. Bridging them requires configuration — piping to pbcopy on macOS or xclip and wl-copy on Linux — or relying on the terminal emulator's OSC 52 support, which lets tmux hand a copied selection to the terminal to place on the clipboard, including over SSH. Modern terminal emulators mostly support it and it needs enabling in tmux.

What is the difference between a window and a pane?

A window fills the entire terminal and appears as an entry in the status bar, so it functions as a tab. A pane is a division within a window, so several panes are visible at once. A session contains windows; a window contains panes. Keeping the hierarchy straight explains why the bindings are grouped as they are — c creates a window, % and " create panes, and the session commands operate a level above both.

Do these bindings work on Windows?

Inside WSL, yes, unchanged — tmux runs as the Linux program it is and behaves identically. There is no native Windows build. What is worth knowing is that Windows Terminal has its own tabs and splits with their own shortcuts, so running tmux inside it gives two layers of pane management, and Windows Terminal's bindings can intercept keys before tmux receives them. Either rebind on one side or pick one layer to do the splitting.

How do I resize panes?

Holding the prefix and pressing an arrow key repeatedly resizes in that direction, but the more precise route is prefix : followed by a command such as `resize-pane -D 10` to move the boundary ten cells down. Prefix Space cycles through tmux's preset layouts — even-horizontal, even-vertical, main-horizontal, main-vertical and tiled — which is usually faster than manual resizing when you want a standard arrangement rather than a specific one.