diff --git a/themes/base.theme.bash b/themes/base.theme.bash index e77d1d23..d9f5c580 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -39,7 +39,7 @@ function scm_prompt_info { if [[ -z $SCM ]]; then scm; fi [[ $SCM == $GIT ]] && git_prompt_info && return [[ $SCM == $HG ]] && hg_prompt_info && return - [[ $SCM == $SVN ]] && svn_prompt_info && return +# [[ $SCM == $SVN ]] && svn_prompt_info && return } # Stolen from Steve Losh @@ -76,6 +76,20 @@ function svn_prompt_info { echo -e "$prefix$ref$state$suffix" } +function hg_prompt_info() { + if [[ -n $(hg status 2> /dev/null) ]]; then + state=${HG_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} + else + state=${HG_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} + fi + prefix=${HG_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX} + suffix=${HG_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX} + branch=$(hg summary 2> /dev/null | grep branch | awk '{print $2}') + changeset=$(hg summary 2> /dev/null | grep parent | awk '{print $2}') + + echo -e "$prefix$branch:${changeset#*:}$state$suffix" +} + function rvm_version_prompt { if which rvm &> /dev/null; then rvm=$(rvm tools identifier) || return diff --git a/themes/colors.theme.bash b/themes/colors.theme.bash index 0266e352..6e15f343 100644 --- a/themes/colors.theme.bash +++ b/themes/colors.theme.bash @@ -1,44 +1,44 @@ #!/bin/bash -black='\[\033[0;30m\]' -red='\[\033[0;31m\]' -green='\[\033[0;32m\]' -yellow='\[\033[0;33m\]' -blue='\[\033[0;34m\]' -purple='\[\033[0;35m\]' -cyan='\[\033[0;36m\]' -white='\[\033[1;37m\]' -orange='\[\033[33;40m\]' +black='\[\e[0;30m\]' +red='\[\e[0;31m\]' +green='\[\e[0;32m\]' +yellow='\[\e[0;33m\]' +blue='\[\e[0;34m\]' +purple='\[\e[0;35m\]' +cyan='\[\e[0;36m\]' +white='\[\e[1;37m\]' +orange='\[\e[33;40m\]' -bold_black='\[\033[1;30m\]' -bold_red='\[\033[1;31m\]' -bold_green='\[\033[1;32m\]' -bold_yellow='\[\033[1;33m\]' -bold_blue='\[\033[1;34m\]' -bold_purple='\[\033[1;35m\]' -bold_cyan='\[\033[1;36m\]' -bold_white='\[\033[1;37m\]' -bold_orange='\[\033[1;33;40m\]' +bold_black='\[\e[1;30m\]' +bold_red='\[\e[1;31m\]' +bold_green='\[\e[1;32m\]' +bold_yellow='\[\e[1;33m\]' +bold_blue='\[\e[1;34m\]' +bold_purple='\[\e[1;35m\]' +bold_cyan='\[\e[1;36m\]' +bold_white='\[\e[1;37m\]' +bold_orange='\[\e[1;33;40m\]' -underline_black='\[\033[4;30m\]' -underline_red='\[\033[4;31m\]' -underline_green='\[\033[4;32m\]' -underline_yellow='\[\033[4;33m\]' -underline_blue='\[\033[4;34m\]' -underline_purple='\[\033[4;35m\]' -underline_cyan='\[\033[4;36m\]' -underline_white='\[\033[4;37m\]' -underline_orange='\[\033[4;33;40m\]' +underline_black='\[\e[4;30m\]' +underline_red='\[\e[4;31m\]' +underline_green='\[\e[4;32m\]' +underline_yellow='\[\e[4;33m\]' +underline_blue='\[\e[4;34m\]' +underline_purple='\[\e[4;35m\]' +underline_cyan='\[\e[4;36m\]' +underline_white='\[\e[4;37m\]' +underline_orange='\[\e[4;33;40m\]' -background_black='\[\033[40m\]' -background_red='\[\033[41m\]' -background_green='\[\033[42m\]' -background_yellow='\[\033[43m\]' -background_blue='\[\033[44m\]' -background_purple='\[\033[45m\]' -background_cyan='\[\033[46m\]' -background_white='\[\033[47m\]' +background_black='\[\e[40m\]' +background_red='\[\e[41m\]' +background_green='\[\e[42m\]' +background_yellow='\[\e[43m\]' +background_blue='\[\e[44m\]' +background_purple='\[\e[45m\]' +background_cyan='\[\e[46m\]' +background_white='\[\e[47m\]' -normal='\[\033[00m\]' -reset_color='\[\033[39m\]' +normal='\[\e[00m\]' +reset_color='\[\e[39m\]' diff --git a/themes/modern/modern.theme.bash b/themes/modern/modern.theme.bash index 8688f366..95d9631e 100644 --- a/themes/modern/modern.theme.bash +++ b/themes/modern/modern.theme.bash @@ -32,7 +32,7 @@ prompt() { # Yes, the indenting on these is weird, but it has to be like # this otherwise it won't display properly. - PS1="${bold_red}┌─${reset_color}$(modern_scm_prompt)[${cyan}\W${normal}]$(is_vim_shell) + PS1="${bold_red}┌─${reset_color}$(scm_prompt)[${cyan}\W${normal}]$(is_vim_shell) ${bold_red}└─▪${normal} " else PS1="┌─$(modern_scm_prompt)[${cyan}\W${normal}]$(is_vim_shell)