Startup hook changes.

Now, regardless of order, login's contents will apply first, even
if not sourced first.  Then tcshrc will kick off and run the core
bits, as long as there is a terminal.
This commit is contained in:
2014-01-26 14:44:01 -05:00
parent d0571f211c
commit 72846dca4e
2 changed files with 66 additions and 59 deletions

View File

@ -1,37 +1,48 @@
set login_sourced if( ! $?CSHENV_LOGIN_SOURCED ) then
setenv CSHENV_LOGIN_SOURCED
if( $?CSHENV_DEBUG ) then if( $?CSHENV_DEBUG ) then
echo "Starting login..." echo "Starting login..."
endif endif
#if( ! $?CSHENV_DIR ) then if( ! $?CSHENV_DIR ) then
#setenv CSHENV_DIR ~/proj/cshenv setenv CSHENV_DIR ~/cshenv
#endif endif
#echo "Under: " $_ if( $?CSHENV_DEBUG ) then
#echo "Zero: " $0 echo "Set CSHENV_DIR to: " ${CSHENV_DIR}
endif
#if( -n "${_}" ) then #echo "Under: " $_
# echo $0 #echo "Zero: " $0
# setenv CSHENV_LOGIN_PATH $0
#else
# echo ${_}:1
# setenv CSHENV_LOGIN_PATH "${_}:1"
#else
#endif
#echo login hook lives at: ${CSHENV_LOGIN_PATH} #if( -n "${_}" ) then
# echo $0
# setenv CSHENV_LOGIN_PATH $0
#else
# echo ${_}:1
# setenv CSHENV_LOGIN_PATH "${_}:1"
#else
#endif
#echo login hook lives at: ${CSHENV_LOGIN_PATH}
if( $?CSHENV_DEBUG ) then setenv LC_NUMERIC en_US.UTF-8
setenv LC_MEASUREMENT en_US.UTF-8
setenv LC_MONETARY en_US.UTF-8
setenv LC_TIME en_US.UTF-8
if( $?CSHENV_DEBUG ) then
echo "Ending login..." echo "Ending login..."
endif
# Chain off to tcshrc, afterwards, if login hasn't been sourced
source ${CSHENV_DIR}/startup_hooks/tcshrc
endif endif
########################### ###########################
# vim: ft=tcsh # vim: ft=tcsh
########################### ###########################
setenv LC_NUMERIC en_US.UTF-8
setenv LC_MEASUREMENT en_US.UTF-8
setenv LC_MONETARY en_US.UTF-8
setenv LC_TIME en_US.UTF-8

View File

@ -1,41 +1,37 @@
set tcshrc_sourced # Only take this file in, if LOGIN is sourced. LOGIN will be sourced
# first, therefore, and will chain off to this.
if( $?CSHENV_LOGIN_SOURCED && ! $?CSHENV_TCSHRC_SOURCED ) then
if( $?CSHENV_DEBUG ) then set CSHENV_TCSHRC_SOURCED
if( $?CSHENV_DEBUG ) then
echo "Starting tcshrc..." echo "Starting tcshrc..."
endif endif
if( ! $?CSHENV_DIR ) then #if( -z ${_} ) then
setenv CSHENV_DIR ~/proj/cshenv
endif
if( $?CSHENV_DEBUG ) then
echo "Setup CSHENV_DIR to: " ${CSHENV_DIR}
endif
#if( -z ${_} ) then
#echo $0 #echo $0
#setenv CSHENV_TCSHRC_PATH $0 #setenv CSHENV_TCSHRC_PATH $0
#else #else
#echo ${_} #echo ${_}
#setenv CSHENV_TCSHRC_PATH "${_}" #setenv CSHENV_TCSHRC_PATH "${_}"
#endif #endif
#echo tcshrc hook lives at: ${CSHENV_TCSHRC_PATH} #echo tcshrc hook lives at: ${CSHENV_TCSHRC_PATH}
if( -c `tty` ) then if( -c `tty` ) then
if( $?CSHENV_DEBUG ) then if( $?CSHENV_DEBUG ) then
echo "Going to source core tcshrc..." echo "Going to source core tcshrc..."
endif endif
source ${CSHENV_DIR}/tcshrc source ${CSHENV_DIR}/tcshrc
endif endif
# Not using tcshrc bits for non-login shells. Will decide what to do later. # Not using tcshrc bits for non-login shells. Will decide what to do later.
if( $?CSHENV_DEBUG ) then if( $?CSHENV_DEBUG ) then
echo "Ending tcshrc..." echo "Ending tcshrc..."
endif
endif endif
########################### ###########################
# vim: ft=tcsh # vim: ft=tcsh
########################### ###########################