mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 05:41:16 -03: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user