From 77362d9aa70c79f62d323b7b2a8d28029d97e32f Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 19 Mar 2024 13:00:25 -0700 Subject: [PATCH] terminal: resize should preserve cursor style ref --- src/terminal/Screen.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index 0d4999f56..27d1df234 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -845,6 +845,11 @@ fn resizeInternal( // No matter what we mark our image state as dirty self.kitty_images.dirty = true; + // We store our style so that we can update it later. + const old_style = self.cursor.style; + self.cursor.style = .{}; + try self.manualStyleUpdate(); + // Perform the resize operation. This will update cursor by reference. try self.pages.resize(.{ .rows = rows, @@ -863,6 +868,11 @@ fn resizeInternal( // If our cursor was updated, we do a full reload so all our cursor // state is correct. self.cursorReload(); + + // Restore our previous pen. Since the page may have changed we + // reset this here so we can setup our ref. + self.cursor.style = old_style; + try self.manualStyleUpdate(); } /// Set a style attribute for the current cursor.