8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b42421 commit 947e10eCopy full SHA for 947e10e
fs/config/config_read_password.go
@@ -16,7 +16,11 @@ import (
16
17
// ReadPassword reads a password without echoing it to the terminal.
18
func ReadPassword() string {
19
- line, err := terminal.ReadPassword(int(os.Stdin.Fd()))
+ stdin := int(os.Stdin.Fd())
20
+ if !terminal.IsTerminal(stdin) {
21
+ return ReadLine()
22
+ }
23
+ line, err := terminal.ReadPassword(stdin)
24
_, _ = fmt.Fprintln(os.Stderr)
25
if err != nil {
26
log.Fatalf("Failed to read password: %v", err)
0 commit comments