From 06a14216e272a86bb9a49e1825a8dbf1c460cd3d Mon Sep 17 00:00:00 2001 From: Jonathan Slenders Date: Fri, 4 Oct 2024 14:19:49 +0000 Subject: [PATCH] Fix cursor that remains in hidden state when application exits. When we have an application that doesn't show the cursor and `erase_when_done` is being used, the cursor remained hidden after the application terminated. --- src/prompt_toolkit/renderer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/prompt_toolkit/renderer.py b/src/prompt_toolkit/renderer.py index 3f92303a8..d0590830d 100644 --- a/src/prompt_toolkit/renderer.py +++ b/src/prompt_toolkit/renderer.py @@ -257,7 +257,7 @@ def get_max_column_index(row: dict[int, Char]) -> int: # give weird artifacts on resize events.) reset_attributes() - if screen.show_cursor or is_done: + if screen.show_cursor: output.show_cursor() return current_pos, last_style @@ -416,6 +416,7 @@ def reset(self, _scroll: bool = False, leave_alternate_screen: bool = True) -> N self._bracketed_paste_enabled = False self.output.reset_cursor_shape() + self.output.show_cursor() # NOTE: No need to set/reset cursor key mode here.