From 13e68b4ed04132bdcac59e2607ec2aa251ad42d6 Mon Sep 17 00:00:00 2001 From: Timon Date: Wed, 29 Aug 2018 22:17:31 +0200 Subject: [PATCH 1/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b1863ba..280560f2 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. From 0578e940bf2b8689385427eaf001e5d12123bb7a Mon Sep 17 00:00:00 2001 From: Timon Date: Wed, 29 Aug 2018 22:19:10 +0200 Subject: [PATCH 2/5] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d5589317..ffc4a522 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" From 4d60ac91b371fb4d03dea044c04e5eaf0514c10d Mon Sep 17 00:00:00 2001 From: TimonPost Date: Wed, 29 Aug 2018 22:28:59 +0200 Subject: [PATCH 3/5] updated docs --- docs/ReleaseNotes.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index f3c9ec0c..63976f2e 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 From 0eba0e2056b44462f92c327df92140956ffda265 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Fri, 14 Sep 2018 17:08:21 -0700 Subject: [PATCH 4/5] Attempt to make `AnsiOutput` play nicer with `write!` --- src/modules/output/ansi_output.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/modules/output/ansi_output.rs b/src/modules/output/ansi_output.rs index 7f1a3e1a..33a71944 100644 --- a/src/modules/output/ansi_output.rs +++ b/src/modules/output/ansi_output.rs @@ -14,25 +14,23 @@ 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) + 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(()) + handle.flush() } fn as_any(&self) -> &Any { From e0b0e232ea112b893904835c3d1aedd9b776ca44 Mon Sep 17 00:00:00 2001 From: TimonPost Date: Sun, 16 Sep 2018 12:40:02 +0200 Subject: [PATCH 5/5] function was not good alligned and removed as_any() and as_any_mut() from output --- src/modules/output/ansi_output.rs | 10 +--------- src/modules/output/mod.rs | 3 --- src/modules/output/output.rs | 7 ------- src/modules/output/winapi_output.rs | 8 -------- 4 files changed, 1 insertion(+), 27 deletions(-) diff --git a/src/modules/output/ansi_output.rs b/src/modules/output/ansi_output.rs index 33a71944..13a9ee6b 100644 --- a/src/modules/output/ansi_output.rs +++ b/src/modules/output/ansi_output.rs @@ -13,7 +13,7 @@ pub struct AnsiOutput { } impl IStdout for AnsiOutput { - fn write_str(&self, string: &str) -> io::Result { + fn write_str(&self, string: &str) -> io::Result { let out = &self.handle; let mut handle = out.lock(); let amt = handle.write(string.as_bytes())?; @@ -32,14 +32,6 @@ impl IStdout for AnsiOutput { let mut handle = out.lock(); handle.flush() } - - fn as_any(&self) -> &Any { - self - } - - fn as_any_mut(&mut self) -> &mut Any { - self - } } impl AnsiOutput { diff --git a/src/modules/output/mod.rs b/src/modules/output/mod.rs index 9a8d7b2c..4e62d9fd 100644 --- a/src/modules/output/mod.rs +++ b/src/modules/output/mod.rs @@ -32,7 +32,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 57b81e9e..a839ac38 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 c139e777..c0e0ca86 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 {}