Distinguish splitting, navigating and zooming Panes from detaching and attaching Sessions, with criteria for deciding how they differ from Windows.
§ 00 · Pane — split only the screens you need to see together
A Pane is a subdivision of a Window. It is useful when you need to compare two screens simultaneously, such as running commands while watching server logs. Each Pane has its own terminal and program.
C-b % splits left and right; C-b " splits top and bottom. C-b followed by an arrow key moves to the adjacent Pane; C-b o moves to the next Pane. C-b q briefly displays Pane numbers, and C-b z zooms the active Pane or restores the original layout. C-b x asks whether to close the active Pane.
| Shortcut | Function |
|---|---|
| C-b % | Split the current Pane left and right |
| C-b " | Split the current Pane top and bottom |
| C-b arrow key | Move to the Pane in that direction |
| C-b o | Move to the next Pane |
| C-b q | Show Pane numbers, then select by number |
| C-b z | Zoom / unzoom the current Pane |
| C-b x | Confirm closing the current Pane |
§ 01 · Session — leave the screen without ending the work
A Session is a group of Windows. C-b d detaches only the current Client from the Session without terminating the programs. You return to the outer shell, but the tmux server and the programs in the Session can keep running.
Later, run tmux attach in the shell to reconnect. If there are several Sessions, check their names with tmux list-sessions and select one with tmux attach -t name. C-b s opens the Session list while you are attached. Change a Session’s name with C-b $.
§ 02 · Viewing earlier output — enter copy mode with C-b [
When the terminal’s normal scrolling does not correspond to tmux’s earlier output, enter copy mode with C-b [. Navigate with the arrow keys and Page Up / Page Down, and exit with q. Selection and copy keys can vary depending on whether mode-keys is set to emacs or vi.
C-b ] pastes the contents of the tmux paste buffer. The operating system clipboard and the tmux buffer may be separate. Mouse scrolling and clipboard integration depend on the mouse option and terminal settings; distinguish them from the default shortcuts.
§ 03 · What to split — Windows for different purposes, Panes for simultaneous views
Use separate Windows when tasks have different purposes and each needs the full screen. Use Panes for screens you need to compare simultaneously within one task. Use separate Sessions when you want to separate entire projects or connection targets and detach from each as a group.
The more Panes you create, the smaller the text becomes and the easier it is to lose track of the active Pane. Start with Windows as the basic unit and split into Panes only for the two screens you actually need to see together.
Read this note at sass.studio.