Thanks! I did intend to come back to this and do more cleanup, I just got quite busy. So thank you for taking it to the finish. Let me know if there's anything else I can lend a hand with.
Yes, that's a simple mistake, I meant to have it in term.h only. No, it's a protocol constraint, because the terminal itself will need to have a buffer of that size while parsing escape codes. The kitty graphics doc says that everyone should support up to 4096. Interesting. I'll look into it, you're probably on the right track. Or it could be related to the lack of error handling, if something is in a bad state and throwing an error, and it's currently just getting swallowed. Indeed, most terminals...
The animate flag could theoretically be put to better use, because kitty graphics protocol has actual animation support, but I haven't done that yet.
In action: https://vimeo.com/823613499/aab4928b77
WIP - Kitty terminal drivers
Change kittygd to use a gdIOCtx
Add kittygd terminal driver
Add kittycairo terminal driver
Add kitty output-encoding helpers
Refactor base64 functions in write_png_image to take a callback
Change kittygd to use a gdIOCtx
Add kittygd terminal driver
Add kittycairo terminal driver
Add kitty output-encoding helpers
Refactor base64 functions in write_png_image to take a callback