summaryrefslogtreecommitdiff
path: root/.bashrc
diff options
context:
space:
mode:
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc12
1 files changed, 12 insertions, 0 deletions
diff --git a/.bashrc b/.bashrc
index 5d15aa2..40db5eb 100644
--- a/.bashrc
+++ b/.bashrc
@@ -17,3 +17,15 @@ complete -D -F _completion_loader -o bashdefault -o default
# Load if available
[ -f ~/.fzf.bash ] && . ~/.fzf.bash
[ -f ~/.config/broot/launcher/bash/br ] && . ~/.config/broot/launcher/bash/br
+
+# direnv hook
+_direnv_hook() {
+ local previous_exit_status=$?;
+ trap -- '' SIGINT;
+ eval "$("/usr/bin/direnv" export bash)";
+ trap - SIGINT;
+ return $previous_exit_status;
+};
+if ! [[ "${PROMPT_COMMAND:-}" =~ _direnv_hook ]]; then
+ PROMPT_COMMAND="_direnv_hook${PROMPT_COMMAND:+;$PROMPT_COMMAND}"
+fi