fzf
fzf copied to clipboard
Option '--height' destroys results on stdout
- [x] I have read through the manual page (
man fzf
) - [x] I have the latest version of fzf
- [x] I have searched through the existing issues
Info
- OS
- [x] Linux
- [ ] Mac OS X
- [ ] Windows
- [ ] Etc.
- Shell
- [x] bash
- [ ] zsh
- [ ] fish
Problem / Steps to reproduce
If running e.g. fzf --height=30% --bind=alt-enter:"execute(echo TEST)"
and hitting alt-enter
, the text TEST
is not printed although the command seems to be executed (can be tested with e.g. touch
).
It works without the option --height
. It also works if stdout is piped to a file directly (fzf [...] >/tmp/testfile
), but it does not work if piped through cat
(fzf [...] | cat
).
Perhaps related to #1247.
Hi, I spend some time today debugging this and came to the same observation as this issue.
@doak did you manage to find a workaround this (besides redirecting fzf
's output?)
I think that the reason it works when redirecting to a file vs. to stdout
is because in the latter case the output actually gets printed but it immediately gets overwritten by fzf
trying to maintain the --height
argument.
Same problem here:
❯ echo -n "Select an option: " && seq 10 | fzf --height 30%
4
❯ echo -n "Select an option: " && seq 10 | fzf
Select an option: 4
It seems --height
is performing some carriage return internally than clears current line
Does not seems to be an issue on Windows. When switching to light renderer (i.e. height <=99), there is some garbage (maybe some escape code) printed before the text, but that's it.
(recording is 8 fps)