Skip to main content

CloseOnExitFn

Type Alias CloseOnExitFn 

Source
type CloseOnExitFn = Arc<dyn Fn(String, String) + Send + Sync>;
Expand description

shell/lifecycle.rs’s PTY wait/cleanup task needs to actually CLOSE a pane (delete its block, prune it from the owning tab’s layout tree, and notify any connected frontend) when the shell inside it exits — but that task lives deep in backend::blockcontroller, which has no AppState handle (only the individual Store/EventBus/Broker pieces ShellController was constructed with). The actual close logic (crate::sagas::delete_block::run) needs the full AppState — its reducer state, saga-id allocator, and saga log, not just those three pieces. Rather than threading AppState through every ShellController::new/resync_controller call site (a much larger, architecture-inverting change), this mirrors the exact shape crate::broker::process::set_global/global already use for the identical class of problem (broker::process’s AppState-derived ProcessBroker also needs to be reachable from deep in blockcontroller without a direct dependency): a process-wide callback slot, set once at boot from bootstrap::install_close_on_exit_handler (which has AppState in scope) and read from shell/lifecycle.rs.

Aliased Type§

struct CloseOnExitFn { /* private fields */ }