diff --git a/bashrc_add b/bashrc_add index b5afd50..2ef3ed8 100755 --- a/bashrc_add +++ b/bashrc_add @@ -202,6 +202,7 @@ EOF promptcommandmunge "_tmux_hook" promptcommandmunge "_umask_hook" promptcommandmunge "_pkcs11module_hook" + promptcommandmunge "_bashrc_tmp_hook" which direnv >/dev/null && eval "$(direnv hook bash)" cat << EOF >> "${MSC_LOGFILE}" @@ -230,7 +231,7 @@ EOF fi logdebug "after" else - exec bash --rcfile "${BASHRC_TMP}" + [ -e "${BASHRC_TMP}" ] && exec bash --rcfile "${BASHRC_TMP}" fi fi diff --git a/functions.sh b/functions.sh index ae5356b..23a5dd2 100755 --- a/functions.sh +++ b/functions.sh @@ -21,6 +21,13 @@ promptcommandmunge () { EXIT } +_bashrc_tmp_hook() { + if [ ! -z "${BASHRC_TMP:-x}" ]; + then + tmux set-environment BASHRC_TMP "${BASHRC_TMP}" + fi +} + _pkcs11module_hook() { if [ ! -z ${SSH_TTY:+x} ]; then