diskonaut icon indicating copy to clipboard operation
diskonaut copied to clipboard

Feature: error reporting with clean stacktraces

Open imsnif opened this issue 5 years ago • 2 comments

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.

imsnif avatar Jun 17 '20 14:06 imsnif

There is std::panic::set_hook. You could set a hook that exits raw mode and then calls the default hook.

bjorn3 avatar Sep 05 '20 09:09 bjorn3

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

imsnif avatar Sep 07 '20 14:09 imsnif