feat: Add Kitty graphics protocol support for image pasting #89
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.
Summary
Adds support for the Kitty graphics protocol to enable image pasting in Ghostty and other terminals that use Kitty protocol instead of iTerm2's OSC 1337.
Problem
Image pasting doesn't work in Ghostty terminal because Ghostty uses the Kitty graphics protocol, not the iTerm2 OSC 1337 protocol that Letta Code currently supports.
Solution
Added detection and parsing for Kitty graphics protocol escape sequences:
ESC _Ga=T,f=100;<base64-data>ESC\a=T: direct transmission modef=format: image format (100=PNG, 32=RGBA, 24=RGB)Supported Image Paste Formats (Updated)
data:image/png;base64,...file://URLsTerminal Compatibility
Testing
Implementation Details
The Kitty protocol detector:
ESC _G<params>;<base64>ESC\a=T,f=100)a=T)👾 Generated with Letta Code