Repository navigation
fix(graphics): abort an unfinished kitty upload on delete, sixel or RIS - #612
Merged
Merged
Conversation
While a chunked kitty upload (`m=1`) was waiting for its last chunk, escapes that cannot continue it completed it instead (#587). A sixel was built on top of the upload, so it came out as one payload described as a sixel carrying the kitty `s=`, `c=`/`r=`, `t=`, `i=` and `o=`, which decoded to a transparent 4x6 rather than the red it painted. A delete was read as the last chunk, its control block ignored, so `kitty()` counted an image and `deletes()` missed the teardown; the protocol says the partial upload must be aborted. RIS did not reset the upload, so the next transmission completed it. Any APC that did not open with `G` was taken as a chunk too. Only a kitty escape continues an upload now. A delete aborts it and is counted; a sixel or RIS abandons it; another APC leaves it alone, as kitty ignores one. An abandoned upload is no image, but its chunks still count in `bytes()`, which counts wire traffic. DECSTR keeps the upload: kitty's soft reset skips the image clear its hard reset does, so the next chunk there still completes it. Closes #587 Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
vyncint
added a commit
that referenced
this pull request
Oct 27, 2026
Resolves the CHANGELOG conflict with #612: both sets of entries kept. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While a chunked kitty upload (
m=1) was in progress, three things that cannot continue it completed it instead:s=,c=/r=,t=,i=,o=, whose data was the kitty chunk and the sixel run together — it decoded to a transparent 4x6 instead of the red it painted.a=d) was taken as the upload's last chunk:kitty()counted an image,deletes()missed the teardown. The protocol: "the partial upload must be aborted".G, was taken as a chunk (and, with nom=1, as the last one); afterRISthe next transmission completed the upload.Fix. Only a
GAPC continues an upload. A delete aborts it and is then counted as a delete; a sixel orRISabandons it.DECSTRkeeps it, as kitty's soft reset does (it skips thegrman_clearthe hard reset runs — kittyscreen.c/graphics.c, read at 2a70f21). An abandoned upload is no image; its chunks still count inbytes(), which counts traffic, not pictures, sobytes()is unchanged for every stream.Tests (unit,
emu/seq.rs, the issue's exact sequences): sixel mid-upload (plus its decode underdecode), delete mid-upload, RIS vs DECSTR, a non-GAPC. All five failed on main showing the issue's symptoms; restoring each piece of the old behaviour on its own turns exactly its test red. DESIGN.md's counter paragraph also said continuations "carry no control block at all" — they carrym=; corrected.Not changed (outside the issue, noted for later):
a=p/a=cor a new non-directt=sent mid-upload, which kitty handles separately and the protocol forbids.Closes #587