在.bashrc中设置chroot颜色

时间:2013-04-30 22:38:55

标签: bash

我正在尝试微调我的.bashrc文件,并希望我可以让chroot成为默认白色以外的其他颜色。除了一些git东西和着色方案之外,我的rc文件非常接近默认值。问题是我似乎无法在没有问题的情况下调用debian_chroot之前将chroot设置为红色。这是我认为相关的摘录。

source ~/.git-prompt.sh
if [ "$color_prompt"=yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]$(__git_ps1 "(%s)") '
    PS1="$PS1\[\033[00m\]\u@\h:\n\[\033[01;34m\]\w\[\033[00m\] \$ "
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w $(__git_ps1 "(%s)") \$ '
fi

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac
unset color_prompt force_color_prompt

如何在bash提示符下将chroot颜色设置为红色?

0 个答案:

没有答案
相关问题