Open pdimens opened 1 month ago
Same issue here with progress bars + spinner. Seems to get worse as the system load increases.
Hi @pdimens and @cilki, could you please share a full sample code that causes the issue. It would be helpful to replicate and debug the issue.
I tried to do something similar as a toy example and the flutter only occurs when the console block is nested in a progress block:
#! /usr/bin/env python
from time import sleep
from rich.console import Console
from rich.progress import Progress
i = 0
with Progress() as progress:
console = Console()
with console.status("text text text", spinner = "point") as status:
while True:
sleep(2)
i += 1
if i >10:
break
same behavior if their blocks appear together:
i = 0
console = Console()
with Progress() as progress, console.status("text text text", spinner = "point") as status:
while True:
sleep(2)
i += 1
if i >10:
break
I tried to do something similar as a toy example and the flutter only occurs when the console block is nested in a progress block:
#! /usr/bin/env python from time import sleep from rich.console import Console from rich.progress import Progress i = 0 with Progress() as progress: console = Console() with console.status("text text text", spinner = "point") as status: while True: sleep(2) i += 1 if i >10: break
Confirmed this flickers for me too on Python 3.11/3.12 and rich 13.7.1 on Linux.
Thanks a lot @pdimens and @cilki, examples were helpful and I was able to replicate the issue.
Progress and Console status both animate the display and I suspect that they both interfere with each other's update cycle and should not be mixed together. However, I've yet to check the code base to confirm this.
Meanwhile, I was able to get similar functionality with use of either one if it helps.
#! /usr/bin/env python
from time import sleep
from rich.console import Console
i = 1
console = Console()
with console.status("console.status update ...", spinner="point") as status:
while True:
sleep(1)
i += 1
if i > 5:
break
#! /usr/bin/env python
from time import sleep
from rich.progress import Progress
i = 1
with Progress() as progress:
task = progress.add_task("[green]progress update ...", total=None)
while True:
sleep(1)
i += 1
if i > 5:
break
Describe the bug When using
console.status()
with awhile True
block inside it, the console text has a persistent flutter. Notably:Kooha-2024-08-13-10-32-13.webm
Minimal example
For context, this process is intercepting the output text of Snakemake (invoked with
subprocess.Popen()
)Platform Information
Click to expand
What platform (Win/Linux/Mac) are you running on? What terminal software are you using? Linux. Terminal via VScode and Konsole ``` ╭─────────────────────