Bug 315 - SUDO_PS1 is ignored
SUDO_PS1 is ignored
Status: RESOLVED WORKSFORME
Product: Sudo
Classification: Unclassified
Component: Sudo
1.6.9
PC Linux
: low enhancement
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-20 19:59 MST by Bracken Dawson
Modified: 2009-02-06 13:54 MST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bracken Dawson 2008-11-20 19:59:40 MST
SUDO_PS1 is set in .bashrc (tried .profile, and both files for root).

Trying to make the username@host red during "sudo -s", but it just uses $PS1.




debug:

bracken@testvbox:~$ sudo -s
root@testvbox:~# echo $PS1
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
root@testvbox:~# echo $SUDO_PS1
${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
Comment 1 Todd C. Miller 2009-02-03 09:34:12 MST
Works fine for me.  Perhaps you have SUDO_PS1 set but not exported.
Comment 2 Bracken Dawson 2009-02-06 13:54:53 MST
exported...



bracken@eeepc:~$ export SUDO_PS1='doesntworkforme'
bracken@eeepc:~$ echo $SUDO_PS1
doesntworkforme
bracken@eeepc:~$ sudo -s
root@eeepc:~# echo $SUDO_PS1

root@eeepc:~# echo $PS1
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
root@eeepc:~# exit
bracken@eeepc:~$ env
SUDO_PS1=doesntworkforme
KDE_MULTIHEAD=false
and so on....