Command not found fish_git_prompt in terminal

I am getting this weird error fish_git_prompt in my shell each and every time. Even when I clear my terminal it reappears every time. I have searched the internet and tried the solutions but everything inside the fish functions is right. I don't know how to solve these issues please give me a solution for this.

I have attached my error below:

fish: Unknown command: fish_git_prompt
/usr/share/fish/functions/fish_vcs_prompt.fish (line 4):
fish_git_prompt $argv
^
in function 'fish_vcs_prompt'
called on line 1 of file /usr/share/fish/functions/fish_prompt.fish
in command substitution
called on line 35 of file /usr/share/fish/functions/fish_prompt.fish
in function 'fish_prompt'
in command substitution

Post output from

cat /usr/share/fish/functions/fish_prompt.fish

as text.

2 Likes

This is the output I got

# name: Classic + Vcs (the default)
# author: Lily Ballard

function fish_prompt --description 'Write out the prompt'
set -l last_pipestatus $pipestatus
set -lx __fish_last_status $status # Export for __fish_print_pipestatus.
set -l normal (set_color normal)

# Color the prompt differently when we're root
set -l color_cwd $fish_color_cwd
set -l suffix '>'
if functions -q fish_is_root_user; and fish_is_root_user
if set -q fish_color_cwd_root
set color_cwd $fish_color_cwd_root
end
set suffix '#'
end

# If we're running via SSH, change the host color.
set -l color_host $fish_color_host
if set -q SSH_TTY
set color_host $fish_color_host_remote
end

# Write pipestatus
# If the status was carried over (e.g. after `set`), don't bold it.
set -l bold_flag --bold
set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation
if test $__fish_prompt_status_generation = $status_generation
set bold_flag
end
set __fish_prompt_status_generation $status_generation
set -l prompt_status (__fish_print_pipestatus "[" "]" "|" (set_color $fish_color_status) (set_color $bold_
flag $fish_color_status) $last_pipestatus)

echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $color_host) (prompt_hostname) $norma
l ' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $suffix " "
end

Please help me with this issue. I am not able to resolve it.

Delete

echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $color_host) (prompt_hostname) $norma
l ' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $suffix " "
end

with micro in terminal

sudo micro /usr/share/fish/functions/fish_prompt.fish
2 Likes

After doing the above step I get this error. Couldn't fix it please help.

fish: Unknown command: __fish_pwd
/usr/share/fish/functions/fish_title.fish (line 1): 
__fish_pwd
^
in command substitution
called on line 6 of file /usr/share/fish/functions/fish_title.fish
in function 'fish_title' with arguments '\ cd\ /home/vetrichelvan/.config/fish'
in command substitution
/usr/share/fish/functions/fish_title.fish (line 6): Unknown error while evaluating command substitution
echo (set -q argv[1] && echo $argv[1] || status current-command) (__fish_pwd)
^
in function 'fish_title' with arguments '\ cd\ /home/vetrichelvan/.config/fish'
in command substitution

DId you already try to use a completely untouched config.fish ?

2 Likes

I did not make any changes to the config.fish file.

Think about it again.

1 Like

Maybe you already checked and tried this, anyway:

  • Have you checked if you do have /usr/share/fish/functions/fish_git_prompt.fish owned by root and possibly with date like the other files (so likely not changed)?
  • Have you tried simply reinstalling fish ?
1 Like

Maybe you could also try this one:

1 Like

Well, if it is still not solved, reinstall the latest iso. It is workaround, not a solution. But there need not to be solution to every issue.

1 Like

Yeah will try this out and update