Images in preview are smaller than they should be
- Dominant language
- Go
- Stars
- 83k
- Forks
- 2.9k
- Avg merge
- 17h 8m
- Merged PRs (30d)
- 10
Description
### Checklist
- [x] I have read through the manual page (`man fzf`)
- [x] I have searched through the existing issues
- [x] For bug reports, I have checked if the bug is reproducible in the latest version of fzf
### Output of `fzf --version`
0.67.0 (2ab923f3)
### OS
- [x] Linux
- [ ] macOS
- [ ] Windows
- [ ] Etc.
### Shell
- [x] bash
- [x] zsh
- [ ] fish
### Problem / Steps to reproduce
Using Windows Terminal to access my Unraid server, images are previewed incorrectly. They are smaller than they should be, even though the preview appears to be receiving the correct $FZF_PREVIEW_COLUMNSx$FZF_PREVIEW_LINES. The below is with a blank .zshrc and .profile, with the command `fzf --preview 'fzf-preview.sh {}'`. I added some echo commands to the fzf-preview.sh to show that there seems to be a padding around the image, at least at the bottom? It only happens with images. Previewing a text file does not have extra padding. I also echoed `$dim` before the image to show the $FZF_PREVIEW_COLUMNSx$FZF_PREVIEW_LINES that the preview is receiving. Using bash gives the same behavior as in zsh.
This doesn't happen when viewing the same folder locally on my Windows machine, even though it's still through Windows Terminal and zsh.
#### Windows Terminal -> ssh unraid -> zsh:
#### Windows Terminal -> zsh:
#### Versions:
Windows Terminal Preview Version: 1.24.2682.0
`chafa --version`: Chafa version 1.18.0
`zsh --version`: zsh 5.8 (x86_64-slackware-linux-gnu)
`bash --version`: GNU bash, version 5.3.3(1)-release (x86_64-slackware-linux-gnu)
Unraid version: 7.2.3
`cat /proc/version`: Linux version 6.12.54-Unraid (root@Develop) (gcc (GCC) 15.2.0, GNU ld version 2.45-slack151) #1 SMP PREEMPT_DYNAMIC Tue Oct 21 15:58:46 PDT 2025
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue with `fzf --preview 'fzf-preview.sh {}'` over SSH from Windows Terminal, comparing image and text previews and the reported `$FZF_PREVIEW_COLUMNSx$FZF_PREVIEW_LINES`. Start by tracing fzf's preview handling and the `fzf-preview.sh` image path with chafa. Done means images render at the expected size without the extra padding seen in the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, go, shell, zsh
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100