diff --git a/fs/log/redirect_stderr_unix.go b/fs/log/redirect_stderr_unix.go index 5d6808ee3..4737f25e7 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.TerminalOutput = os.NewFile(uintptr(passPromptFd), "passPrompt") + terminal.RawOut = 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 619976529..b10835915 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 - // TerminalOutput is for password prompt progress output - TerminalOutput = os.Stderr + // RawOut is the underlying *os.File intended for terminal output + RawOut = os.Stderr ) // Start the terminal - must be called before use func Start() { once.Do(func() { - f := TerminalOutput + f := RawOut if !IsTerminal(int(f.Fd())) { // If output is not a tty then remove escape codes Out = colorable.NewNonColorable(f)