--- tcsh-settings 2005-04-23 12:12:57.000000000 +0200 +++ /etc/profile.d/tcsh-settings 2005-05-08 15:19:17.000000000 +0200 @@ -45,12 +45,36 @@ endif ## -## Set a correct shell prompt +## Set a Gentoo-ish shell prompt ## -if ( -o /dev/$tty ) then - set prompt="%C2%# " +set promptchars = "%#" +if ( `id -u` != 0 ) then + set prompt = "%{\033[0;1;34m%}(%{\033[0;1;32m%}%m%{\033[0m%}:%{\033[0;1;34m%}%c3%{\033[0;1;34m%}) %{\033[0;1;32m%}%n%{\033[0;1;32m%}%#%{\033[0m%} " else - set prompt="%B%m%b %C2%# " + set prompt = "%{\033[0;1;34m%}(%{\033[0;1;31m%}%m%{\033[0m%}:%{\033[0;1;34m%}%c3%{\033[0;1;34m%}) %{\033[0;1;31m%}%#%{\033[0m%} " +endif + +## +## Change the window title if appropriate +## +if ( $?TERM ) then + switch ( $TERM ) + case xterm*: + case rxvt: + case eterm: + case Eterm: + case screen: + case vt100: + if ( `id -u` != 0 ) then + set prompt = "%{\033]0;%m:%~\007%}$prompt" + else + set prompt = "%{\033]0;# %m:%~\007%}$prompt" + endif + breaksw + default: + unalias precmd + breaksw + endsw endif ## @@ -114,24 +138,6 @@ # Show job completions when they're done set notify -# Change the window title of X terminals -if ( $?TERM ) then - switch ( $TERM ) - case xterm*: - case rxvt: - case eterm: - alias cwdcmd 'echo -n "\033]0;${USER}@${HOST}: $cwd\007"' - breaksw - case screen: - alias cwdcmd 'echo -n "\033_${USER}@${HOST}: $cwd\033\\"' - breaksw - default: - alias cwdcmd 'echo "Directory: $cwd"' - breaksw - endsw - cd . -endif - # Enable editing in EUC encoding for the languages where this make sense: # (From SuSE's csh.cshrc) if ( ${?LANG} ) then