From 60f4e4b9b0ca7998d22ef51c3599e407b65347b8 Mon Sep 17 00:00:00 2001 From: Calvin Giles Date: Thu, 29 Aug 2013 10:17:49 +0100 Subject: [PATCH] No strange color effects now. --- themes/calvin/calvin.theme.bash | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/themes/calvin/calvin.theme.bash b/themes/calvin/calvin.theme.bash index e5d076fd..b09c47e3 100644 --- a/themes/calvin/calvin.theme.bash +++ b/themes/calvin/calvin.theme.bash @@ -1,9 +1,12 @@ #!/usr/bin/env bash +SCM_NONE_CHAR='' + SCM_THEME_PROMPT_DIRTY=" ${red}✗" SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" SCM_THEME_PROMPT_PREFIX=" |" SCM_THEME_PROMPT_SUFFIX="${green}|" + GIT_THEME_PROMPT_DIRTY=" ${red}✗" GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓" GIT_THEME_PROMPT_PREFIX=" ${green}|$(scm_char) " @@ -12,9 +15,21 @@ GIT_THEME_PROMPT_SUFFIX="${green}|" RVM_THEME_PROMPT_PREFIX="|" RVM_THEME_PROMPT_SUFFIX="|" +PROMPT_CHAR_CLEAN="${reset_color}\$" +PROMPT_CHAR_DIRTY="${red}\$${reset_color}" + +function prompt_char() { + if [ $? -eq 0 ]; then PROMPT_CHAR=$PROMPT_CHAR_CLEAN + else PROMPT_CHAR=$PROMPT_CHAR_DIRTY + fi + echo -e "$? \$" +} + function prompt_command() { - #PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(ruby_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} " - PS1="${yellow}$(ruby_version_prompt) ${purple}\u@\h${reset_color}:\W${green}${bold_cyan}${green}$(scm_prompt_info) ${green}${reset_color}\$ " + + PS1="${yellow}$(ruby_version_prompt)${purple}\u@\h${reset_color}:\W${green}${bold_cyan}${green}$(scm_prompt_info) ${green}${reset_color}$? \$ " + + #PS1="${yellow}$(ruby_version_prompt)${purple}\u@\h${reset_color}:\W${green}${bold_cyan}${green}$(scm_prompt_info) ${green}${reset_color}\$ " } PROMPT_COMMAND=prompt_command; \ No newline at end of file