yazi/yazi-fm/src/panic.rs
2023-11-28 02:21:36 +08:00

17 lines
274 B
Rust

use yazi_shared::term::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);
true
});
}));
}
}