schollz / progressbar

A really basic thread-safe progress bar for Golang applications

Home Page:https://pkg.go.dev/github.com/schollz/progressbar/v3?tab=doc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Progressbar pauses execution in Windows when clicked

n-i-x opened this issue · comments

commented

On Windows, if the Command Prompt window is clicked anywhere inside the window, the progressbar cannot refresh and seems to pause execution of the go program.

This is a pretty big problem as I'm using the lib for a very large download.

This happens with the default progressbar:

bar = progressbar.Default(int64(treeLen))

Is there a better option to use for Windows which does not have this behavior, or a way to make bar.Add(1) non-blocking (outside of doing it in a go routine)? As a workaround, I'm disabling the progressbar on Windows, but I'd really like to use it.

commented

Actually, I just discovered this is due to Windows Quick Edit mode in Command Prompt and there's no way to fix it.