gosuri / uiprogress

A go library to render progress bars in terminal applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

example/simple: progress bar scrolls terminal

sbinet opened this issue · comments

hi,

looking at #3 and event after specifying the bar.Width to, say, 60:

$> git diff
diff --git a/example/simple/simple.go b/example/simple/simple.go
index d8d912b..2af47af 100644
--- a/example/simple/simple.go
+++ b/example/simple/simple.go
@@ -9,6 +9,7 @@ import (
 func main() {
        uiprogress.Start()            // start rendering
        bar := uiprogress.AddBar(100) // Add a new bar
+       bar.Width = 60

        // optionally, append and prepend completion and elapsed time
        bar.AppendCompleted()

I still get:

$> go run ./simple.go
    0 [----------------------------------------------------------]   1%
    0 [----------------------------------------------------------]   2%
    0 [----------------------------------------------------------]   2%
[...]
   1s [=========================================================>]  99%
   1s [=========================================================>]  99%
   1s [==========================================================] 100%
   1s [==========================================================] 100%

my terminal is rxvt:

$> echo $TERM
rxvt-unicode-256color

(but even with TERM=vt100, I get the above behaviour)

is there something I am doing wrong?

Same as issue #3. I observed is if the terminal window is wide, this error does not occur.