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
Hi,
I'm using asyncio where two independent functions might add a progress bar at any time and they will progress independently.
Because of this, I can't use Progress in a context manager such that it destroys the object when the progress is done, instead I am initialising the object and passing it through to both functions at their initialisation.
I didn't want any leftover progress bars to remain, so I delete them on completion by calling remove_task.
I then ran into this problem, while the task is removed, either the space it occupied remains, or add_task automatically attempts to compensate for another progress bar that it thinks exists above it, and adds a newline.
The result is the same, as time goes on the progress bars descend further and further down, I've recorded a gif to demonstrate:
I've also put together the minimal code to recreate this:
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
Ubuntu 22.04, Gnome Terminal and the VSCodium / VSCode terminal.
A simple way to avoid this would be to move the with progress as progress_bar contextmanager to outside of the main while True loop. This avoids invoking the context manager multiple times. Here is a modified version of your minimal code snippet that works as you describe on my machine (WSL2):
Describe the bug
Hi,
I'm using asyncio where two independent functions might add a progress bar at any time and they will progress independently.
Because of this, I can't use Progress in a context manager such that it destroys the object when the progress is done, instead I am initialising the object and passing it through to both functions at their initialisation.
I didn't want any leftover progress bars to remain, so I delete them on completion by calling remove_task.
I then ran into this problem, while the task is removed, either the space it occupied remains, or add_task automatically attempts to compensate for another progress bar that it thinks exists above it, and adds a newline.
The result is the same, as time goes on the progress bars descend further and further down, I've recorded a gif to demonstrate:
I've also put together the minimal code to recreate this:
Platform
Click to expand
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
Ubuntu 22.04, Gnome Terminal and the VSCodium / VSCode terminal.
If you're using Rich in a terminal:
The text was updated successfully, but these errors were encountered: