Change the current window
Window 0 is current and window 3 is the last window.
Three ways to change window, all of them select-window with a different target:
C-b 0…C-b 9- jump to a window by index
C-b n/C-b p- step to the next or previous window
C-b l- the last window, meaning the one that was current before this one
The status line marks the current window with * and the last window with -. The last window updates on every switch, so it is one step of history, not a stack — which is why C-b l twice brings you home.
Press C-b 3.
tests is current: 3:tests*.
Press C-b n, then C-b p.
To docs and back to tests.
Press C-b 0.
editor is current, and 3:tests- marks the last window.
Press C-b l twice.
First to tests, then back to editor, with tests last again.
The other ways to target a window
Each of these is one command with a different target: an index, the next or previous window, or the remembered last one. select-window -t 3 at the prompt does exactly what C-b 3 does.
Here is what just happened.
C-b l runs last-window, which reads the remembered window and switches to it. Switching also updates the memory, which is why the second press brought you back: after the first, window 0 had become the last window.
- Change to the window with that indexC-bthen3
- Change to the next window by index; p goes to the previousC-bthenn
- Change to the window that was current before this oneC-bthenl
Go further
select-window -t 3at the prompt does the same asC-b 3.C-b 'prompts for an index, useful past window 9.
- 1
C-b ltoggles between the current window and the one before it, so pressing it twice returns you to where you started. - 2
C-b 3jumps to window 3;C-b nandC-b pstep forward and back;C-b 0returns to window 0. - 3
C-b 3,C-b n,C-b p,C-b 0, thenC-b ltwice.
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- Window 3 becomes the current window of session learn— not done yet
- Window 0 is current and window 3 is the last window— not done yet