mirror of
https://github.com/restic/restic.git
synced 2025-12-12 03:22:07 +00:00
termstatus: track current status also in background
Without this, restic could temporarily print an outdated status when moving back into the foreground.
This commit is contained in:
@@ -142,13 +142,13 @@ func (t *Terminal) run(ctx context.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case stat := <-t.status:
|
case stat := <-t.status:
|
||||||
|
status = append(status[:0], stat.lines...)
|
||||||
|
|
||||||
if terminal.IsProcessBackground(t.fd) {
|
if terminal.IsProcessBackground(t.fd) {
|
||||||
// ignore all messages, do nothing, we are in the background process group
|
// ignore all messages, do nothing, we are in the background process group
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
status = status[:0]
|
|
||||||
status = append(status, stat.lines...)
|
|
||||||
t.writeStatus(status)
|
t.writeStatus(status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user