分页: 1 / 1

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

发表于 : 2006-10-14 18:00
aBiNg
$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".

发表于 : 2007-01-08 13:19
quantumfang
不错
我的
#######################
# 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"'