diff --git a/bash/.bashrc b/bash/.bashrc index f226930..87718fb 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -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