szn

Bug 387 — Sixel anchor/state tracking defects

File: src/server/render.zig:818-819 (const state_count = @min(bounds.len, 8); var states: [8]...), src/screen.zig:1152-1175 (SU), src/screen.zig:1192-1211 (SD) Severity: LOW Status: ✅ FIXED

Fix (applied)

  1. Region SU now shifts sixel anchors by the full scroll amount (shiftSixelAnchors(-count)) instead of once for an n-line scroll.
  2. Region SD gained the missing shiftSixelAnchors(+count) call, mirroring the non-region branch.
  3. Render per-pane state cap raised 8 → MAX_RENDER_PANES = 32 with a comment marking it a degenerate-layout bound; panes 9..32 now draw and erase their images correctly.

Test: region scroll shifts sixel anchors by full amount — bug #387 (4-line region SU moves anchor by 4; region SD shifts back down).

Problem

  1. With more than 8 panes, images in panes 9+ are neither drawn nor erased, and their stale sixel_last_anchor entries keep forcing needs_erase every frame (wasted work + invisible sixels).
  2. Region SU scrolls n>1 lines but shifts sixel anchors by exactly one row (call sits outside the per-line loop).
  3. Region SD branch has no compensating shiftSixelAnchors(+1) although the non-region branch does (:1218).

Images anchored inside regions desync from their marker cells after any multi-line region scroll.

Fix (proposed)

Allocate per-pane state dynamically (or iterate bounds directly), hoist the anchor shift into the scroll amount (shiftSixelAnchors(-@as(i32,@intCast(n)))) and add the missing SD counterpart.