Bug 315

Summary: SUDO_PS1 is ignored
Product: Sudo Reporter: Bracken Dawson <abdawson>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED WORKSFORME    
Severity: enhancement    
Priority: low    
Version: 1.6.9   
Hardware: PC   
OS: Linux   

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....