diskonaut
diskonaut copied to clipboard
Feature: error reporting with clean stacktraces
Right now, if the app panics, the stacktrace we see is very much messed up and hard to read, since the terminal is in "raw mode". It would be nice if we could catch all these errors, clear the terminal, exit raw mode and then print them to the screen.
There is std::panic::set_hook. You could set a hook that exits raw mode and then calls the default hook.
That sounds like a good approach. I think it would be best to use it with the Termion methods of suspending raw mode here: https://github.com/redox-os/termion/blob/189222555ef92a29de366f96d2a067b3a920fc24/src/raw.rs#L118