by diacritical 13 hours ago

What setup do you use for seeing image previews (or the images themselves?) on a terminal in Linux?

godelski 5 hours ago | [-0 more]

I use yazi a fair amount but I've also configured fzf to do it. There's a lot of tools to view the images, chafa is a good one.

This definitely should be improved but I honestly don't use fzf that much. I can fix it if you really need something but I'm sure you could find it in the docs or even an LLM could handle this. Requires you to define a few variables, lsd, bat, and chafa

  $ echo $FZF_DEFAULT_OPTS 
  --ansi --preview "if file --mime-type {} | grep -qF image; then chafa --passthrough none -f sixels --size ${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES} {}; elif file --mime-type {} | grep -aF -e directory; then lsd --color always --icon always --almost-all --oneline --classify --long {}; elif file --mime-type {} | grep -aF -e binary; then strings {} | bat --color always --theme=Dracula --language c; elif file --mime-type {} | grep -aF -e text -e json -e empty; then bat --color always --theme=Dracula --style=numbers,grid --line-range :500 {}; fi"
krs_ 11 hours ago | [-0 more]

Not the original poster but possibly lsix[1], which looking at the readme should work in certain terminals on Windows as well but I haven't tried it.

[1] https://github.com/hackerb9/lsix