oh-my-fish / theme-bobthefish

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

Issues with hiding branch named main #288

Closed max-sixty closed 3 years ago

max-sixty commented 3 years ago

Firstly — thank you for the excellent theme! I've used it constantly for the last few years, it's awesome.

I'm struggling to hide the "main" branch, even though hiding "master" works. Here's a screenshot of the configs and the result, on a repo which uses main as its default branch. Does anyone have any idea of what I could be doing wrong? I previously hadn't set $theme_display_git_default_branch to anything, but I had the same effect. I've tried on different repos and re-pulling this one.

image

Many thanks

bobthecow commented 3 years ago

I'm not able to reproduce this. Is there a chance you have an outdated copy of the theme? Do you mind updating and trying again?

max-sixty commented 3 years ago

I'm sorry — I forgot I'd forked it and so running update wasn't updating from the correct location. Thanks for responding.

FWIW this is the patch I've been running — if this would be helpful to PR, lmk.

diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish
index e0a653e..ac39499 100644
--- a/functions/fish_prompt.fish
+++ b/functions/fish_prompt.fish
@@ -859,6 +859,7 @@ function __bobthefish_virtualenv_python_version -S -d 'Get current Python versio
     end
 end

+# https://github.com/oh-my-fish/theme-bobthefish/issues/174
 function __bobthefish_prompt_virtualfish -S -d "Display current Python virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself) or conda environment."
     [ "$theme_display_virtualenv" = 'no' -o -z "$VIRTUAL_ENV" -a -z "$CONDA_DEFAULT_ENV" ]
     and return
@@ -870,6 +871,8 @@ function __bobthefish_prompt_virtualfish -S -d "Display current Python virtual e
         echo -ns $virtualenv_glyph $version_glyph ' '
     end

+  # https://github.com/oh-my-fish/theme-bobthefish/issues/174#issuecomment-433793744
+  [ "$theme_display_virtualenv" = 'glyph' -o -z "$VIRTUAL_ENV" -a -z "$CONDA_DEFAULT_ENV" ]; and return
     if [ "$VIRTUAL_ENV" ]
         echo -ns (basename "$VIRTUAL_ENV") ' '
     else if [ "$CONDA_DEFAULT_ENV" ]
@@ -877,6 +880,7 @@ function __bobthefish_prompt_virtualfish -S -d "Display current Python virtual e
     end
 end

+
 function __bobthefish_prompt_virtualgo -S -d 'Display current Go virtual environment'
     [ "$theme_display_virtualgo" = 'no' -o -z "$VIRTUALGO" ]
     and return