kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.4k stars 150 forks source link

imgcat with joshuto image preview #367

Closed noahlias closed 1 year ago

noahlias commented 1 year ago

I want to preview image in Mac iTerm, and there is an Shell Integration Command imgcat to preview.

So I configured the mimetype.toml and preview_file.sh mimetype.toml:

image

_previewfile.sh:

image

but it didn't work.

asciicast

DLFW commented 1 year ago

If you want “image preview” for your files, you're digging in the completely wrong corner.... 😆

mimetype.toml has nothing to do with image previews and the preview-script for the text previews has only a little to do with image previews. Have your read the docs on image thumbnails? You need to use some “hook scripts” to display images for the hovered files. mimetype.toml is only for opening files. Completely different story....

noahlias commented 1 year ago

If you want “image preview” for your files, you're digging in the completely wrong corner.... 😆

mimetype.toml has nothing to do with image previews and the preview-script for the text previews has only a little to do with image previews. Have your read the docs on image thumbnails? You need to use some “hook scripts” to display images for the hovered files. mimetype.toml is only for opening files. Completely different story....

😢 ,I try it with the image thumbnails, but it didn't work on mac iterm.

DLFW commented 1 year ago

I try it with the image thumbnails, but it didn't work on mac iterm.

Which does not change the fact that editing mimetype.toml will bring you nowhere.

I recently added a description on how to use Überzug++ for previews. And the projects website tells me that it supports iterm2. So, if I would be in your place, I would try to get Überzug++ running first. Once that's working, I would read the image-preview-docs here once more carefully and try to get it running by adapting the Überzug++ recipe for the iterm backend.

I'm not a Mac user. Guess that's all help I can give you from my side.