Skip to content

Commit d7e9168

Browse files
committed
fix(app): fix garbled inline app output
Fix garbled inline app output when `inline_no_clear=True`. Currently the terminal cursor isn't actually "reset" before printing the screen contents. This doesn't matter for most inline apps as the cursor is already offset at (0, 0). But if the app contains an `Input` widget, this will update the cursor position so the output will be garbled. Fixes #6064
1 parent 8d78427 commit d7e9168

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/textual/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3294,8 +3294,9 @@ async def invoke_ready_callback() -> None:
32943294
if self._driver.is_inline:
32953295
cursor_x, cursor_y = self._previous_cursor_position
32963296
self._driver.write(
3297-
Control.move(-cursor_x, -cursor_y + 1).segment.text
3297+
Control.move(-cursor_x, -cursor_y).segment.text
32983298
)
3299+
self._driver.flush()
32993300
if inline_no_clear and not self.app._exit_renderables:
33003301
console = Console()
33013302
try:

0 commit comments

Comments
 (0)