From e3f4e8ff6b8c4793dfd1f92a27be6c53ecc19456 Mon Sep 17 00:00:00 2001 From: "Jason T. Greene" Date: Thu, 3 Feb 2022 16:49:18 -0600 Subject: [PATCH] Fix console password reading on Windows The windows handle is not on fd 0 (it's -10), so access through os.Stdin Signed-off-by: Jason T. Greene --- pkg/auth/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/auth/auth.go b/pkg/auth/auth.go index ff52b028e..af3c8f803 100644 --- a/pkg/auth/auth.go +++ b/pkg/auth/auth.go @@ -248,7 +248,7 @@ func getUserAndPass(opts *LoginOptions, password, userFromAuthFile string) (user } if password == "" { fmt.Fprint(opts.Stdout, "Password: ") - pass, err := terminal.ReadPassword(0) + pass, err := terminal.ReadPassword(int(os.Stdin.Fd())) if err != nil { return "", "", errors.Wrap(err, "reading password") }