Skip to content

Commit

Permalink
printer: fix clearing the progress/spinner output
Browse files Browse the repository at this point in the history
Fore more information checkout:
briandowns/spinner#117 (comment)
  • Loading branch information
fatih committed Jun 21, 2021
1 parent b3f5649 commit fb7961a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/printer/printer.go
Expand Up @@ -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")
}
}

Expand Down

0 comments on commit fb7961a

Please sign in to comment.