File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -315,7 +315,6 @@ def stop_application_mode(self) -> None:
315315 self .disable_input ()
316316 self .write ("\x1b [<u" ) # Disable kitty protocol
317317 self .write ("\x1b [J" )
318- self .flush ()
319318
320319 if self .attrs_before is not None :
321320 try :
Original file line number Diff line number Diff line change 33from rich .terminal_theme import DIMMED_MONOKAI , MONOKAI , NIGHT_OWLISH
44
55from textual .app import App , ComposeResult
6- from textual .widgets import Button , Input
6+ from textual .widgets import Button , Input , Static
77
88
99def test_batch_update ():
@@ -140,3 +140,36 @@ async def test_ansi_theme():
140140
141141 app .dark = True
142142 assert app .ansi_theme == DIMMED_MONOKAI
143+
144+
145+ async def test_early_exit ():
146+ """Test exiting early doesn't cause issues."""
147+ from textual .app import App
148+
149+ class AppExit (App ):
150+ def compose (self ):
151+ yield Static ("Hello" )
152+
153+ def on_mount (self ) -> None :
154+ # Exit after creating app
155+ self .exit ()
156+
157+ app = AppExit ()
158+ async with app .run_test ():
159+ pass
160+
161+
162+ def test_early_exit_inline ():
163+ """Test exiting early in inline mode doesn't break."""
164+ from textual .app import App
165+
166+ class AppExit (App ):
167+ def compose (self ):
168+ yield Static ("Hello" )
169+
170+ def on_mount (self ) -> None :
171+ # Exit after creating app
172+ self .exit ()
173+
174+ app = AppExit ()
175+ app .run (inline = True , inline_no_clear = True )
You can’t perform that action at this time.
0 commit comments