aboutsummaryrefslogtreecommitdiffstats
path: root/src/raw.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/raw.rs')
-rw-r--r--src/raw.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/raw.rs b/src/raw.rs
index e116620..db2d269 100644
--- a/src/raw.rs
+++ b/src/raw.rs
@@ -1,5 +1,7 @@
use termios::*;
+use crate::panic;
+
/// can toggle raw mode on a fd, at the latest disables it when it gets dropped
pub struct ScopedRawMode {
fd: i32,
@@ -22,9 +24,11 @@ impl ScopedRawMode {
let mut settings = self.settings.clone();
cfmakeraw(&mut settings);
tcsetattr(self.fd, TCSANOW, &settings).unwrap();
+ panic::enable_cr();
}
pub fn disable(&self) {
tcsetattr(self.fd, TCSANOW, &self.settings).unwrap();
+ panic::disable_cr();
}
}