mirror of
https://github.com/nushell/nushell.git
synced 2024-11-07 17:14:23 +01:00
Disable crossterm raw mode
Without this change, the output of panic messages by miette would ignore newlines and become unreadable.
This commit is contained in:
parent
5a5205d5d9
commit
a16144baf1
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -265,6 +265,7 @@ name = "engine-q"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"assert_cmd",
|
||||
"crossterm",
|
||||
"miette",
|
||||
"nu-cli",
|
||||
"nu-command",
|
||||
|
@ -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" }
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user