Dear Bash Maintainer(s), Bash's default /etc/bash.bashrc (on debian systems at least) blindly overwrites PS1 even if it's been set already. This makes it difficult to use sudo's abiltity to set PS1 via the SUDO_PS1 env var.
Perhaps overly simplistic, but the following modification seems to work in all the situations I've tried: --- /etc/bash.bashrc.orig 2014-11-12 17:08:49.000000000 -0600 +++ /etc/bash.bashrc 2015-06-24 12:13:36.445096411 -0500 @@ -16,7 +16,10 @@ fi # set a fancy prompt (non-color, overwrite the one in /etc/profile) -PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +# but only if not SUDOing and have SUDO_PS1 set; then assume smart user. +if ! [ -n "${SUDO_USER}" -a -n "${SUDO_PS1}" ]; then + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi # Commented out, don't overwrite xterm -T "title" -n "icontitle" by default. # If this is an xterm set the title to user@host:dir Thanks, Eric -- Eric Engstrom - engst...@mtu.net - PGP Key: 0xC440235DF11F74CF $/='O'; eval ($_='print $_^pack"c25",<DATA>'); __END__ 58O7O26O26O84O65O74O48O42O24O4O17O75O114O6O64O89O2O68O93O39O42O49O51O52