junegunn / fzf

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

Using --height causes fzf to not display until pressing enter twice #1574

Open brailsmt opened 5 years ago

brailsmt commented 5 years ago

fzf version: 0.18.0 (brew) TERM: xterm-256color (behavior persists when TERM is changed to "screen") terminal: iTerm2 build 3.0.15

I am running bash within tmux. I am trying to define the following function. If I remove the --height option, the display is immediate. When I add the --height option I have to hit enter twice before the selection display shows. fzf-tmux ignores the --height option, but displays the selection screen immediately. I have iterated many times on the definition of the function to alleviate the problem, including standard pipe redirection and the current version, below. I have tried with and without a --query. Nothing I have tried will get the selection screen to display until I press enter twice.

fcd() {
  DIR=`fzf --ansi --reverse --height 20%  < <(find * -type d -print 2> /dev/null | grep -v target)` \
    && cd "$DIR"
}
junegunn commented 5 years ago

I cannot reproduce the problem.

  1. Do you have the same issue when you're not on tmux?
  2. Is the problem still reproducible when you start bash without any configuration? i.e. bash --norc