您的位置:首页 > 其它

ubuntu配置终端路径显示为只有一个>

2012-08-06 13:27 701 查看
编辑~/.bashrc


if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
修改为
if [ "$color_prompt" = yes ]; then
PS1='\[\e]2;\u@\H \w\a\e[32;1m\]>\[\e[0m\] '
else
PS1='\[\e]2;\u@\H \w\a\e[32;1m\]>\[\e[0m\] '
fi
注意结尾的单引号前的空格.

即PS1修改为

PS1='\[\e]2;\u@\H \w\a\e[32;1m\]>\[\e[0m\] '


配置完成后,使用

source ~/.bashrc
使其生效.
效果如下图

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ubuntu 终端 debian