Aloxaf / fzf-tab

Replace zsh's default completion selection menu with fzf!
MIT License
3.13k stars 93 forks source link

[BUG] Using `--tmux` in an exported `FZF_DEFAULT_OPTS` breaks `ftb-tmux-popup` #455

Open andrewbraxton opened 1 month ago

andrewbraxton commented 1 month ago

Describe the bug

Using --tmux in an exported FZF_DEFAULT_OPTS breaks ftb-tmux-popup. Weird thing is that it seems to stay broken even if you unset FZF_DEFAULT_OPTS.

I can make sure:

To Reproduce

  1. Enter tmux
  2. Type ls (or anything)
  3. Press Tab
  4. Popup flashes briefly and disappears

Expected behavior

Popup appears normally and allows selection

Environment:

Minimal zshrc

autoload -Uz compinit
compinit

export FZF_DEFAULT_OPTS='--tmux'

source ~/.fzf-tab/fzf-tab.plugin.zsh
zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup
cameronbrill commented 1 month ago

I am also running into this issue. Removing export FZF_DEFAULT_OPTS='--tmux' and restarting the tmux session fixes ftb-tmux-popup, but this is un-ideal as that (obviously) disables the tmux popup for fzf when doing a deep-fuzzy search (e.g. ls ./fuzz** <tab> will not open a tmux popup and will instead produce output below the prompt).

cameronbrill commented 1 month ago

interestingly, if I remove export FZF_DEFAULT_OPTS='--tmux' from my zshrc, start a tmux session, add export FZF_DEFAULT_OPTS='--tmux' to my zshrc, then run zsh to restart the shell, both ftb-tmux-popup and the fzf tmux popup work as intended

andrewbraxton commented 1 month ago

Yeah, I ran a bunch of the same experiments and got similar confusing results.

itahol commented 2 weeks ago

I have the same problem, but I couldn't resolve it even when trying your trick. Did you figure this out?

itahol commented 2 weeks ago

My current workaround is editing ftb-tmux-popup so it runs fzf without "--tmux" in its opts, like so:

echo -E "env SHELL=$ZSH_NAME FZF_DEFAULT_OPTS=$BASE_FZF_DEFAULT_OPTS $commands[fzf] ${(qq)fzf_opts[@]} < $tmp_dir/completions.$$ > $tmp_dir/result-$$" > $tmp_dir/fzf-$$

Seems to do the job.

chris4prez commented 3 days ago

I'm also seeing this issue as well. My current workaround is to alias fzf='fzf --tmux=80%' while keeping the rest of my config defined on FZF_DEFAULT_OPTS