Merge pull request #331 from iterateNZ/iterate_theme

Update iterate theme
pull/335/head
Travis Swicegood 2014-08-25 10:24:03 -07:00
commit 08fd9ed25e
1 changed files with 8 additions and 2 deletions

View File

@ -40,11 +40,17 @@ function git_prompt_info {
echo -e "$SCM_PREFIX$SCM_BRANCH$SCM_STATE$SCM_GIT_AHEAD$SCM_GIT_BEHIND$SCM_GIT_STASH$SCM_SUFFIX"
}
LAST_PROMPT_INFO=""
function prompt_command() {
local prompt_info="${bold_cyan}$(scm_char)${yellow}$(ruby_version_prompt)${green}\w $(scm_prompt_info)"
local prompt_info="\n${bold_cyan}$(scm_char)${yellow}$(ruby_version_prompt)${green}\w $(scm_prompt_info)"
if [ "$LAST_PROMPT_INFO" = "$prompt_info" ]; then
prompt_info=""
else
LAST_PROMPT_INFO="$prompt_info"
fi
local wrap_char=""
[[ ${#prompt_info} -gt $(($COLUMNS/1)) ]] && wrap_char="\n"
PS1="\n${prompt_info}${green}${wrap_char}${reset_color} "
PS1="${prompt_info}${green}${wrap_char}${reset_color} "
}
PROMPT_COMMAND=prompt_command;