umayr / theme-sushi

Sushi theme for Fishshell.
MIT License
24 stars 20 forks source link

git::is_repo: command not found #22

Open vakokako opened 3 years ago

vakokako commented 3 years ago

After installing sushi with omf install sushi, I get the following error:

git::is_repo: command not found
~/.config/fish/functions/fish_prompt.fish (line 11): 
    if git::is_repo
       ^
in function 'fish_prompt'
in command substitution
vakokako commented 3 years ago

This error happens, since functions that are not the same as file name (e.g. git::is_repo) are autoloaded only after main funcion (fish_right_prompt) is called. And if fish calls fish_prompt before fish_right_prompt, functions like git::is_repo will not be loaded. Explanation here.

You can solve this by moving all the helper functions (git::***) to fish_prompt.

Maybe move functions like git::is_repo to separate files, then they will be autoloaded without call to fish_right_prompt, cause fish-shell can always change the ordering of loading.

cookatrice commented 3 years ago

I get this error (use big sur ! :( ) :

~/.config/fish/functions/fish_prompt.fish (line 11): Unknown command: git::is_repo if git::is_repo ^ in function 'fish_prompt' in command substitution ~/.config/fish/functions/fish_prompt.fish (line 1): Unknown command: red red ^ in command substitution called on line 56 of file ~/.config/fish/functions/fish_prompt.fish in function 'fish_prompt' in command substitution ~/.config/fish/functions/fish_prompt.fish (line 56): Unknown error while evaluating command substitution echo -n -s (red)"$symbol"(off) ^ in function 'fish_prompt' in command substitution