From d9ec9a88b0a8f41477c44b251d863d238d35cc51 Mon Sep 17 00:00:00 2001 From: Dominik Kellner Date: Wed, 16 Oct 2019 20:57:09 +0200 Subject: [PATCH] Prevent `eshell-path-env` getting out-of-sync with $PATH (#55) * Prevent `eshell-path-env` getting out-of-sync with $PATH * use derived-mode-p to check current major mode --- direnv.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/direnv.el b/direnv.el index af7f54d..ec94a73 100644 --- a/direnv.el +++ b/direnv.el @@ -227,7 +227,10 @@ When FORCE-SUMMARY is non-nil or when called interactively, show a summary messa (value (cdr pair))) (setenv name value) (when (string-equal name "PATH") - (setq exec-path (append (parse-colon-path value) (list exec-directory)))))))) + (setq exec-path (append (parse-colon-path value) (list exec-directory))) + ;; Prevent `eshell-path-env` getting out-of-sync with $PATH: + (when (derived-mode-p 'eshell-mode) + (setq eshell-path-env value))))))) ;;;###autoload (defun direnv-allow ()