img2sixel on an image larger than the pane wastes work and destroys scrollbackimg2sixel on an image larger than the pane wastes work and destroys scrollbackFile: src/screen.zig:217 (addSixelImage)
Severity: MEDIUM
Status: ✅ FIXED — addSixelImage now computes the image’s cell footprint (cell_rows/cell_cols) up front and returns immediately (freeing the captured bytes) when it exceeds the pane (grid) dimensions. Because the render path only draws a sixel that is fully contained in the pane, such an image can never be displayed, so the early bail skips the pre-scroll marker loop, the shiftSixelAnchors churn, and the registry entry that forced a per-frame erase-all — without ever sending anything to the terminal. The drop is gated on a per-screen cell_size_known flag (mirroring the server’s), so it only fires once a measured cell size has arrived from the display client; while still on the built-in defaults szn waits for the real dimensions rather than risk discarding a valid image on stale numbers. Added unit tests addSixelImage drops an image larger than the pane — bug #203 and addSixelImage does not drop an oversized image before cell size is known — bug #203.
Running img2sixel on a large image (e.g. taller than the viewable area) feeds a sixel whose cell footprint is bigger than the pane. addSixelImage previously ran its full pre-scroll loop — scrolling the grid up by every oversized row and shifting all anchors — and stored the image in the registry, where the renderer would then drop it every frame (after sending a redundant erase-all). The user saw the shell “idle” and their scrollback shoved off-screen for an image that was never going to render. Detecting the size mismatch at capture time makes the discard instant and side-effect-free.