From 75b28bab55d1393cad8cdf5cc6bedc1710bbda0f Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 8 Jun 2017 18:47:12 -0600 Subject: [PATCH] Fix raw mode on Redox --- src/raw.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/raw.rs b/src/raw.rs index 14cc87c..bd9c8ec 100644 --- a/src/raw.rs +++ b/src/raw.rs @@ -40,7 +40,8 @@ pub struct RawTerminal { #[cfg(target_os = "redox")] impl Drop for RawTerminal { fn drop(&mut self) { - write!(self, csi!("?82l")).unwrap(); + let _ = write!(self, csi!("?82l")); + let _ = self.flush(); } } @@ -129,7 +130,9 @@ impl IntoRawMode for W { #[cfg(target_os = "redox")] fn into_raw_mode(mut self) -> io::Result> { - write!(self, csi!("?82h")).map(|_| RawTerminal { output: self }) + write!(self, csi!("?82h"))?; + self.flush()?; + Ok(RawTerminal { output: self }) } }