disable terminal raw mode on cross term drop
This commit is contained in:
parent
a9d252f758
commit
9171b35025
1 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
use crossterm::event::{poll, read, Event, KeyCode};
|
||||
use crossterm::terminal::enable_raw_mode;
|
||||
use crossterm::terminal::{disable_raw_mode, enable_raw_mode};
|
||||
use std::time::Duration;
|
||||
|
||||
/// InputModule retrieves the keys from the hardware or software input control module.
|
||||
|
@ -89,3 +89,9 @@ impl InputModule for CrossTermInput {
|
|||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for CrossTermInput {
|
||||
fn drop(&mut self) {
|
||||
disable_raw_mode().expect("failed to disable terminal raw mode.");
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue