From b54f780de3640213fc70201b869d6c12995d6c8d Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Fri, 19 Apr 2024 11:08:12 +0100 Subject: [PATCH] fix cursor --- src/textual/app.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/textual/app.py b/src/textual/app.py index 7ed7275d0a..d0d6d8a057 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -2840,15 +2840,19 @@ def _display(self, screen: Screen, renderable: RenderableType | None) -> None: try: try: if isinstance(renderable, CompositorUpdate): - cursor_x, cursor_y = self._previous_cursor_position - terminal_sequence = Control.move( - -cursor_x, -cursor_y - ).segment.text - cursor_x, cursor_y = self.cursor_position - terminal_sequence += renderable.render_segments(console) - terminal_sequence += Control.move( - cursor_x, cursor_y - ).segment.text + if self._driver.is_inline: + terminal_sequence = Control.move( + *(-self._previous_cursor_position) + ).segment.text + terminal_sequence += renderable.render_segments(console) + terminal_sequence += Control.move( + *self.cursor_position + ).segment.text + else: + terminal_sequence = renderable.render_segments(console) + terminal_sequence += Control.move_to( + *self.cursor_position + ).segment.text self._previous_cursor_position = self.cursor_position else: segments = console.render(renderable)