PatrickF1 / fzf.fish

🔍🐟 Fzf plugin for Fish

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`fzf_confgure_bindings` error on fresh install

eightbitraptor opened this issue · comments

Describe the bug
Every time my shell starts, I see the error message "Invalid option or a positional argument was provided" followed by the usage instructions for fzf_configure_bindings.

This also happens with any manual invocation of fzf_configure_bindings. Including with no arguments.

To Reproduce

  • Open a new terminal
  • run fzf_configure_bindings

Expected behavior
I expect fzf.fish to have configured the default set of keybindings silently

Screenshots
Screenshot_20210616_100559

Environment

  • Fish: 3.1.2
  • fzf.fish: latest HEAD, as installed using fisher install PatrickF1/fzf.fish
  • plugin manager: fisher 4.3.0
  • terminal: Konsole v20.12.3
  • OS: Ubuntu 21.04

Additional context

I can also replicate this on my WSL2 installation (Ubuntu 20.04 running on Windows 10) but not on my MacBook Pro (macOS 11.4) - on the mac fisher update updates fzf to version 7, I see the warning about keybindings and the instruction to read the migration guide. But then fish (and fzf.fish) work as expected with the default keybindings.

Can you try upgrading to fish 3.2.0 or higher? That's actually the basic minimum version required for fzf.fish. And yes, I make use of all the new features.

Thanks for taking a look at this. I just updated to 3.2.2 using the fish maintainers PPA here: https://launchpad.net/~fish-shell/+archive/ubuntu/release-3 and I'm still seeing the same behaviour :(

Oh wow I'm pretty stumped then. This is going to be a hard one to debug. You're not automatically executing fzf_configure_bindings in your config.fish or another config file, are you?

I don't think so - this is a clean install on a new machine, and I use minimal plugins. Here is the total config I have so far:

config.fish

mattvh@deunan:~$ cat .config/fish/config.fish 
status --is-interactive; and rbenv init - fish | source

fish_plugins

mattvh@deunan:~$ cat .config/fish/fish_plugins 
jorgebucaran/fisher
danhper/fish-ssh-agent
PatrickF1/fzf.fish

Everywhere that fzf_configure_bindings appears in my .config/fish directory:

mattvh@deunan:~$ grep -R fzf_configure_bindings .config
.config/fish/conf.d/fzf.fish:# # This variable is global so that it can be referenced by fzf_configure_bindings and in tests
.config/fish/conf.d/fzf.fish:fzf_configure_bindings
.config/fish/conf.d/fzf.fish:    functions --erase _fzf_uninstall _fzf_migration_message _fzf_uninstall_bindings fzf_configure_bindings
.config/fish/functions/fzf_configure_bindings.fish:function fzf_configure_bindings --description "Installs the default key bindings for fzf.fish with user overrides passed as options."
.config/fish/functions/fzf_configure_bindings.fish:        _fzf_configure_bindings_help
.config/fish/functions/fzf_configure_bindings.fish:        _fzf_configure_bindings_help
.config/fish/functions/_fzf_configure_bindings_help.fish:function _fzf_configure_bindings_help --description "Prints the help message for fzf_configure_bindings."
.config/fish/functions/_fzf_configure_bindings_help.fish:    fzf_configure_bindings [--FEATURE[=KEY_SEQUENCE]...]
.config/fish/functions/_fzf_configure_bindings_help.fish:    By default, fzf_configure_bindings installs mnemonic key bindings for fzf.fish's features. Each
.config/fish/functions/_fzf_configure_bindings_help.fish:    In terms of validation, fzf_configure_bindings fails if passed unknown options. Furthermore, it
.config/fish/functions/_fzf_configure_bindings_help.fish:    In terms of experimentation, fzf_configure_bindings erases any bindings it previously installed
.config/fish/functions/_fzf_configure_bindings_help.fish:    problem. Once the desired fzf_configure_bindings command has been found, add it to config.fish
.config/fish/functions/_fzf_configure_bindings_help.fish:        \$ fzf_configure_bindings
.config/fish/functions/_fzf_configure_bindings_help.fish:        \$ fzf_configure_bindings --git_log=\cg
.config/fish/functions/_fzf_configure_bindings_help.fish:        \$ fzf_configure_bindings --history
.config/fish/functions/_fzf_configure_bindings_help.fish:        \$ fzf_configure_bindings --history=
.config/fish/functions/_fzf_configure_bindings_help.fish:        \$ fzf_configure_bindings --git_status=\cg --history=\ch --variable --directory --git_log
.config/fish/fish_variables:SETUVAR _fisher_PatrickF1_2F_fzf_2E_fish_files:/home/mattvh/\x2econfig/fish/functions/_fzf_configure_bindings_help\x2efish\x1e/home/mattvh/\x2econfig/fish/functions/_fzf_extract_var_info\x2efish\x1e/home/mattvh/\x2econfig/fish/functions/_fzf_preview_file\x2efish\x1e/home/mattvh/\x2econfig/fish/functions/_fzf_report_file_type\x2efish\x1e/home/mattvh/\x2econfig/fish/functions/_fzf_search_directory\x2efish\x1e/home/mattvh/\x2econfig/fish/functions/_fzf_search_git_log\x2efish\x1e/home/mattvh/\x2econfig/fish/functions/_fzf_search_git_status\x2efish\x1e/home/mattvh/\x2econfig/fish/functions/_fzf_search_history\x2efish\x1e/home/mattvh/\x2econfig/fish/functions/_fzf_search_variables\x2efish\x1e/home/mattvh/\x2econfig/fish/functions/fzf_configure_bindings\x2efish\x1e/home/mattvh/\x2econfig/fish/conf\x2ed/fzf\x2efish

It's a head scratcher for sure :(

Argh. I just ran fisher update and now this problem is no longer happening, and I can't seem to replicate even if I install fzf.fish from the exact git commit I was using yesterday.

I'm going to close this issue and investigate a bit further - sorry to waste your time.

Is it possible you updated to fish 3.2.2 but were still running 3.1.2 until when you retested today? I really think the issue you were experiencing had to do with the version difference because argparse has changed significantly since then https://github.com/fish-shell/fish-shell/blob/master/CHANGELOG.rst

It must have been that. I can't think of anything else it could have been - I was sure I'd reloaded everything since the upgrade but maybe not...

Still happening for me. Upgraded everything, not sure what to do

@Explosion-Scratch did you confirm you that you are running the latest fish using echo $version instead of fish --version?

For posterity, here is an explanation of why echo $version is more accurate https://gitter.im/fish-shell/fish-shell?at=620fdc776e4c1e1c846fab73

I just uninstalled fzf, problem solved

I just ran into the same issue today - fish update is impossible as I am not the root on the system. Wonder if you could add a table similar to what's here: https://github.com/IlanCosman/tide/wiki/Fish-version-compatibility.

I managed to fix the problem by running for fish, version 3.1.0 (version contained in Ubuntu 20.04.4 LTS)

fisher install PatrickF1/fzf.fish@v2.0

Not really sure which is the most recent still-compatible version but this one seems to work fine.

Aw I'm sorry you can't upgrade @jose1711. Maybe you can ask your admin to update it, or maybe you can still install a newer version for just your local user? :(

Unfortunately, I don't have the time or desire to maintain that table, especially since most people are able to and want to be on the latest version of fish. What you can do, however, is to jump through the different fzf version and read their README until you find the last one that is compatible with 3.1.2. I suspect it's 6.5 because 7.0 is where I introduce fzf_confgure_bindings. Good luck!

Aw I'm sorry you can't upgrade @jose1711. Maybe you can ask your admin to update it, or maybe you can still install a newer version for just your local user? :(

Unfortunately, I don't have the time or desire to maintain that table, especially since most people are able to and want to be on the latest version of fish. What you can do, however, is to jump through the different fzf version and read their README until you find the last one that is compatible with 3.1.2. I suspect it's 6.5 because 7.0 is where I introduce fzf_confgure_bindings. Good luck!

Thank you, it's not the end of the world. Probably a single server among many where I don't get to be root. I could perhaps try to use a local fish binary but it's not worth the hassle. And thank you for the tip as well: fisher install PatrickF1/fzf.fish@v6.5 worked beautifully 😉