Only source direnv if it hasn't already been sourced

This commit is contained in:
anmiller 2025-08-12 21:41:58 +00:00
parent dda5fcc784
commit d67b07d275

View File

@ -163,5 +163,8 @@ prompt_command_prepend preserve_xtrace
prompt_command_append preserve_xtrace_reset
if $(which direnv &> /dev/null); then
eval "$(direnv hook bash)"
# Only if direnv isn't already defined in our prompt_command
if ! grep -q _direnv_hook <<< $PROMPT_COMMAND; then
eval "$(direnv hook bash)"
fi
fi