Kill a pane, a window and a session
learn has two panes in editor, no scratch window, and session old is gone.
Every create has a kill, one per level:
C-b x- the active pane, after a
y/nprompt C-b &- the current window and every pane in it, after a
y/nprompt kill-session -t nameatC-b :- a whole session, from anywhere, with no prompt
Killing is not exiting. exit ends a program on its own terms and the pane closes because it is empty; a kill forces the pane, window or session closed whatever is running. That is the difference that matters for a program like yes, which never ends on its own.
The cascade from level 1 still applies: kill the last pane and its window goes, kill the last window and its session goes.
Press C-b x, then y.
The pane running yes closes; two panes remain.
Press C-b n to reach scratch, then C-b &, then y.
The list reads editor logs.
Press C-b :, type kill-session -t old, Enter.
Nothing on screen changes — old is gone.
Killing the session you are in
kill-session without -t kills the session you are attached to, and detaches you with it.
Here is what just happened.
C-b x and C-b & run confirm-before around kill-pane and kill-window, which is where the prompt comes from. kill-session has no key because keys only reach the session you are attached to; the prompt can name any session on the server.
- Kill the active pane after a y/n promptC-bthenx
- Kill the current window and all its panes after a y/n promptC-bthen&
- Kill a session and all its windows; without -t kills the attached session:kill-session -t name
Go further
kill-pane -aandkill-window -akeep the target and kill every other one at that level.kill-session -a -t learnkeepslearnand kills everything else.confirm-before -p 'sure?' -y kill-windowchanges the prompt and makes Enter mean yes.
- 1
C-b &kills the current window, whichever it is. Switch toscratchfirst. - 2Every create has a kill:
C-b xundoes a split,C-b &undoes a window. Both asky/n. - 3
kill-sessionhas no key. OpenC-b :and typekill-session -t old. - 4
C-b xy, thenC-b nC-b &y, thenC-b :kill-session -t old.
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 0 of session learn (editor) has exactly two panes— not done yet
- Session learn keeps only the windows editor and logs, in that order— not done yet
- Only the session learn remains on the server— not done yet