-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Using progress + console.log leads to squished output when printing to non-terminal #1606
Labels
Comments
Also seeing this |
Same here |
netbsd-srcmastr
pushed a commit
to NetBSD/pkgsrc
that referenced
this issue
Nov 14, 2021
10.13.0 Added Added json.dumps parameters to print_json Textualize/rich#1638 Fixed Fixed an edge case bug when console module try to detect if they are in a tty at the end of a pytest run Fixed a bug where logging handler raises an exception when running with pythonw (related to https://bugs.python.org/issue13807) Fixed issue with TERM env vars that have more than one hyphen Textualize/rich#1640 Fixed missing new line after progress bar when terminal is not interactive Textualize/rich#1606 Fixed exception in IPython when disabling pprint with %pprint Textualize/rich#1646 Fixed issue where values longer than the console width produced invalid JSON Textualize/rich#1653 Fixes trailing comma when pretty printing dataclass with last field repr=False Textualize/rich#1599 Changed Markdown codeblocks now word-wrap
Please try 10.14.0 |
Did I solve your problem? Consider sponsoring the ongoing work on Rich and Textual. Or buy me a coffee to say thanks. |
Can confirm 10.14.0 fixes the issue, thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When printing to something that isn't detected as a terminal, say GitHub Actions or a file, the completed progress bar doesn't have a terminating newline resulting in the next console.log's output being joined to the progress bar.
To Reproduce
Then running the script redirecting stdout to a file breaks the output sadly:
Although as shown if rich is printing to a terminal it works just fine.
Platform
bash, version 5.0.17(1)-release
&fish, version 3.1.0
Diagnose
Other context
For the time being I'm using this workaround:
And finally, thank you for the fantastic work on rich! It's a wonderful library and has made my output so much nicer :)
The text was updated successfully, but these errors were encountered: