This hint assumes you are using the default bash shell. If you need to run a series of commands interactively as root (or any other user) using sudo, it's most convenient to start a new shell session with the effective user ID you want by typing sudo -s.
Prior to Leopard, you would then get a shell prompt similar to the usual one, but with the effective username in place of your username. For example, if you were logged into host foo.local as user bar, your regular shell prompt would be
[foo:~] bar$
...where the ~ represents your home directory (and it will change to show the current directory). If you started a root shell with sudo -s, the prompt would become...
[foo:~] root#
...so you could see at a glance where you were and who you were. Under Leopard, though, the behavior of sudo has changed -- you now get a default prompt with a # to indicate you're running as root -- bash-3.2#. This is much less useful, because now you can't see what host you're logged into or what your working directory is. You have to type extra commands to get that information.
cat >> .profile
export SUDO_PS1="\[\h:\w\] \u\\$ "
...then type Control-C to exit the cat process. Close the Terminal window or tab, open a new one, and start a sudo shell. You should now have the old prompt back. To revert the change, edit the file named .profile in your home directory to remove the line you added above.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20080312092116264