diff --git a/progressbar.go b/progressbar.go index 125290a..b8f66da 100644 --- a/progressbar.go +++ b/progressbar.go @@ -10,6 +10,7 @@ import ( "net/http" "os" "regexp" + "runtime" "strings" "sync" "time" @@ -1373,6 +1374,9 @@ func clearProgressBar(c config, s state) error { // fill the empty content // to overwrite the progress bar and jump // back to the beginning of the line + if runtime.GOOS == "windows" { + return writeString(c, "\r") + } str := fmt.Sprintf("\r%s\r", strings.Repeat(" ", s.maxLineWidth)) return writeString(c, str) // the following does not show correctly if the previous line is longer than subsequent line