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.
pull/9645/head
Qwerasd 2025-11-16 15:48:17 -07:00
parent bee5875351
commit 995a7377c1
1 changed files with 7 additions and 1 deletions

View File

@ -2146,7 +2146,13 @@ pub fn cursorSetHyperlink(self: *Screen) !void {
); );
// Retry // 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();
}
}, },
} }
} }