@intCast(self.cy) can panic when cursor position is -1 in drawLine@intCast(self.cy) can panic when cursor position is -1 in drawLineFile: src/tty/tty.zig:399–400
Severity: MEDIUM
Status: ✅ FIXED — added self.cx < 0 or self.cy < 0 guard before the @intCast to short-circuit on invalid cursor. Unit test added.
if (col != self.cx or @as(u64, @intCast(ly)) != @as(u64, @intCast(self.cy))) {
@intCast(self.cy) casts i64 to u64. If self.cy == -1 (cursor invalidated by invalidate() or enterAltScreen()), this panics. Can be reached when col matches self.cx and the right side evaluates.