From 4d8eb0a7c13a69afe30f6a251ff0d72281650f77 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Sun, 28 Dec 2025 19:37:00 -0500 Subject: different cursor shape in insert vs normal mode --- vui.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'vui.c') diff --git a/vui.c b/vui.c index f97ea71..8c4a58a 100644 --- a/vui.c +++ b/vui.c @@ -202,6 +202,11 @@ void vui_curs_pos(int x, int y) { win.curs_y = y; } +void vui_curs_shape(VuiCursorShape sh) { + printf("\x1b[%d q", sh); + fflush(stdout); +} + /* TODO: use something better than signal() */ /* does sigaction allow for a context pointer? */ static void on_resized(int signo) { @@ -247,6 +252,7 @@ static inline int bchr_equiv(VuiBuffer *a, VuiBuffer *b, unsigned i) { void vui_fini(void) { vui_curs_vis(1); + vui_curs_shape(VUI_CURS_DEFAULT); free_buf(&win.buf1); free_buf(&win.buf2); free(vui_out); @@ -793,7 +799,7 @@ static VuiKey esc_key(u32 c) { } VuiKey vui_key(void) { - int c = getk(); + unsigned c = getk(); switch (c) { case '\n': return KEY_RET; -- cgit v1.2.3