Trying to customize shell prompt on a Ubuntu 18 LTS server over SSH.
On the server, the .profile
sources .bashrc
correctly, and .bashrc
has force_color_prompt=yes
uncommented. The prompt is not colored.
Tried setting it manually. It does not export:
user@ubuntu ~ $ export PS1="[ ${debian_chroot:+($debian_chroot)}\u is awesome: \w ]\\$ "
user@ubuntu ~ $ echo $PS1
\u@\h \w \$
But as root it works fine:
user@ubuntu ~ $ sudo su
root@ubuntu:/home/user# export PS1="[ ${debian_chroot:+($debian_chroot)}\u is awesome: \w ]\\$ "
[ root is awesome: /home/user ]#
What is going on?
Checked
$PROMPT_COMMAND
as advised by @terdon:Then looked harder at
.bashrc
and found:Drush was setting its own
$PROMPT_COMMAND
, apparently instead ofPS1
. Not sure howPS1
gets overwritten by this, but it does. Commenting out Drush's superfluous customization makes the problem go away. Thanks to @terdon.