summaryrefslogtreecommitdiff
path: root/src-repo/src/un_hide_input.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src-repo/src/un_hide_input.rs')
-rw-r--r--src-repo/src/un_hide_input.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src-repo/src/un_hide_input.rs b/src-repo/src/un_hide_input.rs
new file mode 100644
index 0000000..6350739
--- /dev/null
+++ b/src-repo/src/un_hide_input.rs
@@ -0,0 +1,9 @@
+use std::io;
+use termios::{ECHO, ICANON, TCSANOW, tcsetattr, Termios};
+
+pub fn un_hide_input() -> io::Result<()> {
+ let mut termios = Termios::from_fd(libc::STDIN_FILENO)?;
+ termios.c_lflag |= ECHO | ICANON;
+ tcsetattr(libc::STDIN_FILENO, TCSANOW, &termios)?;
+ Ok(())
+} \ No newline at end of file