Commit b01637c
committed
feat(session): persist and restore pane scrollback
Continue-where-you-left-off now brings the previous session's scrollback
back, not just the empty pane skeleton. Each pane writes its most recent
1500 lines to a bincode sidecar under
~/.config/kaku/session_content/<dir>/pane_<id>.bin; on restore the lines
reflow via Line::wrap when the column width changed and get prepended
into the freshly spawned shell's primary scrollback so the user's new
prompt stays at the bottom.
SNAPSHOT_VERSION bumps 3->4. A separate CONTENT_SCHEMA_VERSION lives
inside each sidecar plus a WEZTERM_SURFACE_FINGERPRINT constant lets the
cell payload evolve independently of the JSON envelope. All content
failures (missing sidecar, corrupt bincode, schema mismatch, alt-screen
pane) degrade silently to an empty scrollback so the structural restore
is never blocked.
Adds Pane::inject_scrollback (default no-op) backed on LocalPane by a
new TerminalState::prepend_primary_scrollback that always targets the
primary screen so a pane briefly on alt screen at save time still gets
its main-screen history when restored. After every envelope write,
gc_kept_content_dirs sweeps session_content/ down to just the
directories referenced by the two envelopes. Running processes (vim,
claude-code, ssh) cannot be revived; this is text only above a fresh
shell.1 parent da849a0 commit b01637c
7 files changed
Lines changed: 617 additions & 25 deletions
File tree
- kaku-gui
- src
- mux/src
- term/src
- terminalstate
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
0 commit comments