The prefix key and new windows
Session learn has three windows and window 2 is current.
Keys go to the program in your pane until you press the prefix.
C-b — Ctrl and b together — makes the next key a tmux command instead. C-b c opens a new window and makes it current.
Release matters. A space in a key name means let go: C-b c is C-b, release, then c. Holding Ctrl through the c runs something else entirely.
Windows are numbered from 0, and the status line marks two of them:
*- the current window
-- the last window, the one you came from
Press C-b c.
A second window opens and the list reads 0:shell- 1:sh*.
Press C-b c again.
The list reads 0:shell 1:sh- 2:sh* — window 2 is current, window 1 was last.
The full key notation
C- is Ctrl, M- is Meta (usually Alt), S- is Shift. The same notation appears in every tmux doc and in the key list.
Here is what just happened.
Each C-b c ran new-window, which creates a window at the first free index and switches to it. New windows are named after the program running in them, sh, until you rename them.
- Create a new window at the first free index and make it currentC-bthenc
- Send a literal C-b to the program in the active paneC-bthenC-b
Go further
C-b C-bsends a literalC-bto the program in the pane, for when that program uses the key itself.- When windows overflow the width of the status line,
<and>mark the hidden ones. new-windowalso takes flags at the command prompt:-dto open without switching,-nto name it.
- 1Press Ctrl and b together, release both, then press
c. Holding Ctrl through thecruns something else. - 2
C-b copens one window and switches to it. You need two more. - 3Press
C-b ctwice and watch the window list become0:shell 1:sh- 2:sh*.
This is a live terminal. Typing goes to the machine, including Tab. Press Shift and Tab together to move focus back out to the page.
A real terminal, in this tab
Alpine Linux and tmux 3.4 on an x86 emulator. Nothing to install, and no server behind it.
about 15 MB, once
Done when
not started- Session learn has three windows— not done yet
- Window 2 is the current window of session learn— not done yet