Skip to content

Commit

Permalink
Fix terminal.ReadPassword on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gesellix committed Apr 19, 2024
1 parent 0432c91 commit bab427b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"syscall"

"github.com/tobischo/gokeepasslib/v3"
"golang.org/x/crypto/ssh/terminal"
Expand All @@ -18,7 +19,7 @@ func readString(text string) (string, error) {

func readPassword(text string) (string, error) {
fmt.Print(text)
pw, err := terminal.ReadPassword(0)
pw, err := terminal.ReadPassword(int(syscall.Stdin))
if err != nil {
return "", fmt.Errorf("Failed to read password: '%s'", err)
}
Expand Down

0 comments on commit bab427b

Please sign in to comment.