This commit is contained in:
parent
376613630e
commit
f76bb9c2af
11
bashrc
11
bashrc
@ -222,10 +222,15 @@ if [ "$BASH" ]; then
|
|||||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/'
|
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/'
|
||||||
}
|
}
|
||||||
prompt(){
|
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=
|
PS1=""
|
||||||
PROMPT_COMMAND=prompt
|
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'
|
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"'
|
#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"'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user