aboutsummaryrefslogtreecommitdiffstats
path: root/src/raw.rs
diff options
context:
space:
mode:
authorJonas Maier <>2026-03-05 08:45:45 +0100
committerJonas Maier <>2026-03-05 08:45:45 +0100
commit9e617dde12565ba4e0ec737893b204a5e5271689 (patch)
tree69ed1d0fb097e5df0101871904f7fefc4519adf2 /src/raw.rs
parentdb1d0bb7c37e2c2943fe0fd8b6857110fdd00087 (diff)
downloadpish-9e617dde12565ba4e0ec737893b204a5e5271689.tar.gz
some parsing, also add panic that does not spill
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();
}
}