Fix bug: themes break global $PROMPT_COMMAND variable
Safely append functions to $PROMPT_COMMAND instead of setting it.pull/754/head
parent
418b06e65c
commit
af96da5d11
|
|
@ -35,4 +35,4 @@ function prompt_command() {
|
|||
PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]@ \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\[$SCM_THEME_PROMPT_PREFIX\]${white}\t \[$PURPLE\]\$(scm_prompt_info) \n\$ \[$RESET\]"
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -19,4 +19,4 @@ function prompt_command() {
|
|||
PS1="\n${cyan}\h: ${reset_color} ${yellow}\w ${green}$(scm_prompt_info)\n${reset_color}→ "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -403,3 +403,12 @@ function aws_profile {
|
|||
echo -e "default"
|
||||
fi
|
||||
}
|
||||
|
||||
function safe_append_prompt_command {
|
||||
if [[ -n $1 ]] ; then
|
||||
case $PROMPT_COMMAND in
|
||||
*$1*) ;;
|
||||
*) PROMPT_COMMAND="$1;$PROMPT_COMMAND";;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
|
@ -102,4 +102,4 @@ SCM_GIT_CHAR="${green}±${light_grey}"
|
|||
SCM_SVN_CHAR="${bold_cyan}⑆${light_grey}"
|
||||
SCM_HG_CHAR="${bold_red}☿${light_grey}"
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -16,4 +16,4 @@ function prompt_command() {
|
|||
PS1="\n${yellow}$(python_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -17,4 +17,4 @@ function prompt_command() {
|
|||
PS1="\n$(battery_char) $(clock_char) ${yellow}$(ruby_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -31,4 +31,4 @@ ${white}>${normal} "
|
|||
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
|
|||
|
|
@ -3,4 +3,4 @@ function prompt_command() {
|
|||
PS1="${green}\u@\h ${blue}\T ${reset_color}${white}\w${reset_color}$(scm_prompt_info)${blue} →${bold_blue} ${reset_color} ";
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -17,4 +17,4 @@ function prompt_command() {
|
|||
RPROMPT='[\t]'
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -36,4 +36,4 @@ function prompt() {
|
|||
PS1="\n${user_host}${prompt_symbol}${ruby} ${git_branch} ${return_status}\n${prompt_char}"
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
|
|||
|
|
@ -76,4 +76,4 @@ function prompt_command() {
|
|||
}
|
||||
|
||||
# Runs prompt (this bypasses bash_it $PROMPT setting)
|
||||
PROMPT_COMMAND=prompt_command
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -126,5 +126,5 @@ ${D_INTERMEDIATE_COLOR}$ ${D_DEFAULT_COLOR}"
|
|||
}
|
||||
|
||||
# Runs prompt (this bypasses bash_it $PROMPT setting)
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ $(doubletime_scm_prompt)$reset_color $ "
|
|||
PS4='+ '
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_setter
|
||||
safe_append_prompt_command prompt_setter
|
||||
|
||||
git_prompt_status() {
|
||||
local git_status_output
|
||||
|
|
|
|||
|
|
@ -21,4 +21,4 @@ $(doubletime_scm_prompt)$reset_color $ "
|
|||
PS4='+ '
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_setter
|
||||
safe_append_prompt_command prompt_setter
|
||||
|
|
|
|||
|
|
@ -21,4 +21,4 @@ $(doubletime_scm_prompt)$reset_color $ "
|
|||
PS4='+ '
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_setter
|
||||
safe_append_prompt_command prompt_setter
|
||||
|
|
|
|||
|
|
@ -95,4 +95,4 @@ dulcie_prompt() {
|
|||
PS1="${PS1}${DULCIE_PROMPTCHAR} "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=dulcie_prompt
|
||||
safe_append_prompt_command dulcie_prompt
|
||||
|
|
|
|||
|
|
@ -21,4 +21,4 @@ prompt() {
|
|||
PS1="${yellow}# ${reset_color}$(last_two_dirs)$(scm_prompt_info)${reset_color}$(venv)${reset_color} ${cyan}\n> ${reset_color}"
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
|
|||
|
|
@ -31,4 +31,4 @@ function prompt_command() {
|
|||
PS1="\n$(get_hour_color)$(date +%H) ${purple}\h ${reset_color}in ${prompt_color}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -13,4 +13,4 @@ function prompt_command() {
|
|||
PS1="\n${yellow}$(ruby_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -38,4 +38,4 @@ pure_prompt() {
|
|||
esac
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=pure_prompt;
|
||||
safe_append_prompt_command pure_prompt
|
||||
|
|
|
|||
|
|
@ -197,4 +197,4 @@ function prompt() {
|
|||
PS4='+ '
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
|
|||
|
|
@ -56,4 +56,4 @@ function prompt_command() {
|
|||
PS1="${new_PS1}${green}${wrap_char}→${reset_color} "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -26,4 +26,4 @@ function prompt_command() {
|
|||
$arrow $prompt"
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -127,4 +127,4 @@ PS2="└─▪ "
|
|||
|
||||
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
|
|||
|
|
@ -31,4 +31,4 @@ function prompt() {
|
|||
PS1="\n${n_commands} ${user_host} ${prompt_symbol} ${ruby} ${open}${current_path}${git_branch}${close}${return_status}\n${prompt_char}"
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
@ -9,4 +9,4 @@ prompt() {
|
|||
PS1="$(scm_prompt_info)${reset_color} ${cyan}\W${reset_color} "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
|
|||
|
|
@ -53,4 +53,4 @@ PS2="└─▪ "
|
|||
|
||||
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
|
|||
|
|
@ -53,4 +53,4 @@ PS2="└─▪ "
|
|||
|
||||
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
|
|||
|
|
@ -25,4 +25,4 @@ SCM_THEME_PROMPT_PREFIX="${green}("
|
|||
SCM_THEME_PROMPT_SUFFIX="${green})${reset_color}"
|
||||
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ function prompt_command() {
|
|||
PS1="${bold_blue}[$(hostname)]${normal} \w${normal} ${bold_white}[$(git_prompt_info)]${normal}» "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
||||
## git-theme
|
||||
# feel free to change git chars.
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ prompt_setter() {
|
|||
PS4='+ '
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_setter
|
||||
safe_append_prompt_command prompt_setter
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ prompt_setter() {
|
|||
PS4='+ '
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_setter
|
||||
safe_append_prompt_command prompt_setter
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ prompt_setter() {
|
|||
PS4='+ '
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_setter
|
||||
safe_append_prompt_command prompt_setter
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ✓"
|
||||
|
|
|
|||
|
|
@ -240,4 +240,4 @@ function __powerline_prompt_command {
|
|||
SEGMENTS_AT_LEFT SEGMENTS_AT_RIGHT
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=__powerline_prompt_command
|
||||
safe_append_prompt_command __powerline_prompt_command
|
||||
|
|
|
|||
|
|
@ -106,5 +106,5 @@ function powerline_prompt_command() {
|
|||
PS1="${SHELL_PROMPT}${VIRTUALENV_PROMPT}${SCM_PROMPT}${CWD_PROMPT}${LAST_STATUS_PROMPT} "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=powerline_prompt_command
|
||||
safe_append_prompt_command powerline_prompt_command
|
||||
|
||||
|
|
|
|||
|
|
@ -120,5 +120,5 @@ function powerline_prompt_command() {
|
|||
PS1="${SHELL_PROMPT}${GEMSET_PROMPT}${VIRTUALENV_PROMPT}${SCM_PROMPT}${CWD_PROMPT}${LAST_STATUS_PROMPT} "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=powerline_prompt_command
|
||||
safe_append_prompt_command powerline_prompt_command
|
||||
|
||||
|
|
|
|||
|
|
@ -129,5 +129,5 @@ function powerline_prompt_command() {
|
|||
PS1="${SHELL_PROMPT}${IN_VIM_PROMPT}${VIRTUALENV_PROMPT}${SCM_PROMPT}${CWD_PROMPT}${LAST_STATUS_PROMPT} "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=powerline_prompt_command
|
||||
safe_append_prompt_command powerline_prompt_command
|
||||
|
||||
|
|
|
|||
|
|
@ -5,4 +5,4 @@ function prompt_command() {
|
|||
PS1="${blue}\T ${reset_color}${white}\w${reset_color}$(scm_prompt_info)${blue} →${bold_blue} ${reset_color} ";
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
@ -19,4 +19,4 @@ function prompt() {
|
|||
PS1="\h: \W $(scm_prompt_info)${reset_color} $ "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
|
|||
|
|
@ -40,4 +40,4 @@ pure_prompt() {
|
|||
esac
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=pure_prompt;
|
||||
safe_append_prompt_command pure_prompt
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ prompt_setter() {
|
|||
PS4='+ '
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_setter
|
||||
safe_append_prompt_command prompt_setter
|
||||
|
||||
SCM_NONE_CHAR='·'
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
|
|
|
|||
|
|
@ -211,4 +211,4 @@ ${D_INTERMEDIATE_COLOR}$ ${D_DEFAULT_COLOR}"
|
|||
}
|
||||
|
||||
# Runs prompt (this bypasses bash_it $PROMPT setting)
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
|
|||
|
|
@ -97,4 +97,4 @@ PS2="└─$(my_prompt_char)"
|
|||
|
||||
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@ function prompt_command() {
|
|||
fi
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -43,4 +43,4 @@ function prompt_command() {
|
|||
PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]at \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$PURPLE\]\$(parse_git_branch)\[$WHITE\]\n\$ \[$RESET\]"
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -22,4 +22,4 @@ SCM_THEME_PROMPT_CLEAN=" ✓"
|
|||
SCM_THEME_PROMPT_PREFIX="("
|
||||
SCM_THEME_PROMPT_SUFFIX=")"
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -19,4 +19,4 @@ function prompt_command() {
|
|||
PS1="$blue\W/$bold_blue$(rvm_version_prompt)$bold_green$(__git_ps1 " (%s)") ${normal}$ "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -83,4 +83,4 @@ PS2="> "
|
|||
|
||||
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
|
|||
|
|
@ -21,4 +21,4 @@ function prompt_command() {
|
|||
PROMPT='${green}\u${normal}@${green}\h${normal}:${blue}\w${normal}${red}$(prompt_char)$(git_prompt_info)${normal}\$ '
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ PS2="$LIGHT_BLUE-$YELLOW-$YELLOW-$NO_COLOUR "
|
|||
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_setter
|
||||
safe_append_prompt_command prompt_setter
|
||||
|
||||
export PS3=">> "
|
||||
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@ function prompt_command() {
|
|||
PS1="${yellow}\u${normal}${cyan}@\h${normal}${purple} ${normal}${green}\w${normal}$(scm_prompt_info)> "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -17,4 +17,4 @@ function prompt_command() {
|
|||
PS1="\n${green}$(virtualenv_prompt)${red}$(ruby_version_prompt) ${reset_color}\h ${orange}in ${reset_color}\w\n${yellow}$(scm_char)$(scm_prompt_info) ${yellow}→${white} "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -21,4 +21,4 @@ function prompt_command() {
|
|||
PS1="${no_color}\u:$(hostname)${normal}:${bold_yellow}\W/${normal} $(git_prompt_info)${reset_color}$ "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=prompt_command;
|
||||
safe_append_prompt_command prompt_command
|
||||
|
|
|
|||
|
|
@ -94,4 +94,4 @@ PS2="└─▪ "
|
|||
|
||||
|
||||
|
||||
PROMPT_COMMAND=prompt
|
||||
safe_append_prompt_command prompt
|
||||
|
|
|
|||
Loading…
Reference in New Issue