remove temp files used by kitty
In order to display images with the Kitty protocol, broot creates temp files at the optimal dimensions and gives them to the terminal.
A problem with this approach is that those images may take a lot of space, especially if you're on linux and never reboot, as the /tmp folder is usually emptied on reboot.
With this commit:
- broot, on quitting, deletes all the temp files it created
- broot has a maximum number of temp files (defined with the
kept_kitty_temp_filesconfig entry) and removes the least recently used one when the max is reached
Just FYI the kitty protocol allows you to tell the terminal emulator to delete the file after it has read the image data.
@kovidgoyal Yes but we don't want to: when scrolling over images you're very likely to need the same image again very soon. And building an image is sometimes expensive, eg when dealing ~~with SVG or~~ huge images.
BTW @kovidgoyal I'm impressed. What's your trick to be notified when kitty is mentionned ? I'd need this superpower too...
github lets you search across their entire database for keywords. I have a custom script that does that for me at an interval and notifies of new issues/prs/discussions for topics I am interested in. But if all you are interested in is one or two topics you can just use the github web frontends search function manually, it works reasonably well and just takes a minute or two a day.