File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,13 @@ import (
66 "encoding/json"
77 "errors"
88 "fmt"
9- "syscall"
10-
11- "github.com/goccy/go-yaml"
12-
139 "log/slog"
1410 "os"
1511 "os/exec"
1612 "strings"
1713
14+ "github.com/goccy/go-yaml"
15+
1816 "github.com/fatih/color"
1917 "github.com/lmittmann/tint"
2018 "github.com/mattn/go-colorable"
@@ -182,13 +180,16 @@ func (p *Printer) PromptForEnter(prompt string) error {
182180func (p * Printer ) PromptForPassword (prompt string ) (string , error ) {
183181 p .Cmd .PrintErr (prompt )
184182 defer p .Outputln ("" )
185- if term .IsTerminal (syscall .Stdin ) {
186- bytePassword , err := term .ReadPassword (syscall .Stdin )
183+
184+ fd := int (os .Stdin .Fd ())
185+ if term .IsTerminal (fd ) {
186+ bytePassword , err := term .ReadPassword (fd )
187187 if err != nil {
188188 return "" , fmt .Errorf ("read password: %w" , err )
189189 }
190190 return string (bytePassword ), nil
191191 }
192+
192193 // Fallback for non-terminal environments
193194 reader := bufio .NewReader (p .Cmd .InOrStdin ())
194195 pw , err := reader .ReadString ('\n' )
You can’t perform that action at this time.
0 commit comments