-
Notifications
You must be signed in to change notification settings - Fork 137
Don't open /dev/tty twice #1344
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
Don't open /dev/tty twice #1344
Conversation
d5ec9d6 to
c169523
Compare
There is no need to do so and this refactor clarifies exactly when HiddenInput::new() returns Some. With this we no longer disable feedback on /dev/tty when we are reading a password from a pipe and we disable feedback on the correct tty if stdin is a different tty than /dev/tty. Once we implement askpass this also prevents interfering with the askpass program if it reads from the tty.
c169523 to
19d6db4
Compare
This is necessary for askpass as with askpass the prompt is passed to the askpass program rather than directly printed to stdout.
|
See my suggestions here: bjorn3#6 I think we are on the same page except that the |
7107f02 to
295d4f7
Compare
|
Sorry, didn't run |
squell
left a comment
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.
Fixing the tests is trivial, the rest looks good (it's nice that all the critical input path now goes through the same code paths)
There is no need to do so and this refactor clarifies exactly when HiddenInput::new() returns Some. With this we no longer disable feedback on /dev/tty when we are reading a password from a pipe and we disable feedback on the correct tty if stdin is a different tty than /dev/tty. Once we implement askpass this also prevents interfering with the askpass program if it reads from the tty.