pub fn install_panic_hook()Expand description
A panic on the UI thread restores the terminal before the message prints, so it lands on the normal screen and is not erased with the alternate one; the drop that follows the unwind repeats the steps, which is harmless. A panic on another thread, such as the console worker, is caught by its task and the UI goes on: it is only logged, since the default hook’s stderr would paint over the screen.