yorukot / superfile

Pretty fancy and modern terminal file manager
https://superfile.netlify.app
MIT License
5.69k stars 126 forks source link

feature: file preview #26

Open Serpentian opened 5 months ago

Serpentian commented 5 months ago

It'd be great, if superfile could preview files, like ranger does. At least text files

pcause commented 4 months ago

This app looks very interesting. If you add preview, how about reusing scope.sh that ranger uses.

vsedov commented 4 months ago

Image preview can use similar protocols utilised by Yazi.

yorukot commented 4 months ago

Image preview: https://github.com/yorukot/Termage Create a golang package for previewing files. Contributions are welcome

Platform Protocol Status
kitty Kitty unicode placeholders
Konsole Kitty old protocol
iTerm2 Inline images protocol
WezTerm Inline images protocol
Mintty (Git Bash) Inline images protocol
foot Sixel graphics format
Ghostty Kitty old protocol
Black Box Sixel graphics format
VSCode Inline images protocol
Tabby Inline images protocol
Hyper Inline images protocol
yorukot commented 4 months ago

https://github.com/yorukot/superfile/assets/107802416/68702cc0-e8ac-41e6-89b3-df6c67d3655f

A quick update. The text file preview is now complete. I was actually going to start with the image preview, but it's a bit hard... So I may need more time, or if anyone has experience writing image previews feel free to contribute!

pcause commented 4 months ago

why not just invoke chafa or viu and pass it dimensions to use.

yorukot commented 4 months ago

why not just invoke chafa or viu and pass it dimensions to use.

As far as I know, it's not that simple. :(

pcause commented 4 months ago

I know that both ranger and vifm do image preview with chafa. you could look at their code to see how they do it.

dr3mro commented 4 months ago

Ctpv is good for that we can use it and it's fast as it's written in C

AnshumanNeon commented 3 months ago

@yorukot can we integrate c or c++ tools for image preview? we can use ueberzugpp, it is a continuation of ueberzug and is in c++ as it's pretty fast. also why are we making a custom file previewer?

yorukot commented 3 months ago

For now, I can definitely accept the use of third-party software, but even so, I still don't know how to do it...

AnshumanNeon commented 3 months ago

@yorukot i have an idea. maybe we can use image previewing as a plugin for superfile. In the plugin we can put ueberzugpp to be a dependency that has to be either manually installed by the user or we will install by ourselves. then the image preview can use ueberzugpp by running the command. like exec.cmd or something like that

sachinsenal0x64 commented 2 months ago

Image preview: https://github.com/yorukot/Termage Create a golang package for previewing files. Contributions are welcome Platform Protocol Status kitty Kitty unicode placeholders ❌ Konsole Kitty old protocol ❌ iTerm2 Inline images protocol ❌ WezTerm Inline images protocol ❌ Mintty (Git Bash) Inline images protocol ❌ foot Sixel graphics format ❌ Ghostty Kitty old protocol ❌ Black Box Sixel graphics format ❌ VSCode Inline images protocol ❌ Tabby Inline images protocol ❌ Hyper Inline images protocol

Pixel, which is written in Go. You may be able to integrate it. https://github.com/sachinsenal0x64/pixel

image

AnshumanNeon commented 2 months ago

hmm, it looks good. I think we can integrate it considering that we can customize the size and position of the image to be rendered. let's see to yorukot