You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Layout class takes an argument of "height", but it if I'm reading the code right it never seem to get used. The value is saved in the constructor, but later, when rendering, the height is set as follows:
Also, while "height" is listed in the docs for Layout(), it has a blank description. Perhaps this was removed before but a few remnants of it remained?
Platform
This should apply to all platforms -- I found this by code inspection. I'm running rich 12.5.1 on Python 3.10.6 on macOS Monterey (12.5).
The workaround seems to be to create a "console" object with the desired height, and then call print() of the Layout on that console rather than using rich.print().
To avoid confusion, I'm thinking maybe this parameter should just be removed. Alternately, I could see it making sense to provide a max_height which could shrink the height to less than the console (or whatever container it is contained in), but I'm not sure it ever makes sense to grow it to larger than console.height or options.height. I could see also offering a max_width that worked along the same lines, where render_width could be set to the smaller of that and options.max_width.
The text was updated successfully, but these errors were encountered:
Describe the bug
The Layout class takes an argument of "height", but it if I'm reading the code right it never seem to get used. The value is saved in the constructor, but later, when rendering, the height is set as follows:
rich/rich/layout.py
Line 380 in a6f2d84
Also, while "height" is listed in the docs for Layout(), it has a blank description. Perhaps this was removed before but a few remnants of it remained?
Platform
This should apply to all platforms -- I found this by code inspection. I'm running rich 12.5.1 on Python 3.10.6 on macOS Monterey (12.5).
The workaround seems to be to create a "console" object with the desired height, and then call print() of the Layout on that console rather than using rich.print().
To avoid confusion, I'm thinking maybe this parameter should just be removed. Alternately, I could see it making sense to provide a max_height which could shrink the height to less than the console (or whatever container it is contained in), but I'm not sure it ever makes sense to grow it to larger than console.height or options.height. I could see also offering a max_width that worked along the same lines, where render_width could be set to the smaller of that and options.max_width.
The text was updated successfully, but these errors were encountered: