Skip to content

fzf sixel support on Windows #4399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 of 10 tasks
FallenGameR opened this issue May 24, 2025 · 2 comments
Open
4 of 10 tasks

fzf sixel support on Windows #4399

FallenGameR opened this issue May 24, 2025 · 2 comments
Labels

Comments

@FallenGameR
Copy link

Checklist

  • I have read through the manual page (man fzf)
  • I have searched through the existing issues
  • For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

0.62.0 (d226d84)

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

I think this is the same bug as #3682, but I can add more context and it is not really related to Wezterm / bash. Looks like it is just the way how fzf processes sixels on Windows. And there is a working go code that can do it =)

Repro in pwsh 7.5.1, WindowsTerminal 1.22.11141:

# no sixels
".\wallpapersden.com_curse-by-wlof_1920x1080.jpg" | fzf --preview "chafa {}"

Image

# with sixels
".\wallpapersden.com_curse-by-wlof_1920x1080.jpg" | fzf --preview "chafa {} -f sixel --passthrough auto"

Image

# Chafa sixels work
chafa .\wallpapersden.com_curse-by-wlof_1920x1080.jpg -f sixel --passthrough auto

Image

What makes it interesting is that another TUI tool written in Go actually can render sixels on Windows. https://github.com/gokcehan/lf

» bat C:\Users\alexk\AppData\Local\lf\lfrc
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: C:\Users\alexk\AppData\Local\lf\lfrc
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ set previewer C:\\Users\\alexk\\Documents\\Powershell\\Data\\Winget\\preview.bat
   2   │ set sixel
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
» bat C:\Users\alexk\Documents\Powershell\Data\Winget\preview.bat
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: C:\Users\alexk\Documents\Powershell\Data\Winget\preview.bat
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ @chafa.exe -f sixel --passthrough auto %*
───────┴─────────────────────────────────────────────────────────────────────────────────────────
» lf

Image

@georgejean
Copy link

georgejean commented May 27, 2025

Related to issue #3995.
As a workaround, you can specify the --height option with fzf and adjust the --view-size parameter for chafa. For instance, use --preview='chafa --view-size=18 -f sixel input.jpg'.

Image

@junegunn
Copy link
Owner

Thanks @georgejean for linking the issue.

So we can either fix #3799 in LightRenderer and drop the tcell renderer, or extend the tcell renderer to support image rendering. Since I'm not a Windows user and lack expertise in the platform, I probably won't be working on either, but pull requests are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants