diff --git a/Cargo.toml b/Cargo.toml index d558931..ffc4a52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "crossterm" -version = "0.4.0" +version = "0.4.1" authors = ["T. Post"] description = "An crossplatform terminal library for manipulating terminals." repository = "https://github.com/TimonPost/crossterm" diff --git a/README.md b/README.md index 5b1863b..280560f 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This crate supports all unix and windows terminals down to windows 7 (not all te ## Getting Started -This documentation is only for Crossterm version `0.4.0` if you have an older version of Crossterm I suggest you check the [Upgrade Manual](https://github.com/TimonPost/crossterm/blob/master/docs/UpgradeManual.md) for more information about how to upgrade to a newer version. +This documentation is only for Crossterm version `0.4.*` if you have an older version of Crossterm I suggest you check the [Upgrade Manual](https://github.com/TimonPost/crossterm/blob/master/docs/UpgradeManual.md) for more information about how to upgrade to a newer version. Also check out the [examples](https://github.com/TimonPost/crossterm/tree/master/examples) folders which detailed examples for all functionality of this crate. diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index f3c9ec0..63976f2 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -1,3 +1,6 @@ +# Bug fix crossterm to 0.4.1 +- Fixed resizing of ansi terminal with and height where in the wrong order. + # Features / Fixes in crossterm 0.4.0 - Input support (read_line, read_char, read_async, read_until_async) - Styling module improved diff --git a/src/modules/output/ansi_output.rs b/src/modules/output/ansi_output.rs index 7f1a3e1..13a9ee6 100644 --- a/src/modules/output/ansi_output.rs +++ b/src/modules/output/ansi_output.rs @@ -13,34 +13,24 @@ pub struct AnsiOutput { } impl IStdout for AnsiOutput { - fn write_str(&self, string: &str) -> io::Result { - let out = &self.handle; - let mut handle = out.lock(); - write!(handle, "{}", string)?; - handle.flush(); - Ok(0) + fn write_str(&self, string: &str) -> io::Result { + let out = &self.handle; + let mut handle = out.lock(); + let amt = handle.write(string.as_bytes())?; + handle.flush()?; + Ok(amt) } fn write(&self, buf: &[u8]) -> io::Result { let out = &self.handle; let mut handle = out.lock(); - handle.write(buf)?; - Ok(0) + handle.write(buf) } fn flush(&self) -> io::Result<()> { let out = &self.handle; let mut handle = out.lock(); - handle.flush(); - Ok(()) - } - - fn as_any(&self) -> &Any { - self - } - - fn as_any_mut(&mut self) -> &mut Any { - self + handle.flush() } } diff --git a/src/modules/output/mod.rs b/src/modules/output/mod.rs index 6f9d096..e0f6de1 100644 --- a/src/modules/output/mod.rs +++ b/src/modules/output/mod.rs @@ -33,7 +33,4 @@ trait IStdout { fn write(&self, buf: &[u8]) -> io::Result; /// Flush the current output. fn flush(&self) -> io::Result<()>; - - fn as_any(&self) -> &Any; - fn as_any_mut(&mut self) -> &mut Any; } diff --git a/src/modules/output/output.rs b/src/modules/output/output.rs index 57b81e9..a839ac3 100644 --- a/src/modules/output/output.rs +++ b/src/modules/output/output.rs @@ -67,13 +67,6 @@ impl TerminalOutput { pub fn write_buf(&self, buf: &[u8]) -> io::Result { self.stdout.write(buf) } - - pub fn as_any(&self) -> &Any { - self.stdout.as_any() - } - pub fn as_any_mut(&mut self) -> &mut Any { - self.stdout.as_any_mut() - } } impl Default for TerminalOutput diff --git a/src/modules/output/winapi_output.rs b/src/modules/output/winapi_output.rs index c139e77..c0e0ca8 100644 --- a/src/modules/output/winapi_output.rs +++ b/src/modules/output/winapi_output.rs @@ -33,14 +33,6 @@ impl IStdout for WinApiOutput { fn flush(&self) -> io::Result<()> { Ok(()) } - - fn as_any(&self) -> &Any { - self - } - - fn as_any_mut(&mut self) -> &mut Any { - self - } } unsafe impl Send for WinApiOutput {}