Skip to main content

save_terminal_state

Function save_terminal_state 

Source
fn save_terminal_state(
    state: &AppState,
    args: &[Value],
) -> Result<WebReturnType, String>
Expand description

Periodic terminal-state snapshot (SPEC_TERMINAL_SCROLLBACK_PERSISTENCE_2026_07_23.md §2.2): TermWrap.processAndCacheData() (frontend/app/view/term/termwrap.ts) fires this every ~5s of active output via fireAndForget, so it stays best-effort: log and return success either way rather than surfacing storage errors to a caller that doesn’t check the result. Persisted as the cache:term:full blockfile (TermCacheFileName on the frontend), read back by loadInitialTerminalData() on reconnect alongside the raw "term" delta since ptyOffset.