Take a little time to make yourself a better PS1 experience in bash. There are lots of PS1 variations out in the wild, but I wanted something:
- Fast. All the Python implementations slow bash to a crawl. That's terrible. Bash should be fast.
- Broad. Most PS1 implementations cater for one or maybe two VCS variants. I use them all. I need something that works for them all.
- Useful. I need to see at least the branch, current revison and mod state. I'd prefer to also get some counts (unstaged, modded, deleted, etc).
- Colourful. Almost everybody wants this. And everybody can have it. You just have to be methodical when escaping your colour change drectives. Eg: you can get a pale blue with
$(tput setaf 153), but you should wrap it like this:\[$(tput setaf 153)\]to avoid early line wraps in the terminal window. Use this colour chart to pick colors that work for you.
VCPrompt is the best I have found so far. It's lightweight and blazingly fast, because it's written in c. It's open source too, so if I ever pull my thumb out, I could implement the counts I want.
there is still a chaotic assortment of vcprompt and ps1 implementations on the wild-wild-web but rust-vcprompt outshines them all. no need to mess around with anything else.