-
Notifications
You must be signed in to change notification settings - Fork 124
Open
Description
In trying to reproduce the apt progress bar I adapted https://github.com/gosuri/uiprogress/blob/ec0f254bbca2b17ed68f18af8773a0527b522f01/example/simple/simple.go so that some lines are printed:
package main
import (
"time"
"fmt"
"github.com/gosuri/uiprogress"
)
func main() {
uiprogress.Start() // start rendering
bar := uiprogress.AddBar(100) // Add a new bar
// optionally, append and prepend completion and elapsed time
bar.AppendCompleted()
bar.PrependElapsed()
i := 0
for bar.Incr() {
time.Sleep(time.Millisecond * 20)
i++
if i % 10 == 0 {
fmt.Println("Well hello there")
}
}
}I'd like for the lines to print above the progress bar, which would stay at the bottom. However I'm only getting duplicated progress and only one line printed (also not at the right place but I'm sure that's another issue):
0s [=====>--------------------------------------------------------------] 10%
0s [============>-------------------------------------------------------] 20%
0s [===================>------------------------------------------------] 30%
0s [==========================>-----------------------------------------] 40%
0s [=================================>----------------------------------] 50%
1s [========================================>---------------------------] 60%
1s [===============================================>--------------------] 70%
1s [======================================================>-------------] 80%
1s [=============================================================>------] 90%
1s [====================================================================] 100%
Well hello there
zoli, maximusfox, Wsyspringsun, jtyoui, kohenkatz and 2 more
Metadata
Metadata
Assignees
Labels
No labels