Commit ce6b43d0 authored by Jeremy Soller's avatar Jeremy Soller

Merge branch 'suspend-raw' into 'master'

Add ability to suspend/activate raw mode on RawTerminal

See merge request !150
parents d2945cd3 b64b10f4
......@@ -101,6 +101,20 @@ impl<W: Write> IntoRawMode for W {
}
}
impl<W: Write> RawTerminal<W> {
pub fn suspend_raw_mode(&self) -> io::Result<()> {
set_terminal_attr(&self.prev_ios)?;
Ok(())
}
pub fn activate_raw_mode(&self) -> io::Result<()> {
let mut ios = get_terminal_attr()?;
raw_terminal_attr(&mut ios);
set_terminal_attr(&ios)?;
Ok(())
}
}
#[cfg(test)]
mod test {
use super::*;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment