这是indexloc提供的服务,不要输入任何密码
Skip to content

example/simple: progress bar scrolls terminal #16

@sbinet

Description

@sbinet

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions