Repository navigation
kitty graphics: support relative placements - #13939
Merged
Merged
Conversation
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.
This adds full support for relative placements: https://sw.kovidgoyal.net/kitty/graphics-protocol/#relative-placements (
R=andQ=). The high-level description is that this allows images to be placed relative to other images. For more details, the spec explains it better than I can, or the demo video below.The implementation here was pretty straightforward. It mainly revolved around adding parent resolution logic to puts (and validation), and proper unparented placement reaping in the right points, and then the various tests around that. The renderer logic itself was also straigthforward, I had to add some offset resolution to the core graphics storage but we can reuse that. The main complexity -- as always -- (MY OWN EMDASHES) is Unicode placeholders. But... also not too hard.
After this, the only feature we don't support from the protocol is animation.
AI usage: Test writing, validation against spec/reference, judging, and some "fill in the function/block". I setup the overall shape of the implementation.
Demo
Ghostty on the left, Kitty on the right
CleanShot.2026-08-20.at.15.21.25.mp4