fix(zellij): repair scrollback logging on shell exit #55

Merged
rootiest merged 3 commits from fix/zellij-logging-dump-screen into main 2026-06-16 19:15:23 +00:00
Owner

Summary

Zellij pane logging never produced any log files. Root cause: functions/zellij.fish wrapped every zellij invocation as zellij options --theme catppuccin-mocha <args> — valid only for launching a new session. This mangled every subcommand (action, attach, list-sessions, --version), including the zellij action dump-screen call inside _zellij_dump_log, so the dump always errored out silently. The theme is already set in config.kdl:314, making the wrapper redundant.

Changes

  • Remove functions/zellij.fish — redundant (theme is in config.kdl) and broke every zellij subcommand.
  • Harden _zellij_dump_log:
    • Write via stdout redirect instead of a positional path arg (rejected by zellij 0.44) or --path (server-side write, flaky).
    • Add --ansi to preserve color in logs.
    • Discard empty dumps instead of leaving junk files.
  • Document the structural limitation: zellij can only snapshot on a clean shell exit (exit/Ctrl-D), unlike tmux's continuous pipe-pane stream. Closing a pane or quitting zellij tears down the pane/server before it can be dumped. Documented in docs/fish-config.md (Section 7, C5), README.md, and removed the stale zellij function entry from docs/fish-config.index.

Manual Verification

  • In a fresh zellij pane, run zellij --version — prints the version (no options --theme usage error).
  • Run _zellij_dump_log, then ls -lt ~/.terminal_history/zellij_*.log — a new log file appears.
  • Open the log with less -R or ov — scrollback is present with color preserved.
  • Exit a zellij pane with exit / Ctrl-D — a zellij_<session>-p<pane>_<timestamp>.log is created.
  • Close a pane via zellij's close-pane action — confirm no log is created (documented limitation, not a regression).
  • Confirm the Catppuccin Mocha theme is still applied when launching zellij (now sourced from config.kdl).
  • grep -rn 'zellij' docs/fish-config.md README.md — no references to the removed wrapper function remain.
## Summary Zellij pane logging never produced any log files. Root cause: `functions/zellij.fish` wrapped **every** `zellij` invocation as `zellij options --theme catppuccin-mocha <args>` — valid only for launching a new session. This mangled every subcommand (`action`, `attach`, `list-sessions`, `--version`), including the `zellij action dump-screen` call inside `_zellij_dump_log`, so the dump always errored out silently. The theme is already set in `config.kdl:314`, making the wrapper redundant. ## Changes - **Remove `functions/zellij.fish`** — redundant (theme is in `config.kdl`) and broke every zellij subcommand. - **Harden `_zellij_dump_log`:** - Write via stdout redirect instead of a positional path arg (rejected by zellij 0.44) or `--path` (server-side write, flaky). - Add `--ansi` to preserve color in logs. - Discard empty dumps instead of leaving junk files. - **Document the structural limitation:** zellij can only snapshot on a clean shell exit (`exit`/Ctrl-D), unlike tmux's continuous `pipe-pane` stream. Closing a pane or quitting zellij tears down the pane/server before it can be dumped. Documented in `docs/fish-config.md` (Section 7, C5), `README.md`, and removed the stale `zellij` function entry from `docs/fish-config.index`. ## Manual Verification - [x] In a **fresh** zellij pane, run `zellij --version` — prints the version (no `options --theme` usage error). - [x] Run `_zellij_dump_log`, then `ls -lt ~/.terminal_history/zellij_*.log` — a new log file appears. - [x] Open the log with `less -R` or `ov` — scrollback is present **with color preserved**. - [x] Exit a zellij pane with `exit` / Ctrl-D — a `zellij_<session>-p<pane>_<timestamp>.log` is created. - [x] Close a pane via zellij's close-pane action — confirm **no** log is created (documented limitation, not a regression). - [x] Confirm the Catppuccin Mocha theme is still applied when launching `zellij` (now sourced from `config.kdl`). - [x] `grep -rn 'zellij' docs/fish-config.md README.md` — no references to the removed wrapper function remain.
rootiest added 1 commit 2026-06-16 19:06:12 +00:00
The zellij wrapper (functions/zellij.fish) rewrote every `zellij`
invocation as `zellij options --theme catppuccin-mocha <args>`, which is
only valid for launching a new session. This mangled every subcommand,
including the `zellij action dump-screen` call inside _zellij_dump_log,
so no logs were ever produced. The theme is already set in config.kdl,
making the wrapper redundant — remove it.

Also harden _zellij_dump_log:
- dump-screen takes the file via stdout redirect, not a positional arg
  (rejected by zellij 0.44) nor --path (server-side write, flaky)
- add --ansi to preserve color in the logs
- discard empty dumps instead of leaving junk files

Document the structural limitation: zellij can only snapshot on a clean
shell exit, unlike tmux's continuous pipe-pane stream. Closing a pane or
quitting zellij tears down the pane/server before it can be dumped.
rootiest added 1 commit 2026-06-16 19:10:43 +00:00
Point zellij, zellij-logging, tmux-logging, pipe-pane, and dump-screen
lookups at the C5 logging section. tmux=tmux-clean stays for the function.
rootiest added 1 commit 2026-06-16 19:14:43 +00:00
Add tool-name synonyms whose names appear in no heading (so the
fallback substring scan can't reach them): eza/exa/lsd, trash, btop,
prettyping, duf/dust, kitten, bat. Add integration and topic keywords
(zoxide, direnv, venv/virtualenv, wakatime, tailscale, done/notify,
pager-hierarchy, shell-aliases, kitty-logging/watcher, agy,
antigravity-ide, html/browser, wiki).

Fix stale entries pointing at renamed/removed headings:
- antigravity -> ### antigravity-resume (### antigravity was removed)
- man-page/manpage -> ## As a man page (dropped '(if compiled)')
- disambiguate duplicate 'secrets' key: secrets.fish is now secrets-file
rootiest merged commit 70b4492986 into main 2026-06-16 19:15:23 +00:00
rootiest deleted branch fix/zellij-logging-dump-screen 2026-06-16 19:15:23 +00:00
Sign in to join this conversation.