question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App size is locked to the initial terminal window size

See original GitHub issue

Solution

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.

image

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:

image

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:

image

and in case it’s useful, the devtool output on launching the above BlankApp() invoked with textual run --dev main.py

image

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
voxofoxcommented, Nov 22, 2022

Yessss 😃)) That did the trick! Thanks @darrenburns ❤️

For anyone else : a restart of the terminal is needed too.

1reaction
darrenburnscommented, Nov 22, 2022

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 inside poetry shell on v1.2.0 of poetry).

If you run echo $COLUMNS, resize your terminal windows, then run echo $COLUMNS again, does the value printed change to reflect the new width of your terminal window? It’s possible it’s getting stuck.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RemoteApp window size - TechNet - Microsoft
Hi. Anyone knows if it is possible to publish an application and force it to open in % of monitor size/resolution?
Read more >
Set terminal size permanently - command line - Ask Ubuntu
In Ubuntu 16.04 open the terminal, select Edit->Profile Preferences -> General tab and change the values for columns and rows after where it...
Read more >
macos - How to set default finder window size? - Ask Different
It is very easy to do this: Open a new Finder window. As you resize the window, hold the Command ⌘ (not Alt...
Read more >
How to change default height and width of Windows Terminal
Under the “Launch size” section, use the Rows option to adjust the height of the Windows Terminal. Click the Save button. Once you...
Read more >
How do I make a Window ALWAYS open in a specific size?
On Macs - if you want a window size remembered ( terminal, mail, photos, iTunes ) open the app - resize the window....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found