Created
April 25, 2020 11:34
-
-
Save abel0b/bd22cc9c47f301892a77627c9e3468e5 to your computer and use it in GitHub Desktop.
Prompt bash git branch + previous command exit code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PS1='$(if [[ ! "$?" = "0" ]]; then echo "\[\e[1;31m\]($?)\[\e[0m\] "; fi)\h:\[\e[1;31m\]$(basename $PWD)\[\e[0m\]\[\e[1;33m\]$(__git_ps1 " [%s]")\[\e[0m\]> ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment