practicing the session lifecycle with zellij, zellij -s, attach, detach, ls, up to kill-session, then managing tabs with ctrl+t and basic panes with ctrl+p.

The first two episodes gave you the foundation: why Zellij exists and how its architecture works. Now it's time to get your hands dirty. This episode 3 is the first operational episode — you'll practice the session, tab, and pane lifecycle from birth to death. Every command and keybinding in this episode is among the most used every day, so master them until they flow.
The lifecycle in Zellij follows a simple flow: start a session, work inside it with tabs and panes, detach the session when you have to leave, find the session still alive later, and stop it when the work is done. You already understood in theory from episode 2 that the server and client are separate; now you'll feel firsthand how that separation works in practice.
We'll cover three domains: session management via the CLI (zellij, zellij -s, attach, detach, zellij ls, kill-session), tab management with Ctrl+t, and basic pane management with Ctrl+p. By the end, you'll complete one full workflow combining all of them. Let's begin.
The simplest way to start Zellij is typing zellij with no arguments. Zellij creates a new session with an automatic name and immediately shows the default workspace: one tab with one pane containing your shell. For daily needs, that's enough. But in practice, naming sessions is a habit you should plant from the start — the name is the key to finding, distinguishing, and managing many sessions at once.
zellij
zellij -s dev
zellij -s project-apizellij -s dev creates a session named dev. If you're already used to tmux, this is parallel to tmux new -s dev. One strongly recommended convention: one session per project. Working on a blog project? Name the session blog. An API project? project-api. With this convention, zellij ls immediately becomes your work map — listing sessions is the same as seeing which projects are currently active.
One important detail: when a session named dev already exists and you run zellij -s dev again, Zellij does not create a second session — it refuses to create a session with a name that's already taken. This differs from zellij attach -c dev, which is designed for the "use or create" idiom. Understand the difference:
| Command | Behavior If the Session Already Exists |
|---|---|
zellij | Creates a new session with an automatic name |
zellij -s dev | Fails — name already taken |
zellij attach dev | Attaches to the existing session; errors if it doesn't exist |
zellij attach -c dev | Attaches if it exists; creates if it doesn't |
The attach -c idiom is very useful in scripts and quick workflows: you don't need to check whether a session exists first — one command handles both cases.
Once a session is running, you'll move in and out as often as you switch between an editor and a browser. Detaching is done from inside a session by pressing Ctrl+o then d — enter Session mode, then press d. The session stays alive; you only release the client. Re-attaching is done from a plain terminal with zellij attach dev.
zellij attach dev
zellij attach project-apiTo see which sessions are still alive, use zellij ls or zellij list-sessions — both are the same command. The output shows the session name, window count, and active/detached status. This is the command you'll run most often from a plain terminal, so remember it well:
zellij lsTip
Get used to this working pattern: start the day with zellij ls, see which sessions are still alive from yesterday, then zellij attach <name> to continue exactly where you left off. Scrollback, tabs, and panes are still intact — nothing is lost just because you closed your laptop overnight. This is the main appeal of the client-server model we discussed in episode 2.
The most common mistake in this phase is panicking when zellij ls looks empty even though you "just had a session". Check first: are you currently inside a Zellij session? Running zellij ls from inside a pane gives confusing results because the context is different. zellij ls, zellij attach, and zellij kill-session are CLI commands meant to be run outside sessions — from a plain terminal.
Stopping a session is an explicit decision: you're telling Zellij that all the processes inside it may be terminated. There are two ways: from inside a session with Ctrl+q (Quit), or from outside with the CLI.
zellij kill-session dev
zellij kill-session project-api
zellij kill-all-sessionszellij kill-session dev stops the dev session along with all its panes — any processes running in those panes are stopped too. zellij kill-all-sessions does the same for all sessions at once, useful for a full cleanup at the end of a working session.
Warning
Ctrl+q and kill-session cannot be undone — all processes inside the session are stopped, including a dev server, database, or long-running job. Before stopping a session, make sure there's no important unfinished work. If in doubt, just detach (Ctrl+o then d) and let the session live — far safer than regret.
A healthy pattern: detach to switch context, kill only when the work is truly done. You don't need to worry about sessions piling up — zellij ls always gives a clear picture, and kill-session or kill-all-sessions cleans up quickly.
Tabs are how Zellij divides a session into focus areas. Instead of opening many terminal windows, you open many tabs within one session and switch with the keyboard. All processes in other tabs keep running — a hidden tab never "dies".
Tab management starts by pressing Ctrl+t to enter Tab mode. The status bar changes and shows all available tab actions. The hints are always on screen, but these are the most commonly used:
Key (after Ctrl+t) | Action |
|---|---|
n | Create a new tab |
h / l | Switch to the tab on the left / right |
r | Rename the tab |
x | Close the active tab |
1 - 9 | Jump directly to a tab by number |
The most common workflow: Ctrl+t then n for a new tab (matching the task context), Ctrl+t then 1 to return to the first tab, and Ctrl+t then x to close a tab you no longer need. Renaming tabs with Ctrl+t then r is a highly recommended habit — clear tab names (for example code, server, ops) make navigation much faster than relying on numbers.
One detail that often confuses beginners: Ctrl+t inside Zellij never "types" the t character into an editor. It always enters Tab mode. This is the advantage of the mode model discussed in episode 2 — no conflict with editor keybindings, and hints always appear to remind you which mode you're in.
Also note that tabs follow the session lifecycle, not the client lifecycle. When you detach with Ctrl+o then d, all tabs and their processes stay intact; when you attach again, the first through last tabs return exactly as you left them. Closing the active tab with Ctrl+t then x stops all panes inside it at once — make sure no important process is running, because a closed tab can't be reopened directly.
Panes are where you actually work. One tab can hold one large pane, or several panes arranged like a mosaic. Basic pane management starts with Ctrl+p to enter Pane mode.
Key (after Ctrl+p) | Action |
|---|---|
n | Create a new pane (auto-split) |
d | Split the pane down |
r | Split the pane right |
h / j / k / l | Move focus between panes |
x | Close the active pane |
f | Toggle fullscreen (zoom to one pane) |
z | Toggle pane frames |
The two keys most used from day one are n and r. Ctrl+p then n creates a new pane next to the active pane, dividing the available space automatically — the fastest way to "open another terminal". Ctrl+p then r creates a split to the right, and Ctrl+p then d creates a split down, giving you full control over the layout direction.
Focus navigation is done with Ctrl+p then h/j/k/l — matching the compass directions on screen. But for speed, Zellij provides quick keys directly in Normal mode: Alt+h, Alt+j, Alt+k, Alt+l move focus without entering a mode, and Alt+n creates a new pane instantly. After a few days, these Alt combinations will feel more natural than Ctrl+p + direction.
git statusClosing a pane is done with Ctrl+p then x. Remember the lesson from episode 2: closing a pane stops the process running inside it. If a pane holds an important process, move focus elsewhere first or consider letting it live. To zoom focus onto one pane, Ctrl+p then f makes the active pane fill the screen — very useful when you need lots of editor space — and f again to return.
One habit that helps a lot early on is Ctrl+p then ? to display the full list of Pane mode actions right on screen, complete with their keys. Use this as your internal cheat sheet — far faster than opening documentation. And note one lifecycle detail: when you close the last pane in a tab, that tab closes too, because Zellij doesn't let an empty tab stand alone. This isn't a bug — it's behavior that keeps your workspace clean without orphaned tabs piling up.
Theory is meaningless without practice, so let's put it all together in one real workflow. You're starting a blog project and want to build a workspace with Zellij.
First step, from a plain terminal, open a session named blog:
zellij -s blogInside the session, build your working layout: Ctrl+t then r to rename the tab to code, then Ctrl+p then r to open a pane on the right, and Ctrl+p then h to return focus to the left pane. You now have one tab with two side-by-side panes — left for the editor, right for the terminal.
From the right pane, start the dev server. After that, Ctrl+t then n to open a new tab, and Ctrl+t then r to name it git. The git tab holds your versioning workflow while the code tab keeps running the editor and dev server. Ctrl+t then 1 takes you back to the code tab at any time.
When you have to leave for lunch, Ctrl+o then d to detach. Back from lunch, run zellij ls to see the blog session is still alive, then zellij attach blog — all tabs, panes, and processes are exactly as you left them. At the end of the day, after all work is committed and the server stopped, Ctrl+q or zellij kill-session blog closes everything.
Tip
Don't try to memorize the whole keybinding table in this episode at once. Start with three pairs: Ctrl+t n for a new tab, Ctrl+p n for a new pane, and Alt+h/j/k/l for moving focus. Once those three pairs feel automatic, add Ctrl+t 1-9 for tab jumping and Ctrl+p f for zoom. Muscle memory is built gradually, not with a single memorization pass.
zellij ls, attach, and kill-session are run from a plain terminal, not from inside a pane. Running them from inside a session produces out-of-context, confusing output.zellij -s dev will overwrite an existing session. It doesn't overwrite — it fails because the name is taken. Use zellij attach -c dev if you want the "use or create" idiom.x while a process isn't finished. Closing a pane stops the process inside it. Detach first or let the pane live if the work isn't done.Ctrl+q without thinking. Ctrl+q stops the session and all processes inside it without confirmation. If you only want to pause, detach with Ctrl+o then d.zellij ls useless as a work map. The naming habit (zellij -s project, Ctrl+t r) is a small investment with a big payoff.This episode 3 is your operational foundation. You've practiced the entire session lifecycle: starting with zellij and zellij -s, attaching and detaching with Ctrl+o then d, finding sessions with zellij ls, and stopping them with Ctrl+q or zellij kill-session. You also mastered tab management with Ctrl+t and basic pane management with Ctrl+p, plus the Alt+n and Alt+h/j/k/l quick keys.
Key takeaways:
zellij ls becomes your daily work map.zellij attach -c <name> is the "use or create" idiom for fast workflows.Ctrl+o then d) leaves processes alive; kill stops them mercilessly.Ctrl+t: n new, h/l move, r rename, x close, 1-9 jump.Ctrl+p: n new, d/r split, h/j/k/l focus, x close, f zoom.Alt+... quick keys in Normal mode are the path to speed.Every interaction in this episode is powered by one concept we haven't fully dissected yet: modes. Ctrl+p and Ctrl+t are the doors into modes, and understanding that modes are how Zellij organizes actions will change how you approach this entire tool. In episode 4 we dissect the mode system in full — all the modes, the difference between mode-based keybinding and tmux's prefix keys, the Alt+ quick keys, and Tmux mode for those of you coming from tmux. See you in episode 4!