terminal: resize should preserve cursor style ref

This commit is contained in:
Mitchell Hashimoto
2024-03-19 13:00:25 -07:00
parent a40899fa3c
commit 77362d9aa7

View File

@ -845,6 +845,11 @@ fn resizeInternal(
// No matter what we mark our image state as dirty // No matter what we mark our image state as dirty
self.kitty_images.dirty = true; 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. // Perform the resize operation. This will update cursor by reference.
try self.pages.resize(.{ try self.pages.resize(.{
.rows = rows, .rows = rows,
@ -863,6 +868,11 @@ fn resizeInternal(
// If our cursor was updated, we do a full reload so all our cursor // If our cursor was updated, we do a full reload so all our cursor
// state is correct. // state is correct.
self.cursorReload(); 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. /// Set a style attribute for the current cursor.