Kill the server
The tmux server is gone; tmux ls reports no server.
kill-server, typed at C-b :, stops the whole server at once: every session, window and pane, attached or not, with no confirmation.
Normally things close from the inside out, one layer at a time:
- a program exits → its pane closes
- the last pane in a window closes → the window closes
- the last window in a session closes → the session ends
- the last session ends → the server stops
exit in a shell starts that chain and nothing else. kill-server skips it entirely and does not care what is still running.
Run tmux ls.
Two sessions: learn with two windows and scratch with one.
Type exit.
This pane’s shell ends and window shell closes. learn still has logs, so you stay attached, now looking at it.
Press C-b :, type kill-server, Enter.
You are back at the plain shell, and tmux ls reports no server.
Here is what just happened.
exit never talked to tmux; the server saw the shell end and closed its pane and window. kill-server targets the server itself, so scratch, which had no client at all, went with it.
- Kill the tmux server and every session, window and pane in it:kill-server
Go further
kill-session -t learncloses one session and leaves the rest running.C-b dleaves everything running; only an empty server, orkill-server, stops it.
- 1
kill-serveris a tmux command: type it atC-b :, not at the shell prompt. There is no confirmation. - 2
tmux lsworks from inside a pane and lists every session, not just yours. - 3
C-b :, typekill-server, Enter.
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- The tmux server has been killed; tmux ls reports no server running— not done yet