--- /etc/profile.d/tcsh-settings 2005-04-22 17:45:36.000000000 +0200 +++ /etc/profile.d/tcsh-settings 2005-04-22 17:44:55.000000000 +0200 @@ -45,12 +45,30 @@ endif ## -## Set a correct shell prompt +## Set a Gentoo-ish shell prompt that also changes the window +## title if appropriate ## -if ( -o /dev/$tty ) then - set prompt="%C2%# " -else - set prompt="%B%m%b %C2%# " +if ( $?TERM ) then + switch ( $TERM ) + case xterm*: + case rxvt: + case eterm: + case screen: + case vt100: + if ( `id -u` != 0 ) then + set prompt = "%{\033]0;%m:%~\007%}%{\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 = "%{\033]0;%# %m:%~\007%}%{\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 + breaksw + default: + if ( `id -u` != 0 ) then + set prompt = "(%m:%c3) %n%% " + else + set prompt = "(%m:%c3) %# " + endif + breaksw + endsw endif ## @@ -114,24 +132,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