Repository navigation
Render Kitty images at Unicode placeholder cells - #26031
Conversation
|
Found a flicker when a placeholder image is animated by retransmitting it under the same id (
Fix on my fork: edenaion@d10ca74 ☼ A retransmit with ☼ Placeholder cells whose image or placement is unknown, deleted or still decoding draw nothing instead of the glyph. Same run after the fix: 0 of 90. It adds lifecycle and glyph-contract cases (7 of 18 fail before the change) and regenerates the addon patch with |
Thanks, will pick up your change 🫡 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
config/scripts/xterm-image-kitty-retransmit.test.mjs (1)
219-232: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valuePut the disposal test cleanup in
try/finally.All other tests in this file call
h.terminal.dispose()insidefinally. This test does not. A failed assertion on Lines 227-230 skipsh.terminal.dispose(), so the terminal stays alive. Ifvi.waitFortimes out,writingalso stays pending. Wrap these lines intry/finallyso cleanup runs after a failure.Proposed fix
- await vi.waitFor(() => expect(pending).toHaveLength(1)) - h.addon.dispose() - pending[0].resolve(stale) - await writing - expect(h.storage._images.size).toBe(0) - expect(h.kitty._virtualPlacements.size).toBe(0) - expect(first.close).toHaveBeenCalledOnce() - expect(stale.close).toHaveBeenCalledOnce() - h.terminal.dispose() + try { + await vi.waitFor(() => expect(pending).toHaveLength(1)) + h.addon.dispose() + pending[0].resolve(stale) + await writing + expect(h.storage._images.size).toBe(0) + expect(h.kitty._virtualPlacements.size).toBe(0) + expect(first.close).toHaveBeenCalledOnce() + expect(stale.close).toHaveBeenCalledOnce() + } finally { + h.terminal.dispose() + }
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
882449f4-1999-4114-819e-faa2ad5f213f
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (16)
config/patches/@[email protected]config/patches/@[email protected]config/patches/xterm-src/@[email protected]config/patches/xterm-src/@[email protected]config/scripts/xterm-image-kitty-admission.test.mjsconfig/scripts/xterm-image-kitty-coordinate-boundaries.test.mjsconfig/scripts/xterm-image-kitty-glyph-visibility.test.mjsconfig/scripts/xterm-image-kitty-placeholder-contract.test.mjsconfig/scripts/xterm-image-kitty-placeholder-lifecycle.test.mjsconfig/scripts/xterm-image-kitty-retransmit.test.mjsconfig/scripts/xterm-kitty-placeholder-test-terminal.mjsconfig/scripts/xterm-underline-color-contract.test.mjstests/e2e/helpers/terminal-inline-image-proof.tstests/e2e/terminal-inline-images-paired-runtime.spec.tstests/e2e/terminal-inline-images-windows.spec.tstests/e2e/terminal-kitty-placeholders.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
2a86024 to
d19d15c
Compare
ELI5
Applications can display images through Kitty's text-cell placeholders. Replacing an image keeps the old picture visible until the new one is ready, without flashing blank or showing reserved characters.
Merged as
26278b32ce84on October 16. #28200 is also merged as90849ed0c6fffor Claude file images. #25109 is closed.What Changed
The existing image addon parses virtual placements and draws fragments at U+10EEEE cells. Replacement retains decoded placements while a new source is prepared, rejects stale decode results and releases failed/superseded bitmaps. Virtual placements reuse existing storage limits.
The upgraded addon uses upstream cell payloads and buffer accessors. Its duplicated image-attribute class and our changes to that class are gone. Placeholder lookup uses
getExtended, which checks the current cell flag before exposing underline metadata. A regression verifies glyph masking preserves a real physical tile payload, links, colors and text.The three small core attribute corrections remain: retain underline color without visible underlining, refresh the extended flag after SGR 58 and normalize the default-color sentinel. The retention check also preserves upstream's new payload condition. Existing invisible-text flags and a cancellable microtask timer handle glyph masking and scroll batching.
Why
This builds on the upgraded storage rather than maintaining the removed attribute implementation. It reuses parsing, allocation, cleanup and cell metadata while keeping placeholder support separate from the dependency upgrade.
The original implementation comes from emmahyde's #23616. Replacement and glyph corrections follow edenaion's report and proposed fix, integrated without its larger dependency stack.
Linked Issue
Addresses the placeholder protocol portion of #23615 and #25109. Claude’s reported file-backed paste also requires stacked #28200; this PR alone does not close that use case. Cold-remount restoration remains separate.
Visual Proof
Existing before/after replacement proof, with both decodes held at the same boundary:
Those comparisons were recorded before the beta upgrade. Ten fresh real-PTY pixel cases pass on this upgraded stack, including active WebGL, named placements, letterboxing, transparency and delete/recreate repaint.
Testing
0dc7b4a59dd4, based on main9b99928cb50f.8a5afc6f, on macOS 27.0.1.afterEachcleanup atorcad-serve-parity.integration.test.ts:34, after the restart assertions. No baseline reproduction yet; the failed job is retained. Other hosted checks continue.Review
Refreshed onto current main without adding unrelated application changes. The earlier native-chat typecheck blocker is resolved by the current main source. Three core attribute corrections remain; the upstream placeholder issue and PR are still open. The parent changes 17 expected files.
The original terminal-startup timeout is retained and has no established image-related cause. A separate original-plugin failure in the child was traced to the plugin asking for a converted PNG that does not exist; the bounded file reader correctly rejects it. It does not require another core patch.
The invisible flag persists until overwrite, including after addon disposal, and serializers can observe it. Buffer internals remain pinned. Physical placement ownership, negative-z layering and cold-remount restoration remain separate work. Claude file sources require stacked #28200. No remote wire format changes.
Agent skill upstream boundary
Checklist