Skip to content

fix: zellij session must detach, not quit, when the client dies#118

Open
BrettKinny wants to merge 2 commits into
mainfrom
fix/zellij-detach-and-help
Open

fix: zellij session must detach, not quit, when the client dies#118
BrettKinny wants to merge 2 commits into
mainfrom
fix/zellij-detach-and-help

Conversation

@BrettKinny

@BrettKinny BrettKinny commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

What

  • on_force_close "quit""detach" in the default zellij config. With quit, any dropped client connection (ssh timeout, mosh client killed, terminal app closed by the OS) killed the entire session and every process running in it — the opposite of what a terminal multiplexer is for. detach (zellij's own default) leaves the session running for reattach.
  • Ctrl+b as a second leader mirroring every Ctrl+Space mode bind. Ctrl+Space is a NUL byte some client stacks never deliver (iPadOS grabs it for input-source switching before the terminal app sees it); Ctrl+b is the classic tmux prefix. Scroll/search keep their explicit Ctrl+b page-up binds, which take precedence over the shared exit bind.
  • New _ensure_zellij_defaults self-heal (same pattern as the tmux mouse self-heal) so already-provisioned containers get all fixes on the next setup run, since the config heredoc only writes when no config.kdl exists.
  • Bind <leader> ? to a floating configuration plugin as a keybinding help popup — clear-defaults=true means there is otherwise no discoverable way to browse the custom binds.

Testing

  • bash -n setup.sh
  • Fresh-install path: heredoc extracted and validated with zellij setup --check (zellij 0.44.3, in a live squarebox container).
  • Upgrade path: _ensure_zellij_defaults run verbatim against a pre-fix config.kdl; result has the 4 expected Ctrl+b binds and passes zellij setup --check.
  • Detach-on-disconnect, ? popup, and Ctrl+b leader confirmed interactively over mosh from an iPad (Blink) client.

🤖 Generated with Claude Code

BrettKinny and others added 2 commits July 20, 2026 11:06
on_force_close "quit" killed the whole session (and every process in
it) whenever the ssh/mosh chain dropped — the opposite of what a
multiplexer is for. Default to "detach" and self-heal existing
configs on upgraded containers, mirroring the tmux mouse self-heal.

Also bind <leader> ? to a floating configuration plugin as a
keybinding help popup (clear-defaults=true leaves no discoverable
help otherwise).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Ctrl+Space is transmitted as a NUL byte that some client stacks never
deliver (iPadOS grabs it for input-source switching before Blink sees
it). Mirror every Ctrl+Space mode bind with Ctrl+b — the classic tmux
prefix — in the shipped config and the self-heal. Scroll/search modes
keep their explicit Ctrl+b page-up binds, which take precedence over
the shared exit bind.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant