mirror of
https://github.com/restic/restic.git
synced 2025-12-11 18:21:54 +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:
|
||||
status = append(status[:0], stat.lines...)
|
||||
|
||||
if terminal.IsProcessBackground(t.fd) {
|
||||
// ignore all messages, do nothing, we are in the background process group
|
||||
continue
|
||||
}
|
||||
|
||||
status = status[:0]
|
||||
status = append(status, stat.lines...)
|
||||
t.writeStatus(status)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user