vim ~/.bashrc
__git_ps1 ()
{
local b="$(git symbolic-ref HEAD 2>/dev/null)";
if [ -n "$b" ]; then
printf " (%s)" "${b##refs/heads/}";
fi
}
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\033[0;36m\]$(__git_ps1)\[\033[0m\n\$ '
source ~/.bashrc
source 失效问题解决
https://zhidao.baidu.com/question/373226436401362844.html
网友评论