oh-my-fish / theme-bobthefish

A Powerline-style, Git-aware fish theme optimized for awesome.
MIT License
1.44k stars 223 forks source link

Can't use this theme (errors in prompt code)? #319

Closed Ncage1974 closed 4 months ago

Ncage1974 commented 2 years ago

So when trying to install this is the error I get:

 omf install bobthefish                                     Fri Dec 31 23:10:14 2021
Updating https://github.com/oh-my-fish/packages-main master... Done!
Installing package bobthefish
✔ bobthefish successfully installed.
[: the last argument must be ']'

~/.local/share/omf/themes/bobthefish/functions/fish_mode_prompt.fish (line 13):
    [ "$fish_key_bindings" = 'fish_vi_key_bindings' \
    ^
in function 'fish_mode_prompt'
in command substitution

(Type 'help [' for related documentation)
-o: command not found
~/.local/share/omf/themes/bobthefish/functions/fish_mode_prompt.fish (line 14):
        -o "$fish_key_bindings" = 'hybrid_bindings' \
        ^
in function 'fish_mode_prompt'
in command substitution
-o: command not found
~/.local/share/omf/themes/bobthefish/functions/fish_mode_prompt.fish (line 15):
        -o "$fish_key_bindings" = 'fish_hybrid_key_bindings' \
        ^
in function 'fish_mode_prompt'
in command substitution
-o: command not found
~/.local/share/omf/themes/bobthefish/functions/fish_mode_prompt.fish (line 16):
        -o "$theme_display_vi" = 'yes' ]
        ^
in function 'fish_mode_prompt'
in command substitution

Every command i try to run after install I will get the error even doing a simpe ls. The only way for me to fix the error is to uninstall the theme.

bobthecow commented 2 years ago

That's strange. That code is in ~/.local/share/omf/themes/bobthefish/functions/fish_mode_prompt.fish. I've never had any trouble with it, but it seems like it doesn't like line continuation inside [ ]. Maybe newline character related?

What version of Fish are you running? What OS?

If you run this on the command line, what happens?

echo foo \
  bar \
  baz
Ncage1974 commented 2 years ago

That's strange. That code is in ~/.local/share/omf/themes/bobthefish/functions/fish_mode_prompt.fish. I've never had any trouble with it, but it seems like it doesn't like line continuation inside [ ]. Maybe newline character related?

What version of Fish are you running? What OS?

If you run this on the command line, what happens?

echo foo \
  bar \
  baz

Thanks for your reply. Your reply actually clued me into what was wrong. So apparently omf doesn't like you have autocrlf set for git. After i turned autocrlf off and redownloaded the theme everything is perfect. I set it back on after i downloaded the theme. I don't know if this will end up giving me issues in the future. image