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
Add rich print using _get_rich_console #509
base: master
Are you sure you want to change the base?
Conversation
📝 Docs preview for commit 3b157c1 at: https://637b5b9082dd302494a34f0a--typertiangolo.netlify.app |
📝 Docs preview for commit 41e055f at: https://637bad2009b1d000aa0c4ef3--typertiangolo.netlify.app |
📝 Docs preview for commit 7aa8580 at: https://637ca37be26a2376b30fe6f5--typertiangolo.netlify.app |
@tiangolo I would appreciate a review on this one. cc @willmcgugan as the author of this module (and rich ❤️) We might want to change how we load the configuration such as |
Instead of changing the stdout via get_stdout, we just set the TERMINAL_WIDTH to a very large number to avoid new lines. The configuration has been copied from https://github.com/tiangolo/typer/blob/master/scripts/test.sh **EDIT:** I have also created tiangolo/typer#509 to fix that in typer.
📝 Docs preview for commit a554497 at: https://637dec7bc6ae7d0db6b689fb--typertiangolo.netlify.app |
📝 Docs preview for commit a02e793 at: https://639ce9aa9c18df08c1c84069--typertiangolo.netlify.app |
@tiangolo please take a look - all tests have passed. |
This feature allows using rich's print in typer context.
It uses the
_get_rich_console
to make it more aware of the terminal it sits in. For example, this can be useful if you want to setTERMINAL_WIDTH
.