-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
Describe the bug
The following code:
console = Console(record=True)
print("Before Capture started:")
console.print("[blue underline]Print 0")
with console.capture() as capture:
console.print("[blue underline]Print 1")
console.print("[blue underline]Print 2")
console.print("[blue underline]Print 3")
console.print("[blue underline]Print 4")
print("\nCaptured content:")
print(capture.get())
print("\nRecorded content:")
print(console.export_text())
Produces following output:
It seems that every print to capture adds previously printed content + new content.
I also wonder if the captured content should even go to the recording because it won't even go to console unless specifically printed there after capturing has been stopped.
Though, as it seems that captured content cannot be printed with console.print()
(control codes seems to becomes visible) so by using regular python print() would not put it in the recording either.
(Line print(capture.get())
replaced with console.print(capture.get())
)
Platform
Click to expand
Same with Win/Linux platforms.
Windows terminal: Cmd prompt, Windows Terminal.
Linux Terminal: Putty
Using Rich version 12.6.0
ssbarnea, ansibuddy, bristea and cidrblock