From fb7961a37fdf824a048771c1384219f844d2ebc7 Mon Sep 17 00:00:00 2001 From: Fatih Arslan Date: Mon, 21 Jun 2021 15:20:38 +0300 Subject: [PATCH] printer: fix clearing the progress/spinner output Fore more information checkout: https://github.com/briandowns/spinner/pull/117#issuecomment-864986510 --- internal/printer/printer.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/printer/printer.go b/internal/printer/printer.go index 01fda883..60978398 100644 --- a/internal/printer/printer.go +++ b/internal/printer/printer.go @@ -133,6 +133,11 @@ func (p *Printer) PrintProgress(message string) func() { s.Start() return func() { s.Stop() + + // NOTE(fatih) the spinner library doesn't clear the line properly, + // hence remove it ourselves. This line should be removed once it's + // fixed in upstream. https://github.com/briandowns/spinner/pull/117 + fmt.Fprint(p.out(), "\r\033[2K") } }