mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 13:37:27 +08:00
Minor refactoring in panic handler
I don't think I really get why this newline is here. It moves the cursor from the end of the newline to the beginning of the next line. Maybe it was added only for panics in background threads? Either way it's fine.
This commit is contained in:
parent
97581ed20f
commit
468849dd54
|
@ -14,12 +14,10 @@ pub fn panic_handler(main: impl FnOnce() -> i32 + UnwindSafe) -> ! {
|
|||
set_hook(Box::new(move |panic_info| {
|
||||
standard_hook(panic_info);
|
||||
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\n",
|
||||
PROGRAM_NAME.get().unwrap(),
|
||||
unsafe { libc::getpid() }
|
||||
);
|
||||
// Move the cursor down so it isn't blocking the text
|
||||
eprintf!("\n");
|
||||
let mut buf = [0_u8; 1];
|
||||
loop {
|
||||
let n = read_blocked(STDIN_FILENO, &mut buf).unwrap_or(0);
|
||||
|
|
Loading…
Reference in New Issue
Block a user