0

So currently I have this as my ZSH_THEME_GIT_PROMPT stuff:

ZSH_THEME_GIT_PROMPT_PREFIX="[ "
ZSH_THEME_GIT_PROMPT_SUFFIX=" ] "
ZSH_THEME_GIT_PROMPT_DIRTY=" ✘"
ZSH_THEME_GIT_PROMPT_CLEAN=" ✔"

ZSH_THEME_GIT_PROMPT_ADDED="✚"
ZSH_THEME_GIT_PROMPT_MODIFIED="★"
ZSH_THEME_GIT_PROMPT_DELETED="✖"
ZSH_THEME_GIT_PROMPT_RENAMED="➜"

My problem is that the ZSH_THEME_GIT_PROMPT_DIRTY and ZSH_THEME_GIT_PROMPT_CLEAN always add a trailing white space.

Meaning that from the above if I have a clean git project, it looks like this: [ master ✔ ]

And if I have a dirty git project, it looks like this: [ master ✘ ★ ]

As you can see, the clean version has 2 spaces after because I add a space on the SUFFIX for when it is dirty, so I was wondering if there was a way to remove the automatically added space on the CLEAN/DIRTY git prompts so I can alleviate this problem.

jamby
  • 101

1 Answers1

0

It's because ZSH_THEME_GIT_PROMPT_SUFFIX has space as the first character.

ZSH_THEME_GIT_PROMPT_SUFFIX=" ] "

The line above should be like this:

ZSH_THEME_GIT_PROMPT_SUFFIX="] "
Hkan
  • 101
  • 1
    No, that's not what I meant. I meant in the first one with just the master, there's 2 spaces, but on the 2nd one there's only one space. I only ever want there to be one space, regardless of which one it is. I need the space there for the 2nd one to have a space between the ] and the star. – jamby Jun 16 '16 at 20:13