diff --git a/modules/completion/ivy/autoload/ivy.el b/modules/completion/ivy/autoload/ivy.el index dca6d7542..707dea79d 100644 --- a/modules/completion/ivy/autoload/ivy.el +++ b/modules/completion/ivy/autoload/ivy.el @@ -307,6 +307,20 @@ The point of this is to avoid Emacs locking up indexing massive file trees." (#'counsel-file-jump)))) +(defvar +ivy-file-search-shell + (or (executable-find "dash") + (executable-find "sh") + shell-file-name) + "The SHELL to invoke ag/rg/pt/git-grep/grep searchs from. + +This only affects `+ivy/*' search commands (e.g. `+ivy/rg' and +`+ivy/project-search'). + +By default, this the most basic, uncustomized shell, to prevent interference +caused by slow shell configs at the cost of isolating these programs from +envvars that may have been set in the user's shell config to change their +behavior. If this bothers you, change this to `shell-file-name'.") + ;;;###autoload (cl-defun +ivy-file-search (engine &key query in all-files (recursive t)) "Conduct a file search using ENGINE, which can be any of: rg, ag, pt, and @@ -359,7 +373,8 @@ order. ((file-relative-name directory project-root)))))) (require 'counsel) (let ((ivy-more-chars-alist - (if query '((t . 1)) ivy-more-chars-alist))) + (if query '((t . 1)) ivy-more-chars-alist)) + (shell-file-name +ivy-file-search-shell)) (pcase engine (`grep (let ((counsel-projectile-grep-initial-input query))