-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
curl: progress bar refresh #2242
Conversation
... also attempts to get the terminal width properly first using ioctl() now. The "-=O=-" ship moves when data is transferred. The four flying "hashes" move on each refresh, independent of data.
buf[pos] = '#'; | ||
|
||
fputs(buf, stderr); | ||
bar->tick += 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is the check on tick it seems like this could result in signed overflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I'll add a:
if(bar->tick >= 200)
bar->tick -= 200;
The programmatic way of getting the terminal width of course makes it annoying to test (since it'll vary depending on width), since I put the environment variable use as a backup instead of the other way around... Test 1148 for example. Should I instead allow the presence of a |
... and make the test suite set fixed 79 columns.
I decided to reverse the order. Now the |
Again the macos builds never start so I've killed them. The other builds seem pleased now. |
Supposedly it was resolved (again) at some point on the 19th. https://www.traviscistatus.com/incidents/mc9x2wmpnvhg |
Get screen width from the environment variable COLUMNS first, if set. If not, use ioctl(). If nether works, assume 79. Closes curl#2242 The "refresh" is for the -# output when no total transfer size is known. It will now only use a single updated line even for this case: The "-=O=-" ship moves when data is transferred. The four flying "hashes" move (on a sine wave) on each refresh, independent of data.
It looks like the manpage is wrong now:
Not sure if that is just me, but I would personally prefer the old output style over this one but it does not look like it's configurable. |
... since commit 993dd56 Reported-by: Martin Dreher Bug: #2242 (comment) Closes #2271
... for when the total transfer size is unknown.
Also attempts to get the terminal width properly first using ioctl() now.
The
-=O=-
"ship" moves when data is transferred. The four flying "hashes" move on each refresh, independent of data.Demo video: https://youtu.be/8QnL9-5Nl9g