fix: always show cursor on deinit

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
This commit is contained in:
Tim Culverhouse 2024-03-17 09:16:10 -05:00
parent 9496270ecd
commit 449eb170f7

View file

@ -113,6 +113,8 @@ pub fn Vaxis(comptime T: type) type {
if (self.state.alt_screen) { if (self.state.alt_screen) {
_ = tty.write(ctlseqs.rmcup) catch {}; _ = tty.write(ctlseqs.rmcup) catch {};
} }
// always show the cursor on exit
_ = tty.write(ctlseqs.show_cursor);
tty.flush() catch {}; tty.flush() catch {};
tty.deinit(); tty.deinit();
} }