Replace SIXEL retention and the per-client cache with the global indexed-image cache from image_merge. Adapt its backend callbacks for Kitty and test palette quantization through both input protocols.
An unterminated SIXEL image kept the pane in the DCS state, so everything
the program printed afterwards was swallowed until the timeout, and the image
itself was never drawn. Treat the Escape as the end of the image, as other
terminals do, and handle the sequence after it normally. Other DCS strings
are unchanged.
Keep retained indexed SIXEL data and the bounded per-terminal output cache.
Use the cleaned-up decoder and RGBA encoder from image_merge, including
parser memory limits, pixel-size handling and references for pending output.
Match retained SIXEL scaling to the shared image cell footprint and emit
black definitions for undefined colour registers.
Keep Kitty input, output, layers and placeholders. Adapt backend selection,
flags, drawing and cleanup to the callbacks and Iscrl capability. Keep the
pane-status repaint with the requested XXX comment.
Replace the elaborate fallback with image_merge's implementation, removing
its caches, sample structures, quadrant/sextant features and ACS additions.
Keep the image_merge regressions and adapt the Kitty tests to the simpler
fallback. Use skip status 101 and disable Python bytecode for image tests.
Small changes still outside image_merge:
- Guard zero-height synchronized redraws before bit_nset.
- Select the image backend when the tty opens.
- Enable imagescroll by default for Kitty and Ghostty.
- Keep the explanatory manual-window pixel-size comment (comment only).
- Keep the additional SIXEL fixtures and visual test tools.
Validation: image-enabled and disabled builds; 31 image and 13 related
regressions pass normally and under ASAN. All image tests skip without
images. Focused palette, parser, scaling, transparency and Kitty layer
tests also pass after the retained-output adjustments. Diff checks clean.
The reply to CSI 14t updated the client's cell size but not the windows,
which kept the default 16x32 cell size until some other event (a resize, or
any client connecting or exiting) triggered recalculate_sizes(). Images
parsed in the meantime were sized for the wrong cell and drawn at the wrong
size. Recalculate when the reply arrives, and extend the reply test to check
that the window follows the client without any other event.
- Extract shared setup for the "noflash" retransmission-avoidance tests
(image-movepane-drag-noflash.sh, image-splitwindow-resize-noflash.sh,
image-status-pane-click-noflash.sh, image-selection-noflash.sh) into
a new image-noflash-common.inc, matching the existing input-common.inc
convention: dual-server cleanup/fail helpers, the shared SIXEL fixture,
the attach-and-capture sequence, and the final DCS-retransmission
assertion. Each test keeps its own distinct interaction and failure
message; only the copy-pasted scaffolding moved.
- Add the missing #{image_support} runtime guard to
image-border-status-sixel.sh, which cats a real SIXEL fixture and
specifically guards a sixel-after-pane-creation ordering bug - without
it, the DCS sequence is compiled out entirely on a non-image build and
the test's assertions could pass without exercising anything.
image-border-status-wipe.sh is deliberately left unguarded: it has no
image/sixel content at all and guards a general border-status caching
bug unrelated to ENABLE_IMAGES.
- Reviewed the rest of the branch's regress/image-*.sh tests in full
(not just headers) for redundant coverage; none warranted merging -
each guards a genuinely distinct fix via a distinct mechanism.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Support Kitty and SIXEL input and output with grid-resident image layers, history and copy-mode integration, text fallback rendering, and damage-rectangle redraws.
Consolidate the image work through 250f96b4b onto the redraw-damage-rectangles-new base, excluding the superseded redraw implementation and its historical merges. The original history is preserved in backup/4902-image-support-before-master-rebase-20261003.