Merge pull request #79 from kubouch/disable-raw-mode

Disable crossterm raw mode
This commit is contained in:
JT 2021-10-02 06:01:48 +13:00 committed by GitHub
commit 5b3b74ebec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

1
Cargo.lock generated
View File

@ -265,6 +265,7 @@ name = "engine-q"
version = "0.1.0"
dependencies = [
"assert_cmd",
"crossterm",
"miette",
"nu-cli",
"nu-command",

View File

@ -10,6 +10,7 @@ members = ["crates/nu-cli", "crates/nu-engine", "crates/nu-parser", "crates/nu-c
[dependencies]
reedline = { git = "https://github.com/jntrnr/reedline", branch = "main" }
crossterm = "0.21.*"
nu-cli = { path="./crates/nu-cli" }
nu-command = { path="./crates/nu-command" }
nu-engine = { path="./crates/nu-engine" }

View File

@ -17,6 +17,11 @@ mod tests;
fn main() -> Result<()> {
miette::set_panic_hook();
let miette_hook = std::panic::take_hook();
std::panic::set_hook(Box::new(move |x| {
crossterm::terminal::disable_raw_mode().unwrap();
miette_hook(x);
}));
let engine_state = create_default_context();