zx icon indicating copy to clipboard operation
zx copied to clipboard

Feature request: hiding user input

Open RMEngels opened this issue 2 years ago • 2 comments

Hi!

The problem

When prompting a user for a sensitive piece of data you would not want that piece of data showing up in the terminal. In bash, you would do read -s PASSWORD.

Currently, the question() function does not support such a thing.

Proposed Solution

Give the option to hide the user input in the second argument (option object) of the question function.

await question($`Enter password:`, {
    hideInput: true,
}),

Any thoughts on this idea? I can propose a PR if this is functionality you'd like.

RMEngels avatar Oct 31 '23 12:10 RMEngels

I think this PR #526 addresses this.

phukon avatar Nov 19 '23 05:11 phukon

Thank you!

RMEngels avatar Nov 20 '23 12:11 RMEngels

Hmm could be me but this does not look completed? @antonmedv

RMEngels avatar Apr 22 '24 10:04 RMEngels

Looks like not_)

antonmedv avatar Apr 22 '24 10:04 antonmedv