Open atsepkov opened 5 years ago
@atsepkov It's a great idea. I've been thinking how to achieve it once I saw this, but seems no easy way with skim. Here are the obstacles:
The difficult part is actually the second part in that skim needs to treat some output differently. I don't know how fzf achieve this, but IMO there was no simple way.
Anyway, I'll keep thinking and I do think it would be nice to have this.
There is a rust crate viu that can show images in the terminal if that is helpful.
There are a few image formats supported by terminals: sixel, iTerm2 (imgcat), and most-recent one by Kitty (https://sw.kovidgoyal.net/kitty/graphics-protocol.html). Each of these works by sending a special escape sequence to the terminal, similar to the ANSI codes used for colors.
These sequences are still not standardized, but that is technically for end-user to deal with. What is standardized is the ESC prefix they all use, which currently seems to get stripped by skim based on a quick test I did. Would it be possible to add support for this for preview window (by forwarding the ESC code to the terminal)? It could even be hidden behind a special flag, similar to
--ansi
, such as--extended-esc-codes
.The main benefits of this would be:
One example of the 2nd bullet is my own project that currently uses FZF but considering a change to Skim due to easier customization and ability to configure key interaction: https://github.com/atsepkov/Graphene. Image support would allow webpage previews, as well as better representation of image-based search results (such as an Amazon product search).