From 1f0108193d8395424c83a1a80b770356399ad00a Mon Sep 17 00:00:00 2001 From: Ivan Font Date: Tue, 17 Jan 2017 00:01:49 -0800 Subject: [PATCH 1/3] Fix for issue #883 --- themes/base.theme.bash | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 42aaac58..753d075d 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -464,11 +464,13 @@ function aws_profile { } function safe_append_prompt_command { - if [[ -n $1 ]] ; then - case $PROMPT_COMMAND in - *$1*) ;; - "") PROMPT_COMMAND="$1";; - *) PROMPT_COMMAND="$1;$PROMPT_COMMAND";; - esac + local prompt_re="\<${1}\>" # exact match regex + + if [[ ${PROMPT_COMMAND} =~ ${prompt_re} ]]; then + return + elif [[ -z ${PROMPT_COMMAND} ]]; then + PROMPT_COMMAND="${1}" + else + PROMPT_COMMAND="${1};${PROMPT_COMMAND}" fi } From 31e3d78ae4bd12678e5cab8b77b41a9be5971c1c Mon Sep 17 00:00:00 2001 From: Ivan Font Date: Sun, 29 Jan 2017 22:38:58 -0800 Subject: [PATCH 2/3] Fix exact match regular expression for macOS --- themes/base.theme.bash | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 753d075d..6d32dc14 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -464,7 +464,16 @@ function aws_profile { } function safe_append_prompt_command { - local prompt_re="\<${1}\>" # exact match regex + local prompt_re + + # Set OS dependent exact match regular expression + if [[ ${OSTYPE} == darwin* ]]; then + # macOS + prompt_re="[[:<:]]${1}[[:>:]]" + else + # Linux, FreeBSD, etc. + prompt_re="\<${1}\>" + fi if [[ ${PROMPT_COMMAND} =~ ${prompt_re} ]]; then return From 88802c141b934194a9eaae0378bdd91bcfc13998 Mon Sep 17 00:00:00 2001 From: ari mourao Date: Fri, 3 Feb 2017 15:12:49 -0200 Subject: [PATCH 3/3] new theme 90210 added --- themes/90210/90210.theme.bash | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 themes/90210/90210.theme.bash diff --git a/themes/90210/90210.theme.bash b/themes/90210/90210.theme.bash new file mode 100644 index 00000000..e683e0ef --- /dev/null +++ b/themes/90210/90210.theme.bash @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +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}|" +GIT_THEME_PROMPT_SUFFIX="${green}|" + +# Nicely formatted terminal prompt +function prompt_command(){ + export PS1="\n${bold_black}[${blue}\@${bold_black}]-${bold_black}[${green}\u${yellow}@${green}\h${bold_black}]-${bold_black}[${purple}\w${bold_black}]-$(scm_prompt_info)\n${reset_color}\$ " +} + +safe_append_prompt_command prompt_command