mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
Print panic message to stderr, like the stack trace
This commit is contained in:
parent
1232cfd3bb
commit
a216b3cf6a
1 changed files with 2 additions and 2 deletions
|
@ -13,7 +13,7 @@ pub fn panic_handler(main: impl FnOnce() -> i32 + UnwindSafe) -> ! {
|
||||||
let standard_hook = take_hook();
|
let standard_hook = take_hook();
|
||||||
set_hook(Box::new(move |panic_info| {
|
set_hook(Box::new(move |panic_info| {
|
||||||
standard_hook(panic_info);
|
standard_hook(panic_info);
|
||||||
printf!(
|
eprintf!(
|
||||||
"%s crashed, please report a bug. Debug PID %d or press Enter to exit",
|
"%s crashed, please report a bug. Debug PID %d or press Enter to exit",
|
||||||
PROGRAM_NAME.get().unwrap(),
|
PROGRAM_NAME.get().unwrap(),
|
||||||
unsafe { libc::getpid() }
|
unsafe { libc::getpid() }
|
||||||
|
@ -24,7 +24,7 @@ pub fn panic_handler(main: impl FnOnce() -> i32 + UnwindSafe) -> ! {
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
if n == 0 || matches!(buf[0], b'q' | b'\n' | b'\r') {
|
if n == 0 || matches!(buf[0], b'q' | b'\n' | b'\r') {
|
||||||
printf!("\n");
|
eprintf!("\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue