forked from extern/nushell
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"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assert_cmd",
|
"assert_cmd",
|
||||||
|
"crossterm",
|
||||||
"miette",
|
"miette",
|
||||||
"nu-cli",
|
"nu-cli",
|
||||||
"nu-command",
|
"nu-command",
|
||||||
|
@ -10,6 +10,7 @@ members = ["crates/nu-cli", "crates/nu-engine", "crates/nu-parser", "crates/nu-c
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
reedline = { git = "https://github.com/jntrnr/reedline", branch = "main" }
|
reedline = { git = "https://github.com/jntrnr/reedline", branch = "main" }
|
||||||
|
crossterm = "0.21.*"
|
||||||
nu-cli = { path="./crates/nu-cli" }
|
nu-cli = { path="./crates/nu-cli" }
|
||||||
nu-command = { path="./crates/nu-command" }
|
nu-command = { path="./crates/nu-command" }
|
||||||
nu-engine = { path="./crates/nu-engine" }
|
nu-engine = { path="./crates/nu-engine" }
|
||||||
|
@ -17,6 +17,11 @@ mod tests;
|
|||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
miette::set_panic_hook();
|
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();
|
let engine_state = create_default_context();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user