News for hackers. Stuff that matters.
Re:Production is Red, Development is Blue by jonhohle on Monday January 10, 2011 @02:18PM (#2089408)
I do that in bash for root/non-root users (root is red, non-root is blue):

    if [[ ${EUID} == 0 ]] ; then
        PS1='\[\033[01m\][ \[\033[01;31m\]\u@\h \[\033[00m\]\[\033[01m\]] \[\033[01;32m\]\w\[\033[00m\]\n\[\033[01;31m\]\$\[\033[00m\]> '
    else
        PS1='\[\033[01m\][ \[\033[01;34m\]\u@\h \[\033[00m\]\[\033[01m\]] \[\033[01;32m\]\w\[\033[00m\]\n\[\033[01;34m\]\$\[\033[00m\]> '
    fi
Interesting to think about using it across servers, though.
Re:Production is Red, Development is Blue by mgedmin on Tuesday January 11, 2011 @08:18AM (#2091796)
I used to have a different prompt color when SSH_CONNECTION was in my environment, to distinguish local terminals from remote connections. And also root/non-root, although I didn't know about $EUID and used the less-effective $(id -u).
Re:Production is Red, Development is Blue by s-phi-nl on Monday January 10, 2011 @08:29PM (#2090487)
Konsole does this automatically, at least on openSuSE linux.
Re:Production is Red, Development is Blue by pmjordan on Tuesday January 11, 2011 @05:21AM (#2091526)
It's actually just the default bash config on openSUSE, nothing to do with Konsole. It works on text-mode VTs, via ssh, etc.