promptui icon indicating copy to clipboard operation
promptui copied to clipboard

Provide a 'true' password prompt by hiding the amount of characters entered

Open hierynomus opened this issue 3 years ago • 2 comments

By default when only providing a Prompt.Mask character, it is impossible to hide the amount of characters entered as you cannot enter either an '' (empty rune), or the 0 (null terminator).

The most backwards compatible way to fix this is by introducing a new Prompt.Password bool field that when set, defaults the Prompt.Mask to the 0, allowing promptui to completely hide the text entered, as is common in password prompts on the terminal.

hierynomus avatar Oct 22 '20 09:10 hierynomus

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 22 '20 09:10 CLAassistant

Any chance of getting this included in a next release? Anything that needs working on?

hierynomus avatar Mar 28 '22 10:03 hierynomus

It looks like this behavior can be achieved by setting prompt.Mask to a space ( ) character. See #133

szh avatar Sep 29 '22 13:09 szh

Correct, never noticed that!. Thanks

hierynomus avatar Oct 05 '22 08:10 hierynomus