learntmux.dev

Kill a pane, a window and a session

Goal

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/n prompt
C-b &
the current window and every pane in it, after a y/n prompt
kill-session -t name at C-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.

Do this

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.

Stuck on this one?

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

about 15 MB, once

session learn

Done when

not started
  1. Window 0 of session learn (editor) has exactly two panes— not done yet
  2. Session learn keeps only the windows editor and logs, in that order— not done yet
  3. Only the session learn remains on the server— not done yet