Skip to content

Commit

Permalink
Merge pull request #115 from tankbusta/fix/secure_token_prompt_windows
Browse files Browse the repository at this point in the history
fix: use syscall.Stdin to use the correct handle based on platform
  • Loading branch information
SaaldjorMike authored Sep 30, 2022
2 parents d887c11 + 23bbe22 commit 5136477
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion prompt/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log"
"os"
"strings"
"syscall"

"golang.org/x/crypto/ssh/terminal"
)
Expand Down Expand Up @@ -58,7 +59,7 @@ func (p *Prompt) Confirm(text string) bool {

func (p *Prompt) AskSecret(question string) (string, error) {
p.Print(question + ": ")
bytes, err := terminal.ReadPassword(0)
bytes, err := terminal.ReadPassword(int(syscall.Stdin))

if err != nil {
return "", err
Expand Down

0 comments on commit 5136477

Please sign in to comment.