[原创]自定义terminal提示符及标题

仅供存放个人的配置文件,不要在本版发问。
回复
aBiNg
帖子: 1331
注册时间: 2006-07-09 12:22
来自: 南京

[原创]自定义terminal提示符及标题

#1

帖子 aBiNg » 2006-10-14 18:00

$gedit ~/.bashrc

1.找到"# set a fancy prompt"提示符设置一段,改为形如:
>case "$TERM" in
>...
>*)
>#PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
> PS1='helo_aBiNg:\w\$ ' #customized
> ;;
>esac
重启终端,提示符已改为:"helo_aBiNg:~$".

2.找到"# If this is an xterm set the title to user@host:dir"标题设置一段,改为形如:
>case "$TERM" in
>xterm*|rxvt*)
>#PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
> PROMPT_COMMAND='echo -ne "\033]0;helo_aBiNg@ubuntu\007"' #customized
>...
>esac
重启终端,标题已改为:"helo_aBiNg@ubuntu".
quantumfang
帖子: 74
注册时间: 2006-11-14 10:44

#2

帖子 quantumfang » 2007-01-08 13:19

不错
我的
#######################
# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS1='Ready for ${debian_chroot:+($debian_chroot)}\u:\w\$ '


# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
PROMPT_COMMAND='echo -ne "\033]0;${USER} is working in directory: ${PWD/$HOME/~}\007"'
回复