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 to set fzf binary #7

Open
wshanks opened this issue Sep 3, 2020 · 3 comments
Open

Option to set fzf binary #7

wshanks opened this issue Sep 3, 2020 · 3 comments

Comments

@wshanks
Copy link

wshanks commented Sep 3, 2020

I have a problem using fzf-tmux with xonsh. I am not actually sure what the problem is but when I call fzf-tmux inside of a tmux session started from xonsh a window opens, some kind of traceback appears, and then the window disappears before I can read it. I had never tried to use fzf-tmux before using this xontrib, so this problem had never bothered me. With the published xontrib, the key bindings don't work inside of tmux for me because they try to use the problematic fzf-tmux. #1 fixes the problem for me but only because it introduced a bug that prevents fzf-tmux from ever being used. This line:

if 'TMUX' in ${...} and $(which fzf_tmux_cmd):

should really be:

    if 'TMUX' in ${...} and $(which @(fzf_tmux_cmd)):

What would your preference be for addressing this? I can think of three options:

  1. Remove all support for fzf-tmux. Just use fzf.
  2. Replace fzf-tmux support with a $fzf_bin variable that when set is used instead of fzf (then the user could choose between fzf and fzf-tmux in .xonshrc).
  3. Retain fzf-tmux support but also implement the $fzf_bin variable which would override it.

What I hope you don't choose is just to implement the @(...) fix I described above because that will lead to the xontrib always using (the broken, for me) fzf-tmux instead of fzf inside of tmux.

@laloch
Copy link
Owner

laloch commented Sep 3, 2020

@willsALMANJ, thanks for reporting. I'll try to investigate what the problem with fzf-tmux is first.

@laloch
Copy link
Owner

laloch commented Sep 5, 2020

See junegunn/fzf#2166. Do you still think we need a fix other than $(which @(fzf_tmux_cmd))?

@brechtm
Copy link

brechtm commented Nov 29, 2022

Note that when fzf_tmux_cmd is not available, this xontrib will output the following on every fzf call:

fzf_tmux_cmd not in $PATH or xonsh.builtins.aliases

This can be fixed by suppressing the which output in fzf-widgets.sh:

    if 'TMUX' in ${...} and $(which @(fzf_tmux_cmd) err>/dev/null):

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

3 participants