Repository navigation
kitty graphics: animation support - #13943
Merged
Merged
Conversation
mitchellh
force-pushed
the
kitty-animation
branch
2 times, most recently
from
August 21, 2026 15:08
6924914 to
aa40d53
Compare
mitchellh
force-pushed
the
kitty-animation
branch
from
August 21, 2026 16:46
aa40d53 to
dff13b4
Compare
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.
Fixes #5255
This adds support for the Kitty graphics animation frames (https://sw.kovidgoyal.net/kitty/graphics-protocol/#animation), completely (transmission, control, composition, rendering, etc.).
This does it in a somewhat naive way: we pre-compose all frames and store the full RGBA in-memory. Animation is already rare enough, and I wanted to focus on things working first, so I didn't optimize this very well. I also wanted this PR to be relatively understandable up front. We can add complexity later.
But, this adds very little overhead to a non-animation using Kitty graphics user. The animation state is heap-allocated only when its needed. So, it just costs a pointer sized field on every image. Plus a little bit of overhead in the loading state (which itself is heap allocated during image load only).
On the renderer side, this unifies Kitty graphics animations and custom shader animations into a single animation abstraction. This simplified our renderer thread and made the generic renderer more complicated (slightly, its not much!).
AI usage: Test writing, validation against the spec/reference implementation. I drove the main architecture and shaped out the functions and params, animation storage, etc. I had AI fill in some of the blanks that I spaced out. Commit messages, comments, and this PR message are written by me.
Demo
CleanShot.2026-08-20.at.21.54.07.mp4