Join GitHub today
Improve progress bar flickering. #6615
This attempts to reduce the amount of flickering primarily by reducing the number of times the progress bar is updated. The outline of changes:
This significantly improves the initial "fresh" updates, but I still see some flickering during normal updates. I wasn't able to figure out why. Logging to a file and doing screen captures I see cargo is printing the progress bar <1ms after it is cleared. I'm guessing that it's just bad timing where the terminal renders just before the progress bar is displayed, and it has to wait an entire rendering cycle until it gets displayed.
I tested on a variety of different terminals and OS's, but the more testing this can get the better.
This unfortunately adds some brittleness of carefully clearing the progress bar before printing new messages. I don't really see an easy way to make that better since there is such a wide variety of ways a
alexcrichton left a comment
This looks great to me, thanks! All those strategies sound spot on to me, and the code all looks great.
The only thing I'd wonder is if we could improve the situation with removing the need for
I suspect though that the form of auto-clearning like would be nice is actually pretty difficult to implement and not easy to set up. Perhaps worth giving it a small stab though? If it doesn't work out I'm fine with manual clearning and vigilant reviews