Whetstone.
SessionsDetach, list, attach
Module 6 · Lesson 111 min

Detach, list, attach

The session is the outermost container and the reason to use Zellij at all. Detaching leaves the session running in the background and drops you back to your shell. Quitting tears it down. The difference is the whole point: detach is how work survives, quit is how it ends.

Detach (Session mode)
CtrlthenoEnter Session mode
dDetach from the session (leaves it running)

From your shell, three commands run the session lifecycle: list what’s running, attach to one, and kill one you’re done with. Name your sessions when you start them and this all gets easier; a random name is fine for a scratch session but useless when you have three going.

Session lifecycle from the shell
zellij ls                    # list running (and resurrectable) sessions
zellij attach whetstone    # reattach by name (short: zellij a)
zellij kill-session whetstone   # kill one session (short: zellij k)
zellij kill-all-sessions     # prompt to kill them all (short: zellij ka)
Practice

Try it yourself

Do

Detach and reattach

The core session loop, end to end.

  • In your whetstone session, split a couple of panes so there's state to preserve
  • Press Ctrl o then d to detach; you're back at your shell
  • Run zellij ls and confirm whetstone is listed
  • Run zellij attach whetstone and confirm your panes are exactly as you left them
Done whenYou detached to your shell, saw the session in zellij ls, and reattached to find your panes intact.
Quiz

Keep it alive

Which action leaves your session running in the background?

  1. ACtrl q
  2. BCtrl o then d
  3. CClosing the terminal after Ctrl q
  4. Dzellij kill-session
Show answer

Correct answer: B — Ctrl o then d

Ctrl o then d detaches, leaving the session running. Ctrl q and kill-session both destroy it.

Sign in to track your progress →