deleteLines decrements the refcount of the preserved bottom linedeleteLines decrements the refcount of the preserved bottom lineFile: src/screen.zig:985–1009
Severity: CRITICAL
Status: ✅ FIXED — removed the decrement of the old bottom line (which shifts up and survives); only the discarded old line y releases its refcounts. Regression test verifies a bottom marker keeps refcount 1 after deleteLines(1).
self.decrementLineRefs(self.grid.getLineMut(bottom).cells.items); // decrement OLD bottom — but it survives!
const temp = self.grid.getLine(y).*;
var row = y;
while (row < bottom) : (row += 1) {
self.grid.getLineMut(row).* = self.grid.getLine(row + 1).*; // shift up
}
self.grid.getLineMut(bottom).* = temp; // old line y discarded here
const line = self.grid.getLineMut(bottom);
self.decrementLineRefs(line.cells.items); // decrement old line y (correct)
@memset(line.cells.items, fill);
deleteLines shifts rows y+1..bottom up, so the old bottom line’s content survives at row bottom-1. But the code decrements its refcount before the shift. Reproduced with a unit test: a sixel marker at the bottom line stays visible after deleteLines(1) yet its refcount drops 1→0.
Impact: Same as #278 — premature sixel eviction / under-counting while markers are still on screen.