matchai / spacefish

šŸš€šŸŸ The fish shell prompt for astronauts
https://spacefish.matchai.dev
MIT License
964 stars 79 forks source link

Spacefish prompt - Unknown command '__sf_util_set_default' #48

Closed Snuggle closed 6 years ago

Snuggle commented 6 years ago

Bug Report

Current Behavior Loading spacefish prompt over SSH, after switching user, causes errors. Both clients/users are using fish with oh-my-fish and spacefish.

I don't seem to get the same error when opening the terminal on the machine. It seems to only be an SSH issue of some kind.

Expected Behavior Spacefish prompt works perfectly! :rocket:

Relevant Fish Configuration No extra configuration. N/A.

Environment

Possible Solution Fix the line that Fish is erroring on?

Additional context/Screenshots This occurs over SSH after switching user. Both users and machines have spacefish installed with identical versions.

fish: Unknown command '__sf_util_set_default'
~/.config/fish/functions/fish_prompt.fish (line 8): 
        __sf_util_set_default SPACEFISH_PROMPT_ADD_NEWLINE true
        ^
in function 'fish_prompt'
        called on standard input

in command substitution
        called on standard input

fish: Unknown command '__sf_util_set_default'
~/.config/fish/functions/fish_prompt.fish (line 9): 
        __sf_util_set_default SPACEFISH_PROMPT_FIRST_PREFIX_SHOW false
        ^
in function 'fish_prompt'
        called on standard input

in command substitution
        called on standard input

fish: Unknown command '__sf_util_set_default'
~/.config/fish/functions/fish_prompt.fish (line 10): 
        __sf_util_set_default SPACEFISH_PROMPT_PREFIXES_SHOW true
        ^
in function 'fish_prompt'
        called on standard input

in command substitution
        called on standard input

fish: Unknown command '__sf_util_set_default'
~/.config/fish/functions/fish_prompt.fish (line 11): 
        __sf_util_set_default SPACEFISH_PROMPT_SUFFIXES_SHOW true
        ^
in function 'fish_prompt'
        called on standard input

in command substitution
        called on standard input

fish: Unknown command '__sf_util_set_default'
~/.config/fish/functions/fish_prompt.fish (line 12): 
        __sf_util_set_default SPACEFISH_PROMPT_DEFAULT_PREFIX "via "
        ^
in function 'fish_prompt'
        called on standard input

in command substitution
        called on standard input

fish: Unknown command '__sf_util_set_default'
~/.config/fish/functions/fish_prompt.fish (line 13): 
        __sf_util_set_default SPACEFISH_PROMPT_DEFAULT_SUFFIX " "
        ^
in function 'fish_prompt'
        called on standard input

in command substitution
        called on standard input

fish: Unknown command '__sf_util_set_default'
~/.config/fish/functions/fish_prompt.fish (line 14): 
        __sf_util_set_default SPACEFISH_PROMPT_ORDER user dir git package node ruby exec_time line_sep battery char
        ^
in function 'fish_prompt'
        called on standard input

in command substitution
        called on standard input
matchai commented 6 years ago

Hey Snuggle! Thank you for opening an issue.

That is indeed strange behavior. Unfortunately, I have been unable to reproduce it on my own machine: https://asciinema.org/a/VCa2eUHYBQWetzZMImEj5xSWT

In the recording I am sshing into the same computer with the ssh client, so the spacefish installation is definitely using the same fish and spacefish version.

My first thought is that you have a corrupt spacefish installation on the server you're sshing into. The __sf_util_set_default function should be installed in the same way as all other functions. To verify that it is there, check ~/.config/fish/functions for the __sf_util_set_default.fish file and several other __sf prefixed files that should be installed with the theme. If not, it may be an issue regarding write access to one of the containing folders.

Be sure to try reinstalling spacefish and updating it. Please let me know if that doesn't work.

Snuggle commented 6 years ago

It appears that omf is very confused about multiple users and has only done a partial install of spacefish. When running omf doctor it's using the wrong user's /home/username/.config/omf/theme. (I am not signed in as snuggle, I used su to switch to another user.)

I will attempt to fix this by using omf destroy and then reinstalling omf without SSH/su. This didn't fix the issue. Odd.

image

Very strange. I don't think this is a spacefish specific-issue, so I'll close. :slightly_smiling_face: