Skip to content

Display not being refreshed after App.suspend (since 0.85) #5528

Closed

Description

@davep

Using this code:

from os import system

from textual.app import App, ComposeResult
from textual.containers import Horizontal, Vertical
from textual.widgets import Footer, Header, Input


class SuspendingApp(App[None]):

    CSS = """
    Screen {
        Vertical {
            border: solid;
        }
    }
    """

    BINDINGS = [("f1", "edit")]

    def compose(self) -> ComposeResult:
        yield Header()
        with Horizontal():
            yield Vertical()
            yield Vertical()
        yield Input()
        yield Footer()

    def action_edit(self) -> None:
        with self.suspend():
            system("vim")


if __name__ == "__main__":
    SuspendingApp().run()

if you press f1 and then exit vim the screen of the Textual application doesn't fully restore:

Screen.Recording.2025-02-15.at.08.58.26.mov

Working backwards through Textual releases, the last version where App.suspend worked as intended was v0.84; it very much appears that v0.85.0 introduced this issue.

Activity

  1. TomJGooding commented on Feb 15, 2025

    @TomJGooding
    Contributor
    system("vim")

    Joining the dark side Dave?

    git bisect points to 6298acb, presumably this change in screen:

    @@ -1205,8 +1205,8 @@ def _get_inline_height(self, size: Size) -> int:
     
         def _screen_resized(self, size: Size):
             """Called by App when the screen is resized."""
    +        self._compositor_refresh()
             self._refresh_layout(size)
    -        self.refresh()
     
         def _on_screen_resume(self) -> None:
             """Screen has resumed."""

    I'm not really familiar enough with how the refreshing works to say this is the correct fix, but just sharing my findings in case it helps someone...

  2. github-actions commented on Feb 22, 2025

    @github-actions

    Don't forget to star the repository!

    Follow @textualizeio for Textual updates.

  3. added a commit that references this issue on Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions