From 6100102df7032cbaa4ff07af35b4ca5bd3850d82 Mon Sep 17 00:00:00 2001 From: Roland Schaer Date: Mon, 26 Feb 2024 16:24:09 -0300 Subject: [PATCH] fix(input): do not reveal whitespace when masked (#42) --- src/input.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/input.rs b/src/input.rs index 6fd817a..b300bf0 100644 --- a/src/input.rs +++ b/src/input.rs @@ -192,6 +192,11 @@ impl<'a> Input<'a> { } fn handle_ctrl_w(&mut self) -> io::Result<()> { + // is masked, delete whole line to not reveal whitespace + if self.password { + self.handle_ctrl_u()?; + return Ok(()); + } let idx = self.get_char_idx(&self.input, self.cursor); let slice = &self.input[0..idx]; let offset = slice