From b54f780de3640213fc70201b869d6c12995d6c8d Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Fri, 19 Apr 2024 11:08:12 +0100 Subject: [PATCH 1/2] 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) From 7e3da30fbef75a4812080dbf88999b5d7b2f0db6 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Fri, 19 Apr 2024 11:09:07 +0100 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6327789eeb..c151eac8ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fixed `Integer` validator missing failure description when not a number https://github.com/Textualize/textual/issues/4413 - Fixed a crash in `DataTable` if you clicked a link in the border https://github.com/Textualize/textual/issues/4410 +- Fixed issue with cursor position https://github.com/Textualize/textual/pull/4429 ### Added