Skip to content

Commit

Permalink
Change tmp commit indicator style
Browse files Browse the repository at this point in the history
Also, adds a oneliner to show terminal colors
  • Loading branch information
dorian-marchal committed Jul 4, 2019
1 parent 333496a commit 509defe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .ultimate-git-ps1-bash-prompt
@@ -1,6 +1,9 @@
# Customize BASH PS1 prompt to show current GIT repository and branch.
# Original from http://mediadoneright.com/content/ultimate-git-ps1-bash-prompt

# List colors with:
# for x in {0..8}; do for i in {30..37}; do for a in {40..47}; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; done; echo; done; done; echo ""

# Regular Colors
_black_='\e[0;30m'
_red_='\e[0;31m'
Expand Down Expand Up @@ -121,7 +124,7 @@ _git_prompt() {
# Adds an indicator if the latest commit is a temporary one (ctmp alias).
latest_commit_msg="$(git log --oneline --format=%B -n 1 HEAD | head -n 1)"
if [ "$latest_commit_msg" = "temporary-commit" ]; then
tmp_commit_indicator="${_bipurple_} ★${_off_}"
tmp_commit_indicator="${_ipurple_} ⭑${_off_}"
fi

repo_prompt="${repo_state}${tmp_commit_indicator} ${status_prompt}"
Expand Down

0 comments on commit 509defe

Please sign in to comment.