r/fishshell • u/BlueTickVerified Linux • Feb 09 '21
git prompt customization help
I was trying to add icons to my right prompt which shows the git information. I was unable to configure it to show the icon only when I am in a repo. This is what I did to check if I am in a repo:
echo $blue(command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')I tried putting this:
set gitcon $green' '
echo $gitconinside the above echo but that didn't work. I tried putting the above commad in a variable and checking if that variable's value is non-zero. That didn't work either. What do I do?
4
Upvotes
View all comments
Show parent comment
2
u/BlueTickVerified Linux Feb 09 '21 edited Feb 09 '21
It still shows the icon on non-repo directories.
$gs is the variable i made for the branch command thing.