Challenge: morning on the build box
Session work: editor, build with a full-width tail pane, monitor on top; detached and back.
Nothing new here. Every piece is something you have already used:
tmux new -s work -n editor- start the session and name window 0 in one line
neww -n nameatC-b :- a named window; add
-dto stay where you are, a program name to run something other than a shell split-window -fvatC-b :- a pane across the full width, below the others
C-b dandtmux attach -t work- leave, and come back
The end state is checked, not the route. Read the status line after each step: it shows the session name, every window with its index, and which one is current.
Build session work so that:
Window 0 is named editor, created with the session from the plain shell.
A window build has two panes side by side and a full-width bottom pane running tail -f ~/build.log.
A window monitor runs top and is not current.
You have detached from work and reattached.
Challenge cleared.
tmux new -s work -n editor created the session and named its first window. neww -n build, then a split and a second split with -fv and a command, built the log window. neww -d -n monitor top added the third without leaving build. C-b d and tmux attach -t work proved everything survives without a client.
Go further
build.logstops at 40 lines; a real build keeps appending, which is whytail -fbeatslessfor watching one.- Every window in this task needed the prompt: no key binding names a window or runs a program in a new one.
- 1Name windows as you create them:
-nat creation is the only rename you know so far. - 2
tmux new -s work -n editorstarts the session and names window 0 in one line. - 3The log pane must span the full width below the others:
split-window -fv tail -f ~/build.logfromC-b :. - 4Create
buildandmonitorwithneww -nat the prompt. Givemonitor-dso it does not become current, andtopas its program.
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 work is named editor— not done yet
- Window build in session work has three panes— not done yet
- Window build has a full-width bottom pane running tail— not done yet
- A non-current window named monitor runs top— not done yet
- No client is attached to session work right after detaching— not done yet
- A client is attached to session work again after reattaching— not done yet