From ce6f022a7ec2cc4c4d4f07d124bf1053a2bc9f3c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 5 Aug 2022 19:26:50 -0700 Subject: [PATCH] cursor should be a hollow rect on unfocus, regression from e163e4962baad09cd2c36be1529dee4fcf1220b0 --- src/Window.zig | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Window.zig b/src/Window.zig index e4ad2fa59..8348bab35 100644 --- a/src/Window.zig +++ b/src/Window.zig @@ -869,8 +869,13 @@ fn renderTimerCallback(t: *libuv.Timer) void { const win = t.getData(Window).?; // Setup our cursor settings - win.grid.cursor_visible = win.terminal_cursor.visible and !win.terminal_cursor.blink; - win.grid.cursor_style = Grid.CursorStyle.fromTerminal(win.terminal_cursor.style) orelse .box; + if (win.focused) { + win.grid.cursor_visible = win.terminal_cursor.visible and !win.terminal_cursor.blink; + win.grid.cursor_style = Grid.CursorStyle.fromTerminal(win.terminal_cursor.style) orelse .box; + } else { + win.grid.cursor_visible = true; + win.grid.cursor_style = .box_hollow; + } // Calculate foreground and background colors const bg = win.grid.background;