diff --git a/internal/ui/restore/progress.go b/internal/ui/restore/progress.go index fb3d5ad02..575c7e27d 100644 --- a/internal/ui/restore/progress.go +++ b/internal/ui/restore/progress.go @@ -131,11 +131,11 @@ func (p *Progress) ReportDeletion(name string) { return } - p.s.FilesDeleted++ - p.m.Lock() defer p.m.Unlock() + p.s.FilesDeleted++ + p.printer.CompleteItem(ActionDeleted, name, 0) } diff --git a/internal/ui/termstatus/status.go b/internal/ui/termstatus/status.go index 46357eca3..6f5f744e0 100644 --- a/internal/ui/termstatus/status.go +++ b/internal/ui/termstatus/status.go @@ -394,15 +394,16 @@ func (t *Terminal) Error(line string) { } func sanitizeLines(lines []string, width int) []string { + sanitized := make([]string, len(lines)) // Sanitize lines and truncate them if they're too long. for i, line := range lines { line = ui.Quote(line) if width > 0 { line = ui.Truncate(line, width-2) } - lines[i] = line + sanitized[i] = line } - return lines + return sanitized } // SetStatus updates the status lines. @@ -419,7 +420,7 @@ func (t *Terminal) SetStatus(lines []string) { } } - sanitizeLines(lines, width) + lines = sanitizeLines(lines, width) select { case t.status <- status{lines: lines}: