Textualize / rich

Rich is a Python library for rich text and beautiful formatting in the terminal.
https://rich.readthedocs.io/en/latest/
MIT License
48.13k stars 1.69k forks source link

Behaviour of rich.progress on not terminated lines. #3316

Open ml31415 opened 3 months ago

ml31415 commented 3 months ago

I have pytest running with pytest-sugar. For a couple of long running tests I'd like to use progress bars. Unfortunately, pytest-sugar doesn't terminate the lines, in order to keep adding to the same line. When the progress bar starts, the last line is overwritten. See the following code for a demonstrator. Is there some better way, to detect if the last line in the terminal is not terminated, so that the bar would start in its own line, while pytest output keeps untouched?

from rich.progress import track
print("unterminated line", end="")  # this line gets overwritten in the output
list(track(range(10)))
github-actions[bot] commented 3 months ago

We found the following entries in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory