PatrickF1 / fzf.fish

🔍🐟 Fzf plugin for Fish

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

errors at installation time. `complete: Too many arguments`

antoine-gallix opened this issue · comments

Before proceeding...

Describe the bug

At installation time I get a lot of errors about the use of fish's complete function

Steps to reproduce

Environment

Versions installed:

  • fish, version 3.3.1
  • fzf.fish: 8.0.1
  • fisher, version 4.3.1
  • terminal: Konsole Version 21.08.1
  • OS: Ubuntu 21.10

Additional context

Here are the errors:



complete: Too many arguments

~/.config/fish/completions/fzf_configure_bindings.fish (line 1): 
complete fzf_configure_bindings --no-files
^
from sourcing file ~/.config/fish/completions/fzf_configure_bindings.fish
        called on line 176 of file ~/.config/fish/functions/fisher.fish
in function 'fisher' with arguments 'install PatrickF1/fzf.fish'

(Type 'help complete' for related documentation)
complete: Too many arguments

~/.config/fish/completions/fzf_configure_bindings.fish (line 2): 
complete fzf_configure_bindings --long help --short h --description "Print help"
^
from sourcing file ~/.config/fish/completions/fzf_configure_bindings.fish
        called on line 176 of file ~/.config/fish/functions/fisher.fish
in function 'fisher' with arguments 'install PatrickF1/fzf.fish'

(Type 'help complete' for related documentation)
complete: Too many arguments

~/.config/fish/completions/fzf_configure_bindings.fish (line 3): 
complete fzf_configure_bindings --long directory --description "Change the key binding for searching directory"
^
from sourcing file ~/.config/fish/completions/fzf_configure_bindings.fish
        called on line 176 of file ~/.config/fish/functions/fisher.fish
in function 'fisher' with arguments 'install PatrickF1/fzf.fish'

(Type 'help complete' for related documentation)
complete: Too many arguments

~/.config/fish/completions/fzf_configure_bindings.fish (line 4): 
complete fzf_configure_bindings --long git_log --description "Change the key binding for searching git log"
^
from sourcing file ~/.config/fish/completions/fzf_configure_bindings.fish
        called on line 176 of file ~/.config/fish/functions/fisher.fish
in function 'fisher' with arguments 'install PatrickF1/fzf.fish'

(Type 'help complete' for related documentation)
complete: Too many arguments

~/.config/fish/completions/fzf_configure_bindings.fish (line 5): 
complete fzf_configure_bindings --long git_status --description "Change the key binding for searching git status"
^
from sourcing file ~/.config/fish/completions/fzf_configure_bindings.fish
        called on line 176 of file ~/.config/fish/functions/fisher.fish
in function 'fisher' with arguments 'install PatrickF1/fzf.fish'

(Type 'help complete' for related documentation)
complete: Too many arguments

~/.config/fish/completions/fzf_configure_bindings.fish (line 6): 
complete fzf_configure_bindings --long history --description "Change the key binding for searching history"
^
from sourcing file ~/.config/fish/completions/fzf_configure_bindings.fish
        called on line 176 of file ~/.config/fish/functions/fisher.fish
in function 'fisher' with arguments 'install PatrickF1/fzf.fish'

(Type 'help complete' for related documentation)
complete: Too many arguments

~/.config/fish/completions/fzf_configure_bindings.fish (line 7): 
complete fzf_configure_bindings --long variables --description "Change the key binding for searching variables"
^
from sourcing file ~/.config/fish/completions/fzf_configure_bindings.fish
        called on line 176 of file ~/.config/fish/functions/fisher.fish
in function 'fisher' with arguments 'install PatrickF1/fzf.fish'

(Type 'help complete' for related documentation)
Installed 1 plugin/s

Hi @antoine-gallix! Wow never seen this and I'm not even able to make complete output complete: Too many arguments even by typing in bad commands. Despite this problem, are you able to use tab completion for fzf_configure_bindings. i.e. what happens if you type fzf_configure_bindings -<TAB>

Hello, I had the same problem (using wsl2). When I type fzf_configure_bindings I get the following error:

Invalid option or a positional argument was provided.
<Usage-information-summary>

Nothing happens when I try to tab after fzf_configure_bindings -

Do either of you still see the errors when you open a new fish shell?

Yes, when I open a new one and it spammed the error on startup. Although I have a wrapper script on every launch which could be responsible for that.

