App size is locked to the initial terminal window size
See original GitHub issueSolution
The issue existed only in a poetry 1.2.0
shell - updating it to >1.2.0
solved the issue.
Original Issue
Instead of the App expanding to fill the width / height of the terminal emulator window, it remembers the first time a terminal app (e.g. kitty, foot, terminator) runs Textual, and then uses those window dimension on each subsequent run.
The app also doesn’t resize when the window is resized.
The above shows kitty
(left) with the same app running in foot
(right), however, the left window is “stuck” to the dimensions I initially used for kitty.
The same issue exists for a blank app with no CSS and only a Placeholder Widget:
based off of
class BlankApp(App):
def compose(self) -> ComposeResult:
yield Placeholder()
app = BlankApp()
I use fish
but running it from bash
has the same result.
Packages :
Python 3.10.7
textual 0.5.0 Modern Text User Interface framework
System:
and in case it’s useful, the devtool output on launching the above BlankApp()
invoked with textual run --dev main.py
Issue Analytics
- State:
- Created 10 months ago
- Comments:5
Top GitHub Comments
Yessss 😃)) That did the trick! Thanks @darrenburns ❤️
For anyone else : a restart of the terminal is needed too.
Your shell has
$COLUMNS
and$LINES
variables which should get updated whenever you resize your terminal window. We’ve seen issues in the past where these variables weren’t being updated for some reason (in my case, it wasn’t being updated insidepoetry shell
on v1.2.0 of poetry).If you run
echo $COLUMNS
, resize your terminal windows, then runecho $COLUMNS
again, does the value printed change to reflect the new width of your terminal window? It’s possible it’s getting stuck.