Skip to main content

Module state

Module state 

Source

Structs§

LatestEvent
State and cwd from the latest event for a pane.
StateDetector

Enums§

WindowState

Functions§

load_latest_events
Load the latest event from each event file in the events directory. Returns a map of pane_id → LatestEvent, keeping only the highest-timestamp entry per pane_id. This deduplicates across multiple files that share a recycled pane ID, ensuring the current session’s events always win.
purge_events_for_pane
Remove event files whose last event matches the given pane_id. Called when a new window is created to prevent stale events (from a previous session that used the same recycled tmux pane_id) from contaminating state.
purge_events_for_pane_in
Remove event files whose last event matches the given pane_id from the given directory.
read_last_line
Read the last line of a file efficiently. Returns None if the file is empty or unreadable.
state_from_str