-
Notifications
You must be signed in to change notification settings - Fork 20.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strip extraneous carriage return from end of entered password #2371
Conversation
Current coverage is
|
👍 |
@@ -92,6 +92,7 @@ func PromptPassword(prompt string, warnTerm bool) (string, error) { | |||
} | |||
fmt.Print(prompt) | |||
input, err := bufio.NewReader(os.Stdin).ReadString('\n') | |||
input = strings.TrimRight(input, "\r\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The \r is weird. Why is it required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this to be necessary for Windows.
👍 |
@hiddentao please fix your commit message like:
|
90aa0a1
to
6f30034
Compare
@obscuren commit msg updated. |
Cheers! |
This is a repeat of #2369 but against the
develop
branch.The fix has been tested to work on OS X, Ubuntu and Windows.