-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/crypto/ssh/terminal: terminal.ReadPassword doesn't work when using Bash for Windows (from Git installation) #34612
Comments
I got the same issue. |
Do you use third-party terminal application? If you use mintty, an application which use Windows Console APIs does not work. you must use winpty to run the application. |
We are facing the same issue but found out something slightly odd. First, we use the new We face the same issue as described in this issue in Git Bash. The code is here: https://github.com/Scalingo/cli/blob/master/term/password.go#L13 But if we run Git Bash from within the terminal tab of VS Code, we no longer face the same issue, everything works as expected. Does anyone know what is the difference between Git Bash and Git Bash inside VS Code? |
I can't reproduce this. Windows 11 21H2 64Bit amd64. |
I uploaded the smallest example which reproduces the issue here: https://github.com/EtienneM/mwe_read_password/blob/master/main.go I'm not exactly sure about what information may be needed. My OS version:
The Go version:
The
With this example, in Git Bash in VS Code I can type a password and the output is:
In Git Bash outside of VS Code, I can't type the password and immediately get the error:
|
I hit this problem as well. Run on mingw64 shell - If I run on windows cmd then it works. It is both on window 8 and windows 10 at my work place. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
no echo of password
What did you see instead?
"The handle is invalid."
The text was updated successfully, but these errors were encountered: