szn

Bug 317 — Sixel image refcounts leaked on grid history limit eviction

317. Sixel image refcounts leaked on grid history limit eviction

File: src/grid.zig:234-236 Severity: HIGH Status: ✅ FIXED

When Grid.scrollUp evicted old scrollback history lines exceeding history_limit, deinit was called without notifying Screen to decrement sixel refcounts.

Root Cause

Direct deallocation of history lines in Grid bypasses Sixel registry reference counting.

Fix

Connected Grid.on_line_evict callback to Grid.scrollUp history eviction, calling Screen.decrementLineRefs for evicted cells.

Impact

Continuous terminal scrolling leaks Sixel image references as lines fall off scrollback history.