New kitty image backend#74
Conversation
|
Ok, here are some (not-fully-representative) numbers from the current benchmarks (none of which show regressions over main): The I also think these numbers don't fully represent the improvements, just by virtue of how much faster tdf clearly is when I'm using it now. I can just hold down the right arrow, even in heavy PDFs, and it pages through without stuttering at all (whereas previously it would be taking ~400ms to load each page). I'll try to get some whole-system benchmarks that can accurately measure just paging through an entire pdf, thus also considering how long the terminal takes to render. |
|
Also TODO: fix the help page |
|
Also, we should make sure this still works correctly when using tdf remotely. I don't know if there's any sure-fire way to detect when the tty is remote (since you could be using mosh, ssh, or any other protocol to do so) but |
|
The kitty graphics protocol itself allows you detect if you share a filesystem/shared memory witht heterminal emulator. Use that and you will be robust against all such situations which include remote systems, containers, etc. |
As far as I can tell, the method of detecting shared fs/memory doesn't actually distinguish between an shm just not existing vs. not sharing fs/memory at all. In my tests, running This obviously isn't too bad - if we mistakenly think that we're on a remote computer when we're actually local, everything will still work fine, albeit a bit slower. I just want to make sure I'm not missing some part of the protocol that allows me to actually distinguish between a non-existent shm and a remote computer. |
|
On Mon, Jun 09, 2025 at 04:04:58PM -0700, June wrote:
itsjunetime left a comment (itsjunetime/tdf#74)
> The kitty graphics protocol itself allows you detect if you share a filesystem/shared memory witht heterminal emulator
As far as I can tell, the method of detecting shared fs/memory doesn't actually distinguish between an shm just not existing vs. not sharing fs/memory at all. In my tests, running `echo -en "\e_Gi=3948,a=q,t=s,s=1,v=1;$(echo -n "this_is_a_file" | base64)\e\\"` results in the same reported error code on both a remote computer vs a local one.
You create the shm, a simple dummy four byte one for instance and then
transmit its name. Same for files.
|
2a7cda1 to
ad4b799
Compare
…'s limits for how big of an image to display
e73e4f7 to
196f7fb
Compare
|
Alright, I'm happy enough to merge this and push another release. |
Alright, this one is beautiful (once I finish all the final pieces). It replaces, when using a kitty-supporting terminal, the ratatui-image image renderer with a new one I built called
kittage. This supports a ton more than ratatui-image, including:Things still to do:
So this isn't quite ready for prime time yet, but I'm very happy with it so far. I'm hoping to run some benchmarks soon to see if we can get numbers on the performance improvement. And who knows, if it goes well here maybe I'll try to get it into
ratatui-imageoryazias their backends for displaying kitty images.