Skip to content

kitty graphics: animation support - #13943

Merged
mitchellh merged 9 commits into
mainfrom
kitty-animation
Aug 21, 2026
Merged

mitchellh merged 9 commits into
mainfrom
kitty-animation

Conversation

@mitchellh

@mitchellh mitchellh commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

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

@mitchellh
mitchellh requested review from a team as code owners August 21, 2026 04:54
@mitchellh mitchellh added this to the 1.4.0 milestone Aug 21, 2026
@mitchellh
mitchellh force-pushed the kitty-animation branch 2 times, most recently from 6924914 to aa40d53 Compare August 21, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kitty Graphics: Support Animation Frames

1 participant