junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
63.97k stars 2.37k forks source link

fzf sixels image preview empty on Windows Terminal Preview + pwsh + chafa on Windows #3995

Open ykhan21 opened 1 week ago

ykhan21 commented 1 week ago

Checklist

Output of fzf --version

0.55.0 (fc69308)

OS

Shell

Problem / Steps to reproduce

Windows Terminal Preview now supports sixels. The stable release of Windows Terminal does not yet support it.

Problem:

In pwsh, on Windows Terminal Preview, when you run ls -name *.png | fzf --preview 'chafa -s 50x50 -f sixels {}', the preview window is empty.

Steps:

  1. Get Windows Terminal Preview here: (https://github.com/microsoft/terminal/releases/tag/v1.22.2362.0).
  2. Run scoop install fzf chafa.
  3. Run ls -name *.png | fzf --preview 'chafa -s 50x50 -f sixels {}' in directory that has png files.
lunrenyi commented 1 week ago

I also encountered a similar problem, and I was able to reproduce it on Windows Terminal + gitbash:

echo hello | fzf --preview='type ls'

企业微信截图_17213711123827 企业微信截图_17213711396279

ykhan21 commented 6 days ago

This is issue related to sixels image previews on Windows. Your issue seems to be related to text previews.

Also, I cannot reproduce your issue. See the image below. image This is on Git Bash + Windows Terminal.

What version is your git, fzf, and Windows Terminal? And what font do you use in Windows Terminal?

lunrenyi commented 6 days ago

This is issue related to sixels image previews on Windows. Your issue seems to be related to text previews.

Also, I cannot reproduce your issue. See the image below. image This is on Git Bash + Windows Terminal.

What version is your git, fzf, and Windows Terminal? And what font do you use in Windows Terminal?

ykhan21 commented 5 days ago

This is issue related to sixels image previews on Windows. Your issue seems to be related to text previews. Also, I cannot reproduce your issue. See the image below. image This is on Git Bash + Windows Terminal. What version is your git, fzf, and Windows Terminal? And what font do you use in Windows Terminal?

  • Window version: windows 11 家庭中文版 23H2 22631.4037
  • Git version: 2.42.0.windows.2
  • Windows Terminal version: 1.20.11781.0
  • fzf version: 0.55.0
  • Font: Cascadia Mono

I can't reproduce it with Cascadia Mono. The preview works for me.

junegunn commented 5 days ago

Does it work in non-fullscreen mode? e.g. --height=-1

ykhan21 commented 4 days ago

Yes, ls -name *.png | fzf --height=-1 --preview 'chafa -s 50x50 -f sixels {}' works.

ykhan21 commented 4 days ago

Also, if the image is too large and it is displayed, some residue is left from the large image when you go to a smaller image. Here, I have --height=40%.

  1. Large image: image
  2. Going to a smaller image: image
ykhan21 commented 4 days ago

Yes, ls -name *.png | fzf --height=-1 --preview 'chafa -s 50x50 -f sixels {}' works.

This works, but clicking to select something is broken.

stevenwalton commented 3 days ago

I just saw this issue and I have 2 relevant issues open in the chafa project. See Chafa-#217 and Chafa-#218. Also a issue in wezterm which I think is more related to #3646 and #3486 but I suspect there are underlying issues connecting all of these. There's additional complexity introduced when using ssh and tmux fwiw.

I believe there are overlapping issues with fzf and chafa. Why I came here in the first place was actually to ask about $FZF_PREVIEW_COLUMNS and $FZF_PREVIEW_LINES since these do not appear to be calculated in a way that is compatible with chafa's (though if you read the issue there's some confusion there too).

I'll keep working with the chafa team but it may be good to at least have these cross linked and note that this issue appears to be cross platform.