peterh / liner

Pure Go line editor with history, inspired by linenoise
MIT License
1.04k stars 132 forks source link

Resizing the window reveals hidden values (passwords) #142

Closed ghost closed 3 years ago

ghost commented 3 years ago

Regardless the operating system, we noticed that liner library reveals hidden values when the screen gets too narrow for both the label and input space of a hidden variable.

The method func (s *State) tooNarrow(prompt string) (string, error)

calls func (s *State) promptUnsupported(p string) (string, error) which then calls linebuf, _, err := s.r.ReadLine() !!! When this happens a hidden value is not hidden anymore.

peterh commented 3 years ago

Thanks for the bug report. Should be fixed in master now.