Skip to content

Commit

Permalink
fix(input): do not reveal whitespace when masked (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
roele authored Feb 26, 2024
1 parent 6461af6 commit 6100102
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6100102

Please sign in to comment.