xterm prompt

For some reason the /etc/profile in Gentoo doesn't set the variable used by xterm to display information in the header. Below is how I fixed it on my machine.

If you're using bash, then create a file called ~/.bash_login . We'll put all of our specific initialization stuff in here.

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

This will ensure that it only sets the "PROMPT_COMMAND" when your terminal is set to an xterm derivitive, and not a login shell.


Click here to return to index