Skip to content
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

Option '--height' destroys results on stdout #2015

Open
5 of 10 tasks
doak opened this issue May 5, 2020 · 4 comments
Open
5 of 10 tasks

Option '--height' destroys results on stdout #2015

doak opened this issue May 5, 2020 · 4 comments

Comments

@doak
Copy link

doak commented May 5, 2020

  • I have read through the manual page (man fzf)
  • I have the latest version of fzf
  • I have searched through the existing issues

Info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • 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).

@doak
Copy link
Author

doak commented May 11, 2020

Perhaps related to #1247.

@Nelyah
Copy link

Nelyah commented Jun 1, 2021

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.

@fernandomora
Copy link

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

@vovcacik
Copy link
Contributor

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.
brokenprint
(recording is 8 fps)

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

No branches or pull requests

4 participants