mirror of
https://github.com/rclone/rclone.git
synced 2025-07-11 14:30:44 +02:00
cmd: add --progress-terminal-title to print ETA to terminal title
Adds a flag, --progress-terminal-title, that when used with --progress, will print the string `ETA: %s` to the terminal title. This also adds WriteTerminalTitle to lib/terminal
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
package terminal
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
@ -29,3 +30,8 @@ func IsTerminal(fd int) bool {
|
||||
func ReadPassword(fd int) ([]byte, error) {
|
||||
return terminal.ReadPassword(fd)
|
||||
}
|
||||
|
||||
// WriteTerminalTitle writes a string to the terminal title
|
||||
func WriteTerminalTitle(title string) {
|
||||
fmt.Printf(ChangeTitle + title + BEL)
|
||||
}
|
||||
|
Reference in New Issue
Block a user