Severity: MEDIUM
Status: ✅ FIXED
Files: src/mode_copy.zig
physical_line = logical + x / width; phys_x = x % width;
if (physical_line < hist_len) { ...; y = 0; }
else { scroll = 0; y = @intCast(physical_line - hist_len); } // can be >= height
x = @intCast(phys_x);
y is never clamped to height-1. All three @intCast (usize→u32) panic if history/grid ever exceed u32.
Clamp y to height -| 1 and saturate/check casts (@min / std.math.cast). Add a test with a tall logical line exceeding viewport height.