You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used curl inside of a terminal with a large width (300) to download a file while displaying the loading bar. I tested in both macOS Terminal and iTerm.
I expected the following
The spaceship would be cleared after the file was downloaded, replaced by the full progress bar. The spaceship and progress bar will take up one line total. Instead I saw the following:
The progress bar is capped at a maximum length of 256 but the spaceship flies past that limit and isn't cleared.
When the progress bar was made max width (256 columns), the fly()
function attempted to generate its output buffer too long so that the
trailing carriage return would not fit and then the output would show
wrongly. The fly function is called when the expected total transfer is
unknown, which could be one or more progress calls before the actual
progress meter get shown when the expected transfer size is provided.
This new take also replaces the msnprintf() call with a much simpler
memset() for speed.
Reported-by: Tim Hill