Closed ian-howell closed 9 months ago
I've found that removing these 3 lines fixes the issue. I'd make a PR, but I honestly have no idea how any of this stuff works, so I imagine there's a reason for these lines:
Your fzf ui is not displaying correctly. When the tmux popup is shown above the cursor, the fzf prompt should be at the bottom, then 'tab' behavior conforms to expectations. But in your screenshot, the fzf prompt is always at the top.
Have you ever set FZF_DEFAULT_OPTS
anywhere?
Thanks for the quick response.
Yes, you're probably right. I'd forgotten that even though I was testing with the minimal zshrc, the FZF_DEFAULT_OPTS
is exported, so it was getting passed to the child zsh shells.
I have this in my .zshrc:
export FZF_DEFAULT_OPTS="--height 40% --layout=reverse"
I will toy with it some more when I'm next at my keyboard. I'm going to leave this bug open until then (unless you're confident enough to close it).
Unfortunately, it doesn't seem like that was it. I unset FZF_DEFAULT_OPTS
and still saw the undesirable behavior. I tried a handful of different settings, as well as returning all of fzf's variables to default.
For what it's worth, I can't replicate this behavior using just fzf (nor it's ctrl-t or alt-c). The issue only occurs when I hit the TAB key and start fzf-tab.
Very strange.
Can you replicate this behavior with tmux popup -E 'seq 10 | fzf'
?
And how about change this line to fzf_opts+=(--bind=tab:up,btab:down --layout=default)
and try again?
I tried out tmux popup -E 'seq 10 | fzf'
, but it doesn't look like the TAB key works there by default...
However I do have some success with fzf_opts+=(--bind=tab:up,btab:down --layout=default
. The popup still appears above the cursor, the first selection is at the bottom of the list, and TAB causes the cursor to move up the list:
This is much better, I would be ok with calling this an acceptable fix.
The behavior when I'm in the top tmux pane is the same as before (which is desired).
Describe the bug
Using
ftb-tmux-popup
, when I hit tab with the cursor at the top of the screen, the popup appears underneath the cursor, and TAB key presses cause the selection to progress down the list. This is the expected behavior.However if I am focused on a tmux pane that doesn't touch the top of the screen, the ordering is reversed - TAB key presses cause the selection to first wrap around to the bottom of the list, and subsequent presses cause the selection to move up the list.
Maybe worth noting - ctrl-n and ctrl-p work flawlessly in both cases.
See the attached GIF, it probably does a better job of explaining the behavior than I can express in english:
I can make sure:
compinit
Minimal zshrc
Log