diff --git a/tcshrc b/tcshrc index 1fe0c4d..9be9074 100644 --- a/tcshrc +++ b/tcshrc @@ -52,12 +52,26 @@ if( $?CSHENV_HISTORY_SIZE ) then set history=${CSHENV_HISTORY_SIZE} endif -# this safe_source alias is incredibly delicate. It drives the whole +if( $?CSHENV_DEBUG ) echo "Setting up optional sourcing mechanism." +# This safe_source alias is incredibly delicate. It drives the whole # optional sourcing mechanism -- DO NOT MESS WITH IT! alias safe_source 'eval "if ( -f \!:1 ) then \\ source \!:1 \\ endif"' +if( $?CSHENV_DEBUG ) echo "Setting up optional session sourcing mechanism." +# These reload_session and `__load_session` aliases ar incredibly delicate. They drives +# the whole optional session mechanism -- DO NOT MESS WITH IT LIGHTLY! +alias __load_session safe_source tcshrc.session.\$CSHENV_SESSION_PROFILE +if( $?CSHENV_DEBUG ) echo "Setting up optional session sourcing mechanism wrapper." +alias reload_session 'eval "if ( \$?CSHENV_SESSION_PROFILE ) then \\ +__load_session \\ +endif"' + +if( $?CSHENV_DEBUG ) echo "Setting change session alias..." +alias change_session setenv CSHENV_SESSION_PROFILE \!:1\;__load_session + + if( $?CSHENV_DEBUG ) then echo "TCSH safe-source alias constructed..." endif @@ -123,6 +137,11 @@ source ${CSHENV_DIR}/tcshrc.prompt safe_source ${CSHENV_DIR}/tcshrc.user +if( $?CSHENV_DEBUG ) echo "Loading session, if one is set" +reload_session +if( $?CSHENV_DEBUG ) echo "Session loading done" + + ########################### # vim: ft=tcsh ########################### diff --git a/tcshrc.prompt.final b/tcshrc.prompt.final index db9c1e6..58602c9 100644 --- a/tcshrc.prompt.final +++ b/tcshrc.prompt.final @@ -2,6 +2,16 @@ ### Final Prompt Setting ### ############################ +#if( $?CSHENV_DEBUG ) then +# echo "Loading prompt session information." +#endif +#if( $?CSHENV_SESSION_PROFILE ) then +# safe_source ${CSHENV_DIR}/tcshrc.session.prompt.${CSHENV_SESSION_PROFILE} +#endif +#if( $?CSHENV_DEBUG ) then +# echo "Loaded prompt session information." +#endif + if( $?CSHENV_DEBUG ) then echo "Setting up dynamic colour loading..." endif diff --git a/tcshrc.session.default b/tcshrc.session.default new file mode 100644 index 0000000..b9e73a4 --- /dev/null +++ b/tcshrc.session.default @@ -0,0 +1 @@ +source ${CSHENV_DIR}/tcshrc.prompt.colors