From 0687a263f88727f6988c11a202219e5f9fd09c29 Mon Sep 17 00:00:00 2001 From: Carl Edquist Date: Thu, 6 Oct 2022 16:41:26 -0500 Subject: [PATCH] config, terminal: use Out rather than TerminalOut where possible We're going to try to avoid TerminalOut except for redirectStderr, which overrides that var with a duped copy of stderr. --- fs/config/ui.go | 4 ++-- lib/terminal/terminal_normal.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/config/ui.go b/fs/config/ui.go index 6e4d3908a..e32c2e9b1 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.TerminalOutput, prompt) + _, _ = fmt.Fprintln(terminal.Out, prompt) for { - _, _ = fmt.Fprint(terminal.TerminalOutput, "password:") + _, _ = fmt.Fprint(terminal.Out, "password:") password := ReadPassword() password, err := checkPassword(password) if err == nil { diff --git a/lib/terminal/terminal_normal.go b/lib/terminal/terminal_normal.go index 6bec79c9c..e522cefa8 100644 --- a/lib/terminal/terminal_normal.go +++ b/lib/terminal/terminal_normal.go @@ -34,5 +34,5 @@ func ReadPassword(fd int) ([]byte, error) { // WriteTerminalTitle writes a string to the terminal title func WriteTerminalTitle(title string) { - fmt.Fprintf(TerminalOutput, ChangeTitle + title + BEL) + fmt.Fprintf(Out, ChangeTitle + title + BEL) }