ECH is ineffective, causing ghosting/smearing on scrollECH is ineffective, causing ghosting/smearing on scrollFile: src/server/render.zig:455–457 (per-cell erase), src/server/render.zig:389–396 (force_clear), src/server/render.zig:701–710 (slot-null / id-mismatch clear)
Severity: HIGH
Status: ✅ FIXED — Screen now carries sixel_last_anchor[64] (the clamped top-left cell each slot’s image was last drawn at). renderSixelImages erases any slot whose anchor moved or that disappeared by emitting a DECSIXEL erase-below (ESC P 1 q ESC \) at the previous anchor before redrawing, so the overlay is cleared instead of smeared/ghosted. ECH is no longer relied upon to clear sixel pixels. Unit tests renderSixelImages erases previous position when image scrolls and renderSixelImages erases removed image overlay verify the erase is emitted at the old anchor and the image is redrawn at the new one.
The sixel pixel data is emitted verbatim as a raw DCS sequence onto the terminal’s separate sixel overlay layer. The only mechanisms that attempt to remove old sixel are:
try self.writeBytes("\x1b[X") (Erase Character) when a cell transitions sixel → non-sixel.\x1b[2J issued by force_clear (only on eraseDisplay/resetHard/clearScreen).attr.sixel locally on the merged-screen cell copy when the slot is null / id mismatches / image doesn’t fit.None of these reliably wipe the overlay:
ECH operates on the text grid, not the sixel overlay. Virtually no terminal emulator erases sixel pixels with CSI X. So old pixels persist.renderSixelImages redraws the image at its current anchor every frame (good), but never erases the previously drawn position. As the image scrolls, each frame paints at a new anchor while all prior positions remain on screen → a smearing trail of the same image going up the terminal.force_erase (sixel→non-sixel transition) does nothing useful, and the ghost remains.This directly contradicts the design doc’s claimed “Perfect Scroll Sync” (sixel_grid_allocation.md:60). A real erase path is required — e.g. re-issue the image with an inline erase (DECSIXEL P2 erase operation) or, failing that, a targeted full repaint of the affected pane region rather than relying on ECH.