diff options
| author | user <user@clank> | 2026-08-12 14:52:13 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-12 14:52:43 +0200 |
| commit | 598e77563b8c6cace224c763e00d2fdb4157a869 (patch) | |
| tree | beda042e3e355eef9513a461a48d15635c611b89 /zellij-server/src/tab | |
| parent | sl0p: per-pane status bar via OSC 5577 (experimental) (diff) | |
| download | sl0ppij-598e77563b8c6cace224c763e00d2fdb4157a869.tar.gz sl0ppij-598e77563b8c6cace224c763e00d2fdb4157a869.tar.xz sl0ppij-598e77563b8c6cace224c763e00d2fdb4157a869.zip | |
sl0p: serialise the pane status bar for resurrection
The status bar survived detach/reattach (it lives on Grid) but not a
serialise/restore cycle, so a resurrected pane came back blank.
It now travels the whole per-pane serialisation pipeline, mirroring the fork's
existing default_fg/default_bg: pane -> PaneLayoutMetadata ->
PaneLayoutManifest -> TiledPaneLayout -> a status_bar property in the serialised
KDL, then back through the normal layout parser and applied by LayoutApplier
when the pane is recreated.
The sanitiser moved from grid.rs into zellij-utils so both entry points share
one definition. That matters: a layout file on disk is no more trustworthy than
the escape sequence that wrote it -- it may have been hand-edited, or copied from
somewhere else -- so restored text is stripped and length-capped on the way in
just like the OSC payload was.
Verified end to end rather than by unit test alone: set the bar, waited for a
serialisation pass, confirmed status_bar="..." in session-layout.kdl, killed the
session until list-sessions reported EXITED, then attached and watched it come
back from disk. The earlier attempt only proved detach/reattach because Quit had
left the session alive.
Diffstat (limited to 'zellij-server/src/tab')
| -rw-r--r-- | zellij-server/src/tab/layout_applier.rs | 3 | ||||
| -rw-r--r-- | zellij-server/src/tab/mod.rs | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/zellij-server/src/tab/layout_applier.rs b/zellij-server/src/tab/layout_applier.rs index 44e100a4..c796fa41 100644 --- a/zellij-server/src/tab/layout_applier.rs +++ b/zellij-server/src/tab/layout_applier.rs @@ -741,6 +741,9 @@ impl<'a> LayoutApplier<'a> { if layout.default_fg.is_some() || layout.default_bg.is_some() { new_pane.set_pane_default_colors(layout.default_fg.clone(), layout.default_bg.clone()); } + if layout.status_bar.is_some() { + new_pane.set_status_bar_text(layout.status_bar.clone()); + } if let Some(held_command) = hold_for_command { new_pane.hold(None, true, held_command.clone()); } diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs index 88528229..3727b2e2 100644 --- a/zellij-server/src/tab/mod.rs +++ b/zellij-server/src/tab/mod.rs @@ -890,6 +890,7 @@ pub trait Pane { fn status_bar_text(&self) -> Option<String> { None } + fn set_status_bar_text(&mut self, _text: Option<String>) {} fn stack_list_entry_label(&self) -> String { self.current_title() } |
