summaryrefslogtreecommitdiff
path: root/src/watch/state.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-05-13 02:20:04 +0200
committermo8it <mo8it@proton.me>2024-05-13 02:20:04 +0200
commit052573904604896398a6cc7281398fa9fdf8f083 (patch)
treeb7938cc434609ca534203ca7b275ec3b6c8b0a98 /src/watch/state.rs
parent11fda5d70f568e0f528d91dd573447719abe05f4 (diff)
Fix invisible input on Windows
Diffstat (limited to 'src/watch/state.rs')
-rw-r--r--src/watch/state.rs13
1 files changed, 5 insertions, 8 deletions
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()
}
}