diff --git a/.bashrc b/.bashrc
index e09de945c51c28e8fd65ac62daa9393084d1069e..51ba326a96825fdfde3190cb4d5eacf278479c46 100644
--- a/.bashrc
+++ b/.bashrc
@@ -281,6 +281,7 @@ then
         [ ! -f "$sourcefile" ] || . "$sourcefile"
     done
     ! command -v direnv > /dev/null || eval "$(direnv hook bash)"
+    trap prune_prerun EXIT
 fi