Skip to content

Commit

Permalink
fix: always show cursor on deinit
Browse files Browse the repository at this point in the history
The render method always hides the cursor, and only shows it if it needs
to be shown. This has the effect that if a caller never shows the
cursor, exits the application, and the shell doesn't re-show the cursor
then we have no visible cursor.

Always show the cursor on deinit to prevent such a curse.

Fixes: #10
  • Loading branch information
rockorager committed Mar 17, 2024
1 parent 9496270 commit 449eb17
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vaxis.zig
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ pub fn Vaxis(comptime T: type) type {
if (self.state.alt_screen) {
_ = tty.write(ctlseqs.rmcup) catch {};
}
// always show the cursor on exit
_ = tty.write(ctlseqs.show_cursor);
tty.flush() catch {};
tty.deinit();
}
Expand Down

0 comments on commit 449eb17

Please sign in to comment.