chase / awrit

A full graphical web browser for Kitty terminal with mouse and keyboard support
Other
431 stars 14 forks source link

Using the animation feature of kitty graphics protocol #15

Closed AnonymouX47 closed 1 year ago

AnonymouX47 commented 1 year ago

Hello!

Found out about your project recently and I seem to like what you're doing so far.

I just dropped by to say some others and I recently had a discussion at https://github.com/hpjansson/chafa/issues/104 on using the animation feature of Kitty graphics protocol and thought it could be really useful and applicable to what you're doing here.

Last I checked, every frame was being transmitted as a separate image (and seems to still be the case)... which isn't really the best (except the images are being deleted) for a streaming (indefinite end) source. I think using the animation feature of the protocol, if supported (currently, only kitty does), would be better.

Another (actually simpler but maybe not as appropriate) approach would be to use two alternating IDs and then delete the image with one ID immediately after displaying the image with the other ID. This would work on any terminal emulator that at least implements image deletion by ID.

By the way, the animation feature also provides a lot of functionality that can improve performance of updates between frames such as "differential" updates.

Thanks and well done! 👍🏾

I feel this would've been more appropriate in a "discussion" but that doesn't seem to be enabled.