Wednesday, September 21, 2011

Change gnome-terminal title to remote Hostname

Add the following script in .bashrc

case "$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
    ;;
screen)
    PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}: ${PWD/$HOME/~}\033\\"'
    ;;
*)
    ;;
esac



Ref

No comments:

Post a Comment