From 995a7377c1deb478ae993e496ad5954ad78d9579 Mon Sep 17 00:00:00 2001 From: Qwerasd Date: Sun, 16 Nov 2025 15:48:17 -0700 Subject: [PATCH] fix(terminal): avoid lockup caused by 0-length hyperlink This could cause a 0-length hyperlink to be present in the screen, which, in ReleaseFast, causes a lockup as the string alloc tries to iterate `1..0` to allocate 0 chunks. --- src/terminal/Screen.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index 126165a40..09e957786 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -2146,7 +2146,13 @@ pub fn cursorSetHyperlink(self: *Screen) !void { ); // Retry - return try self.cursorSetHyperlink(); + // + // We check that the cursor hyperlink hasn't been destroyed + // by the capacity adjustment first though- since despite the + // terrible code above, that can still apparently happen ._. + if (self.cursor.hyperlink_id > 0) { + return try self.cursorSetHyperlink(); + } }, } }