rich icon indicating copy to clipboard operation
rich copied to clipboard

[BUG]'Alternate screen' on windows 7-10 does not clear after completio (RE)

Open snooppr opened this issue 2 years ago • 0 comments

import time
from rich.console import Console

console = Console()

print("Great_Rich")

with console.screen():
    console.print("Banner")
    time.sleep(2)

for i in "Text":
    time.sleep(0.04)
    print(f"\033[31;1m{i}", end='', flush=True)
print("\n\n exit")

screen windows 10 https://user-images.githubusercontent.com/61022210/158059480-7fb9b0d6-0ae0-4af8-aefb-1313bdf142b4.png

I also compiled this source into an .exe, which is on the screen and in the code

I tested this on Windows 10 and Windows 7. In both cases, the terminal was not cleared (the word "Banner" remained in the terminal). That is, in Windows, the alternative terminal works like a simple "print". On GNU/Linux everything works and is in perfect order, please check it out.

p.s. This project here works as an alternative screen on Windows 7 and Windows 10 (the text is cleared after itself).

snooppr avatar Mar 18 '22 03:03 snooppr