Matthias1590 / ConsoleDraw

A python module to update the console without flashing.
MIT License
128 stars 3 forks source link

ANSI colour codes are broken #4

Open TabbyToffee opened 1 week ago

TabbyToffee commented 1 week ago

If you use an ANSI colour code, you will exceed the grid size before you reach the end of the console. Here is some example code:

from consoledraw import Console

console = Console()

printOut = ""

while True:
    with console:
        console.print(printOut)

    printOut += "\033[0;32;40mHello Goodbye  "

The code gives an error before it reaches the end of the screen: image

Matthias1590 commented 1 week ago

I think a good way to solve this would be to interpret ansi codes, but since not every terminal supports it, maybe it should be a flag in the console constructor