Merge nucleic/sleek-thistle-egret-fyej into dev

This commit is contained in:
2026-07-18 12:45:36 -07:00
parent 5648b96ddc
commit 26fd468ad0
6 changed files with 208 additions and 6 deletions
+17
View File
@@ -193,9 +193,26 @@ pub fn run() {
}
};
run_exit_hook();
std::process::exit(i32::from(exit_code));
}
// nash: a hook invoked right before the process exits, so an embedding shell
// (nash) can flush its observation event buffer (docs/NASH.md §6.1).
static EXIT_HOOK: std::sync::OnceLock<Box<dyn Fn() + Send + Sync>> = std::sync::OnceLock::new();
/// nash: registers a hook run immediately before the shell process exits.
/// May be called at most once; later calls are ignored.
pub fn set_exit_hook(hook: Box<dyn Fn() + Send + Sync>) {
let _ = EXIT_HOOK.set(hook);
}
fn run_exit_hook() {
if let Some(hook) = EXIT_HOOK.get() {
hook();
}
}
/// Installs panic handlers to report our panic and cleanly exit on panic.
fn install_panic_handlers() {
//