From 7aa0994b0fe8b9e032d79e2145852bc0cbfefcd0 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 18 Jan 2020 22:11:25 -0800 Subject: [PATCH] termwiz: lineedit: replace a println with render/flush The terminal may not be attached to stdout, so the println isn't appropriate. --- termwiz/src/lineedit/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/termwiz/src/lineedit/mod.rs b/termwiz/src/lineedit/mod.rs index 2c1622927..84aae0da3 100644 --- a/termwiz/src/lineedit/mod.rs +++ b/termwiz/src/lineedit/mod.rs @@ -186,7 +186,8 @@ impl LineEditor { self.terminal.set_raw_mode()?; let res = self.read_line_impl(host); self.terminal.set_cooked_mode()?; - println!(); + self.terminal.render(&[Change::Text("\r\n".to_string())])?; + self.terminal.flush()?; res }