yazi/yazi-fm/src/panic.rs
Nicholas42 af92b92da8
feat: allow custom exit code with quit --code (#2609)
Co-authored-by: Nicholas Schwab <git@nicholas-schwab.de>
Co-authored-by: sxyazi <sxyazi@gmail.com>
2025-04-12 17:59:23 +08:00

17 lines
259 B
Rust

use crate::Term;
pub(super) struct Panic;
impl Panic {
pub(super) fn install() {
better_panic::install();
let hook = std::panic::take_hook();
std::panic::set_hook(Box::new(move |info| {
Term::goodbye(|| {
hook(info);
1
});
}));
}
}