Multiple progress bars at once
Or would this unfortunately fall under #6 and multi-line in-compatibility?
Yes, unless you know a way of doing it that works in Windows? That would be great!
Just for anyone who is thinking about implementing this, you can do this easily in a OS agnostic way. Store the bars in a slice and loop over them at render time.
But for the display I was more thinking
80% |████████████████████████████████ | [1s:0s]
25% |███████████ | [1s:0s]
which requires multiple line functionality. Would this still be possible with slices?
The program rclone is able to achieve multi line overwrites and is cross platform. The applicable code is here https://github.com/ncw/rclone/blob/master/cmd/progress.go#L73. I'm unsure at this time how transferable the code would be to progressbar.
Another example, last one, this is docker pull
This looks like https://github.com/gosuri/uiprogress but it's kind of hard to use.
That would be a cool feature
Hi all. I'm not going to personally implement this - I've never had a reason to use multiple bars. But I will accept any PR that does implement this.
I made a simple, i mean a really simple, multi progressbar using a wrapper.
Of course you can only use one io.Writer for all bars, makes sense though and i only tested it with os.Stdout.
There are better solutions, but this one was fast and covers my use case.
Feel free to adapt.
https://gist.github.com/IceflowRE/e4c2b9163a697105a3e72f35f0cd12a5
https://github.com/IceflowRE/go-multiprogressbar
You can try it out! Maybe this will encourage others to give some thoughts. (Also this does not mean, iam not interested in putting this feature into this library, just that i do not know if this would be the right way and the quality is not as high as it should be.)
There's another package that supports multiple bars: https://github.com/jedib0t/go-pretty/tree/main/progress. It's a bit more code to use, I prefer schollz approach
There's another package that supports multiple bars: https://github.com/jedib0t/go-pretty/tree/main/progress. It's a bit more code to use, I prefer schollz approach
Well thats why my package exists, not sure if you saw that, each bar of the multiple one is a schollz bar.
@IceflowRE thanks for your contribution 👍 Is there a reason that it is a separate package and not a PR? Try to understand if there are any downsides or something missing. 🙌
@IceflowRE thanks for your contribution 👍 Is there a reason that it is a separate package and not a PR? Try to understand if there are any downsides or something missing. 🙌
Its working for my simple use cases (using stdout), but never tested or tried to solve other cases. Also i did not wrote tests. Personally i would expect from a PR a bit more than that tbh.