File: src/mode_copy.zig:124 (and L162, L184, L263, L279, L391, L427)
Severity: MEDIUM
Status: ✅ FIXED — all 7 occurrences of grid.history.items.len - grid.history_start replaced with grid.historyLen(). Unit test added.
Functions in CopyMode compute live history length using direct subtraction grid.history.items.len - grid.history_start. In contrast, src/grid.zig:107 defines historyLen() with an explicit check if (self.history.items.len < self.history_start) return 0;.
Impact: Risk of integer underflow panic during copy mode navigation or text selection if history_start temporarily exceeds array bounds during history ring-buffer compaction.