HomeTutorials › Sessions & Daemon
Sessions & Daemon

Session Persistence

#009 0:15 Part of the Rysh video series

Detach, reattach -- your panes come back exactly as you left them.

Session Persistence — 0:15 walkthrough

What you'll see

  1. State is stored at ~/.local/state/rysh/nats/{session}.
  2. The rysh-workspace JetStream KV bucket holds tab structure, pane references, and active indices.
  3. The rysh-panes KV bucket holds each pane's output buffer, mode, and last command.
  4. On attach, the WorkspaceActor restores everything straight from KV.

Commands shown

ls ~/.local/state/rysh/nats/
ls ~/.local/state/rysh/nats/my-project/
echo 'rysh-workspace -> layout   |   rysh-panes -> per-pane state'
rysh attach my-project

Keys used

Enter

Transcript

0:00Detach, reattach -- your panes come back exactly as you left them.

0:05Every session's state lives on disk under ~/.local/state/rysh/nats, one directory per session.

0:15Inside, two JetStream key-value buckets hold everything: rysh-workspace stores your tab and pane layout...

0:26...and rysh-panes stores each pane's output buffer, mode, and last command, keyed by pane ID.

0:36On attach, the workspace restores straight from KV. Detach freely -- nothing is lost.

Key takeaway
Session state lives in JetStream KV buckets and is restored on attach, so nothing is ever lost.