Closed JMLX42 closed 5 years ago
@promethe42 Hello and thanks for your question. I do not use Windows and thus do not really know how well the crate works on Windows. Unfortunately, I do not have time to invest in testing the crate properly for Windows at the current time.
If @equalsraf or @retep998 happen to have time, they may be able to help.
If you work out the problem, I'm happy to review/test/merge a PR.
This crate disables ENABLE_ECHO_INPUT
so that the password is not printed to the console, but this also prevents the enter key from being printed resulting in no newline. You'd have to manually print out a newline after inputting the password.
This crate disables ENABLE_ECHO_INPUT so that the password is not printed to the console, but this also prevents the enter key from being printed resulting in no newline.
Not on Linux. Which is kinda the whole issue here. I expect the behavior to be the same on both platforms and not have to do this kind of dirty tricks:
https://github.com/aerys/gpm/blob/master/src/gpm/ssh.rs#L183
By "you" I meant rpassword
, so rpassword
would have to manually print out the newline on Windows.
@promethe42 Would you be open to opening a pull request for this change ?
@retep998 Thanks for your help ! :+1:
@conradkdotcom any hint as of where is the code I should fix? Any help appreciated.
@promethe42 Sure ! You could probably print a newline on line 225 of lib.rs
:
https://github.com/conradkdotcom/rpassword/blob/master/src/lib.rs#L225
@promethe42 Give it a try and let me know if it works out :slightly_smiling_face:
Just came across this as we were having a similar issue (using two rpassword
inputs one after another).
https://github.com/conradkdotcom/rpassword/pull/33
Implements the fix you suggested @conradkdotcom, and we tested it on windows/osx and it's looking good 👍
Awesome, thanks @joshuef !
Hi,
I'm using rpassword in a cross-platform CLI app.
I have an issue on Windows: after pressing "enter" to validate the password, there is no new line added to the terminal.
The behavior is different on Llinux:
Here is my code:
Am I doing something wrong?