Skip to main content

close_unshown_workspace

Function close_unshown_workspace 

Source
async fn close_unshown_workspace(
    state: &AppState,
    window_id: &str,
    ws_id: String,
    closing: ClosingWindow,
)
Expand description

ws_id lost its last window (window_id, now closed).

The close that empties Client.windowids is the end of the session: it first saves the session record (restore-on-relaunch, SPEC_SESSION_RESTORE_AND_SAVED_LAYOUTS_2026_08_13 Feature 1), naming the kept contents, so the next launch reopens them and rebuilds them from the record only if they are gone. Asked after this close’s own prune and read fresh: of two concurrent closes that end a session, one sees it empty. Not asked for workspace sharing, which is true of nearly every close.

The contents are then kept (session_closed::keep_workspace), as a closed window unless this close ended the session, or deleted when the window was removed from the workspace (DiscardWorkspaceOnClose), which saves no record of it.