diff --git a/progressbar.go b/progressbar.go index 19e7200..62ad7a1 100644 --- a/progressbar.go +++ b/progressbar.go @@ -873,7 +873,7 @@ 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 - str := fmt.Sprintf("\r%s", strings.Repeat(" ", s.maxLineWidth)) + 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 // return writeString(c, "\r") diff --git a/progressbar_test.go b/progressbar_test.go index 653410a..eb8f0ec 100644 --- a/progressbar_test.go +++ b/progressbar_test.go @@ -606,7 +606,7 @@ func TestProgressBar_Describe(t *testing.T) { bar.Describe("performing axial adjustments") bar.Add(10) rawBuf := strconv.QuoteToASCII(buf.String()) - if rawBuf != `"\rperforming axial adjustments 0% | | [0s:0s]\r \rperforming axial adjustments 10% |\u2588 | [0s:0s]"` { + if rawBuf != `"\rperforming axial adjustments 0% | | [0s:0s]\r \r\rperforming axial adjustments 10% |\u2588 | [0s:0s]"` { t.Errorf("wrong string: %s", rawBuf) } }