Skip to content
Discussion options

You must be logged in to vote

I found a solution after digging into the source code for "rich". I discarded this (from my original post):

            layout["root"].height = console.height - 4  # <-- restrict the height of the formatted output
            layout["root"].ratio = None

and added this in its place:

            _width, _height = shutil.get_terminal_size()
            console.size = (_width-1, _height-4)

by the way, I'm running Windows 10, Python 3.7 and testing my results in cmd.exe and PyCharm

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pganson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant