wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.32k stars 136 forks source link

`forgit` does not open in a tmux popup window if fzf tmux options are set #303

Open dljsjr opened 1 year ago

dljsjr commented 1 year ago

Check list

Environment info

Problem / Steps to reproduce

I have FZF_TMUX=1 and FZF_TMUX_OPTS='-p60%,80%' set to be exported by my .zshrc. When those are set, the built-in FZF helpers like Alt-C, etc. will default to fzf-tmux instead of fzf. And by setting -p with a tmux version >= 3.2, it uses the popup windows instead of a split:

image

I don't know for sure what the root cause is here, but I'm guessing what's happening here is that forgit is hardcoded to use the fzf binary. It might be nice if forgit could detect FZF_TMUX or FZF_TMUX_OPTS, and if they're set it could behave like the built-in forgit extensions and default to fzf-tmux. This should be safe to do universally, as the fzf README states that fzf-tmux is smart enough to be well behaved if invoked outside of a tmux session:

It will still work even when you're not on tmux, silently ignoring -[pudlr] options, so you can invariably use fzf-tmux in your scripts.