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

errors at installation time. complete: Too many arguments #226

Closed
antoine-gallix opened this issue Feb 18, 2022 · 20 comments
Closed

errors at installation time. complete: Too many arguments #226

antoine-gallix opened this issue Feb 18, 2022 · 20 comments

Comments

@antoine-gallix
Copy link

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

@PatrickF1
Copy link
Owner

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>

@MPritsch
Copy link

MPritsch commented Feb 18, 2022

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 -

@PatrickF1
Copy link
Owner

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

@MPritsch
Copy link

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.

@PatrickF1
Copy link
Owner

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.

@PatrickF1
Copy link
Owner

PatrickF1 commented Feb 18, 2022

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.

@MPritsch
Copy link

MPritsch commented Feb 18, 2022

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

@MPritsch
Copy link

MPritsch commented Feb 18, 2022

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

@PatrickF1
Copy link
Owner

PatrickF1 commented Feb 18, 2022

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.

@PatrickF1
Copy link
Owner

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)

@MPritsch
Copy link

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.

@MPritsch
Copy link

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.

@PatrickF1
Copy link
Owner

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

@PatrickF1
Copy link
Owner

PatrickF1 commented Feb 19, 2022

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?

@MPritsch
Copy link

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.

PatrickF1 added a commit that referenced this issue Feb 19, 2022
Checking fish version is non-obvious as evidenced in #226.

Configuration variables often relevant, such as in #221.

Also stop asking for plugin manager as I've never seen that be relevant and it should only matter when uninstalling the plugin
PatrickF1 added a commit that referenced this issue Feb 19, 2022
Checking fish version is non-obvious as evidenced in #226.

Configuration variables often relevant, such as in #221.

Also stop asking for plugin manager as I've never seen that be relevant and it should only matter when uninstalling the plugin. Plus, only fisher is supported anyway. See #59.
@PatrickF1
Copy link
Owner

@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.

@thiagomajesk
Copy link

+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?

@PatrickF1
Copy link
Owner

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

@thiagomajesk
Copy link

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

@MPritsch
Copy link

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.

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

4 participants