-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): update a range of dependencies (#117)
ansi-to-tui : 6.0.0 => 7.0.0 bollard : 0.17.1 => 0.18.1 byte-unit : 5.1.4 => 5.1.6 clap : 4.5.20 => 4.5.21 ratatui : 0.28.1 => 0.29.0 ratatui-macros : 0.5.0 => 0.6.0 tracing : 0.1.40 => 0.1.41 tracing-error : 0.2.0 => 0.2.1 tracing-subscriber : 0.3.18 => 0.3.19 tui-big-text : 0.6.0 => 0.7.0 ureq : 2.10.1 => 2.11.0
- Loading branch information
1 parent
ace8d42
commit 0d45d5f
Showing
13 changed files
with
146 additions
and
132 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,10 @@ | ||
use crossterm::{ | ||
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, | ||
ExecutableCommand, | ||
}; | ||
use ratatui::prelude::*; | ||
use std::{ | ||
io::stdout, | ||
panic::{set_hook, take_hook}, | ||
}; | ||
|
||
pub fn init() -> std::io::Result<Terminal<impl Backend>> { | ||
enable_raw_mode()?; | ||
stdout().execute(EnterAlternateScreen)?; | ||
let terminal = Terminal::new(CrosstermBackend::new(stdout()))?; | ||
Ok(terminal) | ||
} | ||
|
||
pub fn restore() -> std::io::Result<()> { | ||
stdout().execute(LeaveAlternateScreen)?; | ||
disable_raw_mode()?; | ||
Ok(()) | ||
} | ||
use std::panic::{set_hook, take_hook}; | ||
|
||
pub fn init_panic_hook() { | ||
let original_hook = take_hook(); | ||
set_hook(Box::new(move |panic_info| { | ||
// intentionally ignore errors here since we're already in a panic | ||
let _ = restore(); | ||
let _ = ratatui::restore(); | ||
Check warning on line 7 in src/terminal.rs GitHub Actions / check / stable / clippythis let-binding has unit value
Check warning on line 7 in src/terminal.rs GitHub Actions / check / beta / clippythis let-binding has unit value
|
||
original_hook(panic_info); | ||
})); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters