Challenge: tidy a messy session
Session project: 0:editor with four panes in main-vertical, unzoomed; 1:logs on tail; the stray client on old detached.
Nothing new. Every fix is a command from this level:
C-b z- unzoom
C-b $/C-b ,- rename the session / the current window
select-layout main-vertical- reflow the panes
C-b &- kill a window
C-b D- drop a client
movew -r- close the gaps in the index list
The new part is reading the mess off the status line before you touch anything. It tells you almost everything: Z after a window name means zoomed, the window list shows names and index gaps, and C-b D lists every client on the server, not just yours.
Starting from messy, reach this state:
Session renamed to project.
Window 0 named editor, unzoomed, four panes in main-vertical.
The empty window killed.
The window running tail named logs.
The client attached to session old detached.
Windows renumbered so only 0:editor and 1:logs remain.
Challenge cleared.
Nothing running was touched; only how the server organises it changed. Renames relabel, select-layout recomputes sizes, kill-window removed a window nothing needed, detaching the client left session old intact but unwatched, and move-window -r renumbered what was left.
Go further
detach-client -adrops every other client at once when you know you want them all gone.tmux list-windows -t projectfrom another terminal checks your work without attaching.
- 1Read the status line first: session name, a
Zflag, window names and index gaps. Fix one thing at a time. - 2
C-b zunzooms.C-b $andC-b ,rename.C-b :thenselect-layout main-verticalreflows the panes. - 3Switch to the empty window and
C-b &.C-b D, pick the other client,d. ThenC-b :movew -rto close the gaps. - 4Full sequence:
C-b z;C-b $project;C-b ,editor;:select-layout main-vertical; empty windowC-b &; tail windowC-b ,logs;C-b Dd;:movew -r.
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 session messy has been renamed to project— not done yet
- Window 0 is named editor and is not zoomed— not done yet
- Window 0 has four panes arranged as main-vertical— not done yet
- No client is attached to session old any more— not done yet
- Session project has exactly two windows, 0:editor and 1:logs— not done yet