Merged
Conversation
Use the new libghostty APIs from ghostty-org/ghostty#12147 to replace manual logic in render_kitty_images: The iterator layer filter (placement_iterator_set with a GhosttyKittyPlacementLayer) replaces the manual z-index read and switch/case filtering. The placement_viewport_pos call replaces a 3-step viewport origin lookup (grid_ref, point_from_grid_ref, manual subtraction) plus the off-screen and virtual-placement checks. The placement_source_rect call replaces four individual source field reads plus the "0 = full dimension" expansion and bounds clamping. This removes ~70 lines and drops the term_rows parameter from both render_kitty_images and render_terminal.
6f32d6d to
de92501
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.
This brings in the new APIs from libghostty to enable Kitty Graphics supporting Ghostling.
This has very bad performance. The Ghostty part is alright, the issue is our render loop recreates and destroys the 2D image texture on every frame. This was a deliberate choice to keep the implementation simpler, but the performance is terrible if you have many images. 😄
Demo
CleanShot.2026-04-06.at.10.54.14.mp4