mirror of
https://github.com/encounter/objdiff.git
synced 2026-03-30 11:32:16 -07:00
objdiff-cli: Migrate to ratatui for rendering
This commit is contained in:
@@ -20,6 +20,7 @@ crossterm = "0.27.0"
|
||||
enable-ansi-support = "0.2.1"
|
||||
log = "0.4.20"
|
||||
objdiff-core = { path = "../objdiff-core", features = ["all"] }
|
||||
ratatui = "0.26.1"
|
||||
rayon = "1.8.1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1.0.111"
|
||||
|
||||
+169
-150
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,16 @@
|
||||
use std::panic;
|
||||
use std::{io::stdout, panic};
|
||||
|
||||
use crossterm::{
|
||||
cursor::Show,
|
||||
event::DisableMouseCapture,
|
||||
terminal::{disable_raw_mode, LeaveAlternateScreen},
|
||||
};
|
||||
|
||||
pub fn crossterm_panic_handler() {
|
||||
let original_hook = panic::take_hook();
|
||||
panic::set_hook(Box::new(move |panic_info| {
|
||||
let _ = crossterm::execute!(
|
||||
std::io::stderr(),
|
||||
crossterm::terminal::LeaveAlternateScreen,
|
||||
crossterm::event::DisableMouseCapture
|
||||
);
|
||||
let _ = crossterm::terminal::disable_raw_mode();
|
||||
let _ = crossterm::execute!(stdout(), LeaveAlternateScreen, DisableMouseCapture, Show);
|
||||
let _ = disable_raw_mode();
|
||||
original_hook(panic_info);
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user