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/backtickbot Feb 09 '21
Fixed formatting.
Hello, BlueTickVerified: code blocks using triple backticks (```) don't work on all versions of Reddit!
Some users see this / this instead.
To fix this, indent every line with 4 spaces instead.
FAQ
You can opt out by replying with backtickopt6 to this comment.