Okay that's probably because fish sources all the completions at start up https://fishshell.com/docs/current/completions.html#where-to-put-completions. In the meantime, you may want to manually delete those completions so you don't see the errors anymore.
I really don't understand what is going on if you are on fish 3.3.1. Let me check if there is a difference in complete based on the OS.

Ok I have an idea but it'll require a bit of work from one of you. Can you go into your ~/.config/fish/completions/fzf_configure_bindings.fish and insert -C right before each instance of fzf_configure_bindings? Basically, they should all look like complete -C fzf_configure_bindings ____ after. Then try opening a new fish and let me know if the error changes.

I changed it and got the same error as before. I just checked and I'm using fish 3.3.1

Interestingly on my Mac I don't have the error. Just on WSL2. Both use fish 3.3.1

Thanks for providing that observation! It seems this may be a fish-shell OS compatibility issue. Or maybe this issue sheds some light? fish-shell/fish-shell#7822 It suggests the possibility of an older version of fish installed but I have no idea how that works.

I have asked fish-shell gitter about the OS compatibility thing: https://gitter.im/fish-shell/fish-shell?at=620fdc776e4c1e1c846fab73.

Oops I just realized I gave you wrong instructions above when I said to

insert -C right before each instance of fzf_configure_bindings

That was a typo. It needs to be -c. Serves me right for using the short form instead of the long form (--command)

Thanks for providing that observation! It seems this may be a fish-shell OS compatibility issue. Or maybe this issue sheds some light? fish-shell/fish-shell#7822 It suggests the possibility of an older version of fish installed but I have no idea how that works.

That issue looks to be close. fish --version outputs 3.3.1 but echo $version gives me 3.1.0. Going to check the the suggested solution of the issue next.

Oops I just realized I gave you wrong instructions above when I said to

insert -C right before each instance of fzf_configure_bindings

That was a typo. It needs to be -c. Serves me right for using the short form instead of the long form (--command)

Sadly this changed nothing.

OK, so apparently I had fish 3.1.0 at /usr/bin/fish and the newest 3.3.1 at /home/linuxbrew/.linuxbrew/bin/fish.
I guess I originally installed fish via curl -L https://get.oh-my.fish, forgot about it and updated it via brew.
I fixed it by removing /usr/bin/fish and creating a symlink instead sudo ln -s /home/linuxbrew/.linuxbrew/bin/fish /usr/bin/fish. Without the symlink no other shell would launch, so I needed to be carefull haha. Apparently some startup script requires that path and crashes without it.
The plugin works for me now, thanks for the assistance.

Woohoo! @antoine-gallix could you try replicating what @MPritsch did and let me know if the issue is resolved for you?

OK, so apparently I had fish 3.1.0 at /usr/bin/fish and the newest 3.3.1 at /home/linuxbrew/.linuxbrew/bin/fish.
I guess I originally installed fish via curl -L https://get.oh-my.fish, forgot about it and updated it via brew.

I'm trying to understand how is it that if the fish shell version is actually 3.1 why would fish --version output 3.3? Is it the case that the first fish in PATH is 3.3 but the fish that your terminal was configured to use the /usr/bin/fish which is 3.1?

My guess is that both fish versions were in my path, but the one from brew (3.3.1) was written last and therefore used. This wouldn't be a problem in any case other than some startup script using the direct path to /use/bin/fish. Maybe the command which is used by chsh is the key here. I can check on monday.

@antoine-gallix Fabian on gitter helpfully pointed out since you are on Ubuntu, your fish shell being opened up by your terminal is probably 3.1.2.

+1 Had this problem today with fish 3.1.0 in a fresh installation of Ubuntu 20.04 in WSL2, what you be the solution?

Hi @thiagomajesk, fzf.fish requires fish >= 3.2.0 so the solution is to make sure you are using a proper version.

Thanks for the response @PatrickF1, completely missed that information on the README 😅.

OK, so apparently I had fish 3.1.0 at /usr/bin/fish and the newest 3.3.1 at /home/linuxbrew/.linuxbrew/bin/fish.
I guess I originally installed fish via curl -L https://get.oh-my.fish, forgot about it and updated it via brew.

I'm trying to understand how is it that if the fish shell version is actually 3.1 why would fish --version output 3.3? Is it the case that the first fish in PATH is 3.3 but the fish that your terminal was configured to use the /usr/bin/fish which is 3.1?

Just confirmed. My $SHELL Variable points to /usr/bin/fish. But in my $PATH /home/linuxbrew/.linuxbrew/bin is in front of /usr/bin, which means it has a higher priority.
I think this explains the behavior perfectly.