mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
fs: Fix interaction between --progress and --interactive
Before this change if both --progress and --interactive were set then the screen display could become muddled. This change makes --progress and --interactive use the same lock so while rclone is asking for interactive questions, the progress will be paused. Fixes #6755
This commit is contained in:
@@ -75,14 +75,13 @@ func startProgress() func() {
|
||||
|
||||
// state for the progress printing
|
||||
var (
|
||||
nlines = 0 // number of lines in the previous stats block
|
||||
progressMu sync.Mutex
|
||||
nlines = 0 // number of lines in the previous stats block
|
||||
)
|
||||
|
||||
// printProgress prints the progress with an optional log
|
||||
func printProgress(logMessage string) {
|
||||
progressMu.Lock()
|
||||
defer progressMu.Unlock()
|
||||
operations.StdoutMutex.Lock()
|
||||
defer operations.StdoutMutex.Unlock()
|
||||
|
||||
var buf bytes.Buffer
|
||||
w, _ := terminal.GetSize()
|
||||
|
||||
Reference in New Issue
Block a user