Skip to main content

Module session

Module session 

Source
Expand description

Session state persistence.

Saves and loads session data to disk for recovery after crashes, reboots, or stop. One session per repository, stored as JSON under the XDG data directory (~/.local/share/git-paw/sessions/).

Structs§

RepoAgentEntry
One agent entry in the per-repo discovery file.
RepoSessionFile
The per-repo discovery document written to <repo>/.git-paw/sessions/<session_name>.json.
Session
Persisted session state for a git-paw session.
WorktreeEntry
A worktree entry within a session.

Enums§

DisplayStatus
The status git-paw displays for a session, derived from the persisted receipt status combined with a live tmux probe (design D4 of session-bugfixes).
SessionMode
Pane-layout shape used when the session was created. Drives recovery so recover_session rebuilds with the same layout it was launched with.
SessionStatus
Status of a persisted session.

Functions§

delete_session
Deletes a session file by name.
delete_session_in
Deletes a session file by name from the given directory.
find_session_for_repo
Finds the session associated with a given repository path.
find_session_for_repo_in
Finds the session for a repo path, scanning the given directory.
load_all_sessions_in
Loads every session receipt in the given directory.
load_session_from
Loads a session by name from the given directory.
remove_repo_session_file
Removes the per-repo discovery file for a session. Idempotent — a missing file is not an error.
repo_session_path
Returns the per-repo session file path for a session name.
repo_sessions_dir
Returns the per-repo sessions directory: <repo>/.git-paw/sessions/.
save_session
Atomically writes a session to disk.
save_session_in
Atomically writes a session to the given directory.
session_state_dir
Returns the sessions directory (~/.local/share/git-paw/sessions/).
write_repo_session_file
Atomically writes the per-repo discovery file for a session.