From b44ebed7988f3adeeb25c6bae746618c0cf10f9d Mon Sep 17 00:00:00 2001 From: Qwerasd Date: Mon, 23 Dec 2024 15:45:30 -0500 Subject: [PATCH] Fix a scenario that could cause issues under some conditions I don't know if this actually occurs in a way that can cause serious problems, but it's better to nip it in the bud. --- src/terminal/Screen.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index 42bcd54c0..0e42dbb9b 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -1763,10 +1763,15 @@ pub fn manualStyleUpdate(self: *Screen) !void { // If our new style is the default, just reset to that if (self.cursor.style.default()) { - self.cursor.style_id = 0; + self.cursor.style_id = style.default_id; return; } + // Clear the cursor style ID to prevent weird things from happening + // if the page capacity has to be adjusted which would end up calling + // manualStyleUpdate again. + self.cursor.style_id = style.default_id; + // After setting the style, we need to update our style map. // Note that we COULD lazily do this in print. We should look into // if that makes a meaningful difference. Our priority is to keep print