Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
"spaceship" progress bar breaks at >=150 columns #4849
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
both system and homebrew versions are affected:
Edit: Nevermind, it looks like it just ignores values that are too small, using
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:
When 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.
We 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