diff --git a/fs/config/ui.go b/fs/config/ui.go index 8e55c1ee4..6e4d3908a 100644 --- a/fs/config/ui.go +++ b/fs/config/ui.go @@ -716,9 +716,9 @@ func checkPassword(password string) (string, error) { // GetPassword asks the user for a password with the prompt given. func GetPassword(prompt string) string { - _, _ = fmt.Fprintln(terminal.PasswordPromptOutput, prompt) + _, _ = fmt.Fprintln(terminal.TerminalOutput, prompt) for { - _, _ = fmt.Fprint(terminal.PasswordPromptOutput, "password:") + _, _ = fmt.Fprint(terminal.TerminalOutput, "password:") password := ReadPassword() password, err := checkPassword(password) if err == nil { diff --git a/fs/log/redirect_stderr_unix.go b/fs/log/redirect_stderr_unix.go index 5e3b66cd6..5d6808ee3 100644 --- a/fs/log/redirect_stderr_unix.go +++ b/fs/log/redirect_stderr_unix.go @@ -19,7 +19,7 @@ func redirectStderr(f *os.File) { if err != nil { log.Fatalf("Failed to duplicate stderr: %v", err) } - terminal.PasswordPromptOutput = os.NewFile(uintptr(passPromptFd), "passPrompt") + terminal.TerminalOutput = os.NewFile(uintptr(passPromptFd), "passPrompt") err = unix.Dup2(int(f.Fd()), int(os.Stderr.Fd())) if err != nil { log.Fatalf("Failed to redirect stderr to file: %v", err) diff --git a/lib/terminal/terminal.go b/lib/terminal/terminal.go index 09b05ec59..619976529 100644 --- a/lib/terminal/terminal.go +++ b/lib/terminal/terminal.go @@ -69,14 +69,14 @@ var ( // make sure that start is only called once once sync.Once - // PasswordPromptOutput is output of prompt for password - PasswordPromptOutput = os.Stderr + // TerminalOutput is for password prompt progress output + TerminalOutput = os.Stderr ) // Start the terminal - must be called before use func Start() { once.Do(func() { - f := PasswordPromptOutput + f := TerminalOutput if !IsTerminal(int(f.Fd())) { // If output is not a tty then remove escape codes Out = colorable.NewNonColorable(f)