From 449eb170f7cc620c3f267270b3ad1d770e7e49ab Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Sun, 17 Mar 2024 09:16:10 -0500 Subject: [PATCH] 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 --- src/vaxis.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vaxis.zig b/src/vaxis.zig index b831b4d..3ff6c33 100644 --- a/src/vaxis.zig +++ b/src/vaxis.zig @@ -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(); }