From 3743bc70ab227b90bb0b48b5d7aa04ed8f519075 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 1 Dec 2019 05:13:54 -0500 Subject: [PATCH] tools/direnv: fix async-shell-command --- modules/tools/direnv/config.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/tools/direnv/config.el b/modules/tools/direnv/config.el index cb05ee4b9..ae6ef6e3e 100644 --- a/modules/tools/direnv/config.el +++ b/modules/tools/direnv/config.el @@ -54,4 +54,16 @@ flycheck issues with direnv and on nix." (funcall orig-fn)) (doom-log "Couldn't find direnv executable"))) + (defadvice! +direnv-update-async-shell-command-a (command &optional output-buffer _error-buffer) + :before #'shell-command + (when (string-match "[ \t]*&[ \t]*\\'" command) + (let ((environment process-environment) + (path exec-path) + (shell shell-file-name)) + (with-current-buffer + (get-buffer-create (or output-buffer "*Async Shell Command*")) + (setq-local process-environment environment) + (setq-local exec-path path) + (setq-local shell-file-name shell))))) + (direnv-mode +1))