From d32dc4002f4300a9dbe3abc65daf0bfcda3d74fa Mon Sep 17 00:00:00 2001 From: Calvin Giles Date: Thu, 29 Aug 2013 10:45:11 +0100 Subject: [PATCH] Fixed. Prompt dollar now turns red on error and clears on success. --- themes/calvin/calvin.theme.bash | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/themes/calvin/calvin.theme.bash b/themes/calvin/calvin.theme.bash index b09c47e3..9ab3857d 100644 --- a/themes/calvin/calvin.theme.bash +++ b/themes/calvin/calvin.theme.bash @@ -15,21 +15,18 @@ GIT_THEME_PROMPT_SUFFIX="${green}|" RVM_THEME_PROMPT_PREFIX="|" RVM_THEME_PROMPT_SUFFIX="|" -PROMPT_CHAR_CLEAN="${reset_color}\$" -PROMPT_CHAR_DIRTY="${red}\$${reset_color}" +PROMPT_END_CLEAN="\$" +PROMPT_END_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_end(){ + echo -e "$PROMPT_END" } function prompt_command() { - - 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}\$ " + if [[ $? -eq 0 ]]; then PROMPT_END=$PROMPT_END_CLEAN + else PROMPT_END=$PROMPT_END_DIRTY + fi + PS1="${yellow}$(ruby_version_prompt)${purple}\u@\h${reset_color}:\W${green}${bold_cyan}${green}$(scm_prompt_info) ${reset_color}$(prompt_end) " } PROMPT_COMMAND=prompt_command; \ No newline at end of file