Skip to content

Commit 655d41e

Browse files
authored
Merge pull request #220 from mengshengwu/fix-windows-progressbar-flickering
fix: flickering on powershell
2 parents 533e284 + 7594c51 commit 655d41e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

progressbar.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"net/http"
1111
"os"
1212
"regexp"
13+
"runtime"
1314
"strings"
1415
"sync"
1516
"time"
@@ -1380,6 +1381,9 @@ func clearProgressBar(c config, s state) error {
13801381
// fill the empty content
13811382
// to overwrite the progress bar and jump
13821383
// back to the beginning of the line
1384+
if runtime.GOOS == "windows" {
1385+
return writeString(c, "\r")
1386+
}
13831387
str := fmt.Sprintf("\r%s\r", strings.Repeat(" ", s.maxLineWidth))
13841388
return writeString(c, str)
13851389
// the following does not show correctly if the previous line is longer than subsequent line

0 commit comments

Comments
 (0)