Fisher: Broken for fish 2.7.0

Created on 23 Nov 2017  ·  18Comments  ·  Source: jorgebucaran/fisher

After update fish shell to latest version 2.7.0 I noticed the fisher command stop working.

This happens in 10 different servers running Centos 7 and 2 machine under Ubuntu 16.04

❯ fisher up
fish: argparse: command not found...
/usr/share/fish/functions/math.fish (line 7): 
    argparse -n math --stop-nonopt --min-args=1 $options -- $argv
    ^
in function “math”
    called on line 2062 of file ~/.config/fish/functions/fisher.fish
    with parameter list “1511450765784 - 0”

in function “__fisher_get_epoch_in_ms”
    called on line 17 of file ~/.config/fish/functions/fisher.fish

in command substitution
    called on line 15 of file ~/.config/fish/functions/fisher.fish

in function “fisher”
    called on standard input
    with parameter list “up”

fish: argparse: command not found...
/usr/share/fish/functions/isatty.fish (line 2): 
    argparse -n isatty $options -- $argv
    ^
in function “isatty”
    called on line 279 of file ~/.config/fish/functions/fisher.fish

in function “fisher”
    called on standard input
    with parameter list “up”

Most helpful comment

Hi @faho, do you know if isatty changed or what may be the cause of this error?

isatty now uses the new argparse builtin to parse its arguments - it's basically our answer to getopt. A number of functions have been changed to use it.

This looks like the old fish (2.6.0?) is picking up the new functions.

@agarzon, @askl56: This should just solve itself once you close the old sessions or e.g. exec fish.

All 18 comments

Hmm maybe something changed in isatty upstream?

Yep I get

~/.config/fish/functions/fish_prompt.fish (line 240): function: Unknown option '-q'
~/.config/fish/functions/fish_prompt.fish (line 240):
function type -q -a name -d "Check if a function or program is type -q."
^
from sourcing file ~/.config/fish/functions/fish_prompt.fish
    called on standard input

in command substitution
    called on standard input


       functionfunction - create a function
        -

   Synopsis
       function NAME [OPTIONS]; BODY; end

function: Type 'help function' for related documentation


function type -q -a name -d "Check if a function or program is type -q."
  type "$name" ^/dev/null >&2
^
from sourcing file ~/.config/fish/functions/fish_prompt.fish
    called on standard input

in command substitution
    called on standard input

I haven't upgraded to fish 2.7, so I guess that's why I haven't bumped into this. Do you have a solution? Because I don't imagine this must be so hard to fix.

Hi @faho, do you know if isatty changed or what may be the cause of this error?

Hi @faho, do you know if isatty changed or what may be the cause of this error?

isatty now uses the new argparse builtin to parse its arguments - it's basically our answer to getopt. A number of functions have been changed to use it.

This looks like the old fish (2.6.0?) is picking up the new functions.

@agarzon, @askl56: This should just solve itself once you close the old sessions or e.g. exec fish.

Thanks @faho the exec fish worked for me. Peace !

Just updated my ArchLinux system, got 2.7.0, rebooted my computer, but no luck, same error from @askl56 .

exec fish makes no diff.

Any other suggestions? Thanks!

@faho Perhaps there is something else? I am going through: https://github.com/fish-shell/fish-shell/releases/tag/2.7.0 but no luck! 🤔

@rdlu: You're getting the "fish: argparse: command not found..." message, right?

That's basically impossible with fish 2.7.0 since it's a builtin. And I can confirm that Arch hasn't e.g. patched it out or something since the official arch package works for me.

So what I'm assuming is that you have an old fish somewhere else in your $PATH that is started instead of the new packaged one. Try fish --version - if that doesn't print "fish, version 2.7.0" you have some cruft you need to remove (see command -s fish).

Oh, wait, you said the same as @askl56? I.e. function: Unknown option '-q' and function type -q -a name -d "Check if a function or program is type -q."?

In that case, check your ~/.config/fish/functions/fish_prompt.fish (or whatever other file that message mentions) - there should be some broken syntax in there. 2.7.0 tightened the function builtin against invalid options, and it seems something is setting a function with an invalid option.

Well, I have to mention that I did nothing, and suddenly fisher is working back in all servers, no update, command or logout was executed.

Still an issue here.

I haven't amended or changed fish_prompt at all from the default so confused as to why others are seeing different behaviour.

@askl56 I still haven't upgraded to fish 2.7, sorry, but if you find a solution a PR is welcome. 👋😄

@askl56 Can't you just try to debug it? fisherman is literally one file, trace the problem to the function that's causing the problem. The solution must be like 1 byte or something.

> fisher ls
find: ^: unknown primary or operator

I get this error with fish, version 2.7.1-1096-ga9e9af5c fisherman version 2.13.2 ~/.config/fish/functions/fisher.fish

I'm running fish 2.7.1 with fisherman 2.13.2 without issues.

Fish 2.7.1-1096-ga9e9af5c is a nightly build

@Markcial thanks for pointing that out, after reinstalling fish 2.7.1 (stable via homebrew) fisher now works again.

Confirmed working on 2.7.1 (stable)

Was this page helpful?
0 / 5 - 0 ratings