examples: Call Terminal::reset_mode instead of relying on Drop

At some point recently I got rid of the Drop stuff. We need to reset the
mode or else Windows powershell crashes for me when trying to claim
CONIN$ twice. (Run an example before this commit and then run regular
`hx`).
This commit is contained in:
Michael Davis
2025-04-07 13:10:21 -04:00
parent c2333d3df5
commit fca131f25c
2 changed files with 3 additions and 2 deletions

View File

@@ -70,8 +70,7 @@ fn main() -> io::Result<()> {
other => eprintln!("unexpected event: {other:?}\r"),
}
}
terminal.enter_cooked_mode()?;
drop(terminal);
terminal.reset_mode()?;
println!("Detected features: {features:?}");
Ok(())

View File

@@ -131,6 +131,8 @@ fn main() -> io::Result<()> {
))),
)?;
terminal.reset_mode()?;
Ok(())
}