This commit is contained in:
Austen Adler 2014-07-22 16:02:18 -04:00
parent 376613630e
commit f76bb9c2af

11
bashrc
View File

@ -222,10 +222,15 @@ if [ "$BASH" ]; then
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/'
}
prompt(){
printf "[$txtgrn%s$txtrst][$txtred%s$txtrst][$txtblu%s$txtrst]➢" $(whoami) "$PWD" $(parse_git_branch)
a=`parse_git_branch`
if [ -z $a ] ; then
printf "[$txtgrn%s$txtrst][$txtred%s$txtrst]➢" $(whoami) "$PWD"
else
printf "[$txtgrn%s$txtrst][$txtred%s$txtrst][$txtblu%s$txtrst]➢" $(whoami) "$PWD" $(parse_git_branch)
fi
}
PS1=
PROMPT_COMMAND=prompt
PS1=""
PROMPT_COMMAND='PS1=`prompt`'
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo "`date +'%y.%m.%d-%H:%M:%S:'`" $USER "$(pwd)" "$(history 1 | cut -c8-)" >> ~/.bash_eternal_history'
#PROMPT_COMMAND='PS1="\[\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u.\h: \`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"'