terminal: WriteTerminalTitle to terminal not stdout

The terminal title output should go to the same place as the rest of the
terminal output.  It's important _not_ to send it to stdout, where it
would get included with the main program output when redirected to a
file - for instance with the rclone cat command.
This commit is contained in:
Carl Edquist 2022-10-06 01:27:44 -05:00
parent 408d0c729b
commit 14534c573a

View File

@ -34,5 +34,5 @@ func ReadPassword(fd int) ([]byte, error) {
// WriteTerminalTitle writes a string to the terminal title // WriteTerminalTitle writes a string to the terminal title
func WriteTerminalTitle(title string) { func WriteTerminalTitle(title string) {
fmt.Printf(ChangeTitle + title + BEL) fmt.Fprintf(TerminalOutput, ChangeTitle + title + BEL)
} }