Skip to content

Commit

Permalink
Fix cursor that remains in hidden state when application exits.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jonathanslenders committed Oct 4, 2024
1 parent 435bd99 commit 06a1421
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/prompt_toolkit/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down

0 comments on commit 06a1421

Please sign in to comment.