Oh-my-fish: Broken prompt after update on Arch

Created on 27 Nov 2017  Â·  3Comments  Â·  Source: oh-my-fish/oh-my-fish

oh-my-fish was working fine until a recent update (Arch) and now I get this before every prompt:

fish: Unknown command 'argparse'
/usr/share/fish/functions/prompt_pwd.fish (line 2): 
    argparse -n prompt_pwd --max-args=0 $options -- $argv

in function “prompt_pwd”
    called on line 116 of file ~/.config/fish/functions/fish_prompt.fish

in command substitution
    called on line 114 of file ~/.config/fish/functions/fish_prompt.fish

in function “prompt_dir”
    called on line 253 of file ~/.config/fish/functions/fish_prompt.fish

in function “fish_prompt”
    called on standard input

in command substitution
    called on standard input

~/.config/fish/functions/fish_prompt.fish (line 25): Array index out of bounds
  if [ -n "$argv[3]" ]
                 ^
in function “prompt_segment”
    called on line 116 of file ~/.config/fish/functions/fish_prompt.fish
    with parameter list “1C1C1C FFFFFF”

in function “prompt_dir”
    called on line 253 of file ~/.config/fish/functions/fish_prompt.fish

in function “fish_prompt”
    called on standard input

in command substitution
    called on standard input

~/.config/fish/functions/fish_prompt.fish (line 26): Array index out of bounds
    echo -n -s $argv[3] " "
                     ^
in function “prompt_segment”
    called on line 116 of file ~/.config/fish/functions/fish_prompt.fish
    with parameter list “1C1C1C FFFFFF”

in function “prompt_dir”
    called on line 253 of file ~/.config/fish/functions/fish_prompt.fish

in function “fish_prompt”
    called on standard input

in command substitution
    called on standard input

fish: Unknown command 'argparse'
/usr/share/fish/functions/type.fish (line 6): 
    argparse -n type --min-args=1 -x t,p,P $options -- $argv
    ^
in function “type”
    called on line 254 of file ~/.config/fish/functions/fish_prompt.fish
    with parameter list “-q hg”

in function “fish_prompt”
    called on standard input

in command substitution
    called on standard input

fish: Unknown command 'argparse'
/usr/share/fish/functions/type.fish (line 6): 
    argparse -n type --min-args=1 -x t,p,P $options -- $argv
    ^
in function “type”
    called on line 255 of file ~/.config/fish/functions/fish_prompt.fish
    with parameter list “-q git”

in function “fish_prompt”
    called on standard input

in command substitution
    called on standard input

fish: Unknown command 'argparse'
/usr/share/fish/functions/type.fish (line 6): 
    argparse -n type --min-args=1 -x t,p,P $options -- $argv
    ^
in function “type”
    called on line 256 of file ~/.config/fish/functions/fish_prompt.fish
    with parameter list “-q svn”

in function “fish_prompt”
    called on standard input

in command substitution
    called on standard input

I dug around a bit but couldn't see anything obvious broken and don't have a great deal of free time at the moment so I tried reinstalling but got this:

curl -L https://get.oh-my.fish | fish

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   194  100   194    0     0    194      0  0:00:01  0:00:01 --:--:--   186
100 16622  100 16622    0     0  16622      0  0:00:01  0:00:01 --:--:-- 16622
Existing installation detected at /home/nach/.local/share/omf
Would you like to remove the existing installation? (y/N): <W> fish: No TTY for interactive shell (tcgetpgrp failed)
setpgid: Inappropriate ioctl for device

If I do omf reload I get my prompt back and the error message goes away for that session, but whenever I start a new session 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

At least this message only occurs on session start then everything else seems to be OK after that. Using a profile without oh-my-fish also seems to be working normally.

Is there anything jumping out to someone else from the above which suggests what's wrong with my omf install?

Most helpful comment

I just experienced the same thing, but I think you just have to start a new shell after updating. Closing the existing shell and opening a new one fixed it for me.

All 3 comments

This line here looks suspect:

~/.config/fish/functions/fish_prompt.fish (line 25): Array index out of bounds
  if [ -n "$argv[3]" ]

Maybe you upgraded Fish versions? The above may have worked in Fish <= 2.4 but break in 2.5 if I recall.

The fact that many of these errors are coming from scripts in /usr/share/fish tells me that something is broken with your Fish shell installation.

I just experienced the same thing, but I think you just have to start a new shell after updating. Closing the existing shell and opening a new one fixed it for me.

you just have to start a new shell after updating.

This fixed the issue when it happened on my machine.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

edoarda picture edoarda  Â·  7Comments

jmayday picture jmayday  Â·  5Comments

onmyway133 picture onmyway133  Â·  7Comments

Ramblurr picture Ramblurr  Â·  4Comments

tiborsimon picture tiborsimon  Â·  6Comments