prompt

Updated Fun with Bash prompts

Stephen
After working with my prompt for a few months I thought it only fixing to update my post with the changes I have made. The update configuration is below: function _git_prompt() { local git_status="`git status -unormal 2>&1`" if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then if [[ "$git_status" =~ nothing\ to\ commit ]]; then local ansi=32 elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then local ansi=31 else local ansi=33 fi echo -n '\[\e[0;33;'"$ansi"'m\]'"$(__git_ps1)"'\[\e[0m\]' fi } function _prompt_command() { PS1="`if [ \$?

Fun with Bash prompts

Stephen
After reading Oliver’s blog about cool bash prompts i thought id give it a go. I wanted a way to also get feedback about my current status of my git branch. After hacking around for ten minutes i came up with function _git_prompt() { local git_status="`git status -unormal 2>&1`" if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then if [[ "$git_status" =~ nothing\ to\ commit ]]; then local ansi=32 elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then local ansi=34 else local ansi=33 fi echo -n '\[\e[0;33;'"$ansi"'m\]'"$(__git_ps1)"'\[\e[0m\]' fi } function _prompt_command() { PS1="`if [ \$?