Severity: MEDIUM
Status: ✅ FIXED
Files: src/screen.zig
Repeated sixel images arriving before the terminal’s XTWINOPS cell-size reply slowly grow server memory; no crash, just unbounded leak under sixel-heavy workloads.
pub fn flushPendingSixel(self: *Screen) void {
const pending = self.pending_sixel orelse return;
self.pending_sixel = null;
if (!self.cell_size_known) return;
= null) before the guard.!known path pending.data is neither re-buffered nor freed — the pointer is lost.updateCellSize:192-198 calls it unconditionally; doc says “must only be called once known is true” but nothing enforces it.Re-buffer on the unknown path (self.pending_sixel = pending; return;) or only take ownership after the guard. Add a regression test that calls flushPendingSixel with cell_size_known=false and asserts no leak / still pending.