Skip to content

Commit

Permalink
tools/direnv: fix async-shell-command
Browse files Browse the repository at this point in the history
  • Loading branch information
hlissner committed Dec 1, 2019
1 parent c7a6cf8 commit 3743bc7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/tools/direnv/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit 3743bc7

Please sign in to comment.