Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Zellij: Orientation

Terminal multiplexerThreads + channels + TokioRevision 98a0837

Zellij is a terminal workspace whose server outlives any one attached client. It owns child pseudo-terminals, pane state, plugins, rendering, and session lifecycle. The client owns the user’s real terminal and transports input and rendered output across IPC.

keyboard → client IPC → route/action → Screen owner → PTY writer → child
                                                              ↓ output
client terminal ← rendered ANSI ← server ← debounce ← Screen/VTE parser

Design thesis

Zellij serializes mutation behind subsystem-owner threads, communicates with typed instructions, and uses async I/O only where waiting on many PTYs and timers benefits from it.

This is a hybrid design. “Uses Tokio” does not mean “everything is an async task.” The Screen, PTY command loop, plugin runtime, PTY writer, and background jobs each have dedicated synchronous owner threads. A shared four-thread Tokio runtime handles PTY readiness, timers, downloads, and action-completion waits.

What to know first

  • A pseudo-terminal makes a child process behave as if it owns a terminal.
  • ANSI/VT bytes describe text, cursor motion, colors, and terminal operations.
  • A channel transfers owned messages between independently running owners.
  • A oneshot carries one completion value back to one waiter.
  • Debouncing combines many rapid requests into one later operation.