survey
survey copied to clipboard
Password input without revealing password length
Hello, I'd link to render "", instead of "*" for the password input: similar to what linux does with pretty much every password input (aka invisible password input)
Hello, thank you for the valid feature request! Right now, it doesn't seem that the Password input prompt allows modifying how the entered password is displayed. If, for example, the *
replacement character was configurable, it could be configured using an empty string instead. Contributions to add this functionality are welcome.
In the meantime, I suggest that you make your own password prompt. You can use this package instead of Survey: https://pkg.go.dev/golang.org/x/term#ReadPassword
This can now be accomplished by setting the HideCharacter
to a zero-width space
I tried this today and the cursor moves ahead which still reveals the password length.
@szh Thanks for reporting. Sounds like the visual representation is likely going to vary between terminal emulators. You are welcome to open a new issue about that 👍
OK. I'll submit a PR for this.