Skip to content
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

Open
Hades32 opened this issue Sep 30, 2019 · 3 comments

Comments

@Hades32
Copy link

@Hades32 Hades32 commented Sep 30, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12.5 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\mrausc\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\mrausc\go
set GOPROXY=
set GORACE=
set GOROOT=C:\MyProgs\Go
set GOTMPDIR=
set GOTOOLDIR=C:\MyProgs\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=X:\swda\play\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\mrausc\AppData\Local\Temp\go-build325358090=/tmp/go-build -gno-record-gcc-switches

What did you do?

func main() {
	_, err := terminal.ReadPassword(int(os.Stdin.Fd()))
	fmt.Println(err)
}

What did you expect to see?

no echo of password

What did you see instead?

"The handle is invalid."

@gopherbot gopherbot added this to the Unreleased milestone Sep 30, 2019
@bcmills

This comment has been minimized.

Copy link
Member

@bcmills bcmills commented Sep 30, 2019

@Or-Gabay

This comment has been minimized.

Copy link

@Or-Gabay Or-Gabay commented Oct 27, 2019

I got the same issue.

@mattn

This comment has been minimized.

Copy link
Member

@mattn mattn commented Nov 10, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.