Re:The fish shell is amazing
by ivank on Thursday November 25, 2021 @03:56PM
(#29344914)
I found that all I really wanted to show was the current branch, which I do with https://gist.github.com/ivan/79de5e87210e8cf21e305bb4c30c436...
[ Parent
| on HN ]
You can do this in fish with a direct call to git branch, and it’s not slow and doesn’t require catting files:
set -l git_branch (git branch 2>/dev/null | sed -n '/\* /s///p')
if test -n "$git_branch"
echo -n -s (set_color yellow) "<$git_branch>" (set_color normal) " "
end