Skip to content

How to preview images with imgcat on iTerm2? #3609

Discussion options

You must be logged in to vote

According to the changelog1, the imgcat functionality was introduced in version 0.44.0.

Rather than using the iTerm2 imgcat script2, it appears you are using eddieantonio's imgcat3.

  1. Consider updating to version 0.44.0, and
  2. modify the FZF_DEFAULT_OPTS as follows:
    • If you decide to use the iTerm2 imgcat script, please remove the --depth iterm2 flag from the FZF_DEFAULT_OPTS below.
export FZF_DEFAULT_OPTS='
  --bind "ctrl-y:execute-silent(echo {+} | pbcopy)"
  --bind "ctrl-e:execute(echo {+} | xargs -o code)"
  --preview "
  if file --mime-type {} | grep -qF image/; then
    imgcat --depth iterm2 --width $FZF_PREVIEW_COLUMNS --height $FZF_PREVIEW_LINES {}
  else
    bat --theme=TwoDark -…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@glaucocustodio
Comment options

@LangLangBart
Comment options

@junegunn
Comment options

@LangLangBart
Comment options

Answer selected by glaucocustodio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants