-
-
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
"spaceship" progress bar breaks at >=150 columns #4849
Comments
Edit: Nevermind, it looks like it just ignores values that are too small, using |
Have you changed your column size while curl was running? |
No, it was changed inbetween invocations and static while curl was running. |
I also have the issue when I change the window size I don't see any problems with 150 |
I can't spot anything in the code that has any particular width restriction below 256. 256 is the widest the code will go. Is there's a chance your terminal does something odd? |
It's possible, but I tested it in iTerm as well as Apple Terminal with the same behavior, as well as with my personal bashrc disabled. |
Just tried it in WSL Ubuntu and it's broken with 120 columns:
|
Manually setting the columns to 1 less than the actual width fixes it:
Proof that there are actually 120 columns in my terminal, the following doesn't wrap:
|
After some more investigation: Ubuntu WSL seems to break at 120 columns, but not at 119 or 121 columns, consistently. It also seems to break >140 columns. |
I can reproduce it at 120. It's a math precision error. PR is pending... |
the problemWhen the full width is 120. We use The sinus table has a max value of 9999. We divide 9999 with 9999 / 84 == 119, which is larger than the 118 which is supposed to be the maximum. This happens because we loose precision in fixed-point math. the fixWe can fix this issue by increasing the precision in the formula. We make the sinus values multiplied with another 100 and we divide with a larger number. Now the largest sinus value is 999999 and we divide it with 999999 / 8474 == 118. |
The fixed-point math made us lose precision and thus a too high index value could be used for outputting the hashtags which could overwrite the newline. The fix increases the precision in the sinus table and position math. Reported-by: Andrew Potter Fixes #4849
Thanks! I had a hunch it was something like that but I couldn't quite understand the code enough to figure it out. I'll update our scripts to just set the width to |
I did this
I expected the following
Using the progress bar with a 149-column terminal works just fine, increasing the terminal size to anything 150 columns and over (tested up to 172) goes 💥 when the hashes hit the side of the "screen"
curl/libcurl version
both system and homebrew versions are affected:
operating system
OSX Catalina
The text was updated successfully, but these errors were encountered: