mirror of
https://github.com/rclone/rclone.git
synced 2024-12-22 23:22:08 +01:00
terminal, log: rename TerminalOutput to RawOut
it was confusing to have a terminal.Out along with a TerminalOutput
This commit is contained in:
parent
0687a263f8
commit
cec47699d3
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user