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:
Michael Eischer
2025-09-07 12:19:11 +02:00
parent 48cbbf9651
commit 0ab38faa2e

View File

@@ -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)
}
}