jupyter/qtconsole

QtConsole incompatible with `Textualize/rich` Live Table

ma-sadeghi opened this issue · 1 comments

I'm copying from an Issue I opened up in Spyder's issue tracker (spyder-ide/spyder#17810), which seems to be more relevant to qtconsole:

The following snippet is supposed to generate a table that gets dynamically updated (new row being added every 0.4 seconds). However, Spyder's IPython console prints out a new table every 0.4 seconds, whereas in a regular IPython console or in terminal, the table is only rendered once, but updated every 0.4 seconds.

import time

from rich.live import Live
from rich.table import Table

table = Table()
table.add_column("Row ID")
table.add_column("Description")
table.add_column("Level")

with Live(table, refresh_per_second=4):  # update 4 times a second to feel fluid
    for row in range(12):
        time.sleep(0.4)  # arbitrary delay
        # update the renderable internally
        table.add_row(f"{row}", f"description {row}", "[red]ERROR")

Regular IPython

IPython

Spyder's IPython

Spyder

Note: I didn't include the gif for a pure QtConsole, but it's the same as Spyder (table not being updated properly, instead it rerenders).

Hey @ma-sadeghi, thanks for reporting. I'm almost sure that this is due to issue #350 (i.e. Qtconsole not support ANSI characters for remove characters and lines), so I'm going to close this one as a duplicate of that.