File: src/server/render.zig:207–241 (merged-screen clipping), src/server/render.zig:669–731 (render-time fits check)
Severity: MEDIUM
Status: ✅ FIXED — both the merged-screen clipping and renderSixelImages now keep an image whenever it intersects the pane (only clearing/dropping it when it has scrolled completely out of bounds), and the render path draws at the clamped visible edge so the terminal shows the remaining rows/cols. Added unit test renderSixelImages keeps partially-scrolled sixel visible — bug #197.
The design doc states: “If abs_row < 0 (partially scrolled off the top), we skip redrawing it, letting the terminal’s native viewport scrolling handle display of the remaining visible bottom pixels” (sixel_grid_allocation.md:54).
The code does not do this. Instead:
const fits = img_pane_col >= 0 and img_pane_row >= 0 and
(img_pane_col + cell_cols) <= pb.w and
(img_pane_row + cell_rows) <= pb.h;
if (!fits) {
cell.attr.sixel = false; // clears the WHOLE image, not just the off-screen part
...
}
When any part of the image is out of bounds (top scrolled above the pane, or it would exceed pane w/h), the entire image is hidden (attr.sixel cleared on every cell). So an image that is one row into scrolling off the top vanishes completely, rather than showing its remaining bottom rows. This both contradicts the doc and breaks the “Perfect Scroll Sync” benefit claim. Combined with #195, partially-scrolled images leave a ghost at their last full position and then disappear.