mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-12 06:45:20 +00:00
Experimental objdiff-cli (WIP)
This commit is contained in:
1
objdiff-cli/src/util/mod.rs
Normal file
1
objdiff-cli/src/util/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod term;
|
||||
15
objdiff-cli/src/util/term.rs
Normal file
15
objdiff-cli/src/util/term.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use std::panic;
|
||||
|
||||
pub fn crossterm_panic_handler() {
|
||||
let original_hook = panic::take_hook();
|
||||
panic::set_hook(Box::new(move |panic_info| {
|
||||
crossterm::execute!(
|
||||
std::io::stderr(),
|
||||
crossterm::terminal::LeaveAlternateScreen,
|
||||
crossterm::event::DisableMouseCapture
|
||||
)
|
||||
.unwrap();
|
||||
crossterm::terminal::disable_raw_mode().unwrap();
|
||||
original_hook(panic_info);
|
||||
}));
|
||||
}
|
||||
Reference in New Issue
Block a user