From d67b07d275c33ab2f5592cdc14e53d4889429a55 Mon Sep 17 00:00:00 2001 From: anmiller Date: Tue, 12 Aug 2025 21:41:58 +0000 Subject: [PATCH] Only source direnv if it hasn't already been sourced --- bash/.bashrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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