From 052573904604896398a6cc7281398fa9fdf8f083 Mon Sep 17 00:00:00 2001 From: mo8it Date: Mon, 13 May 2024 02:20:04 +0200 Subject: Fix invisible input on Windows --- src/watch/state.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/watch/state.rs') diff --git a/src/watch/state.rs b/src/watch/state.rs index 2cf7521..f3ffac8 100644 --- a/src/watch/state.rs +++ b/src/watch/state.rs @@ -166,14 +166,11 @@ When you are done experimenting, enter `n` (or `next`) to move on to the next ex self.render() } - pub fn handle_invalid_cmd(&mut self, cmd: &str) -> io::Result<()> { - self.writer.write_all(b"Invalid command: ")?; - self.writer.write_all(cmd.as_bytes())?; - if cmd.len() > 1 { - self.writer - .write_all(b" (confusing input can occur after resizing the terminal)")?; - } - self.writer.write_all(b"\n")?; + pub fn handle_invalid_input(&mut self, input: char) -> io::Result<()> { + writeln!( + self.writer, + "Invalid input: {input} (confusing input can occur after resizing the terminal)", + )?; self.show_prompt() } } -- cgit v1.2.3