fix(macos): avoid calling nushell's open

Using `shell-command` risks calling any `open` commands defined by the user's
$SHELL.
This commit is contained in:
Jens Neuhalfen
2025-07-05 22:21:36 +02:00
committed by GitHub
parent 6010b40247
commit 5b5b170f79

View File

@ -13,12 +13,11 @@
(dired-get-file-for-visit) (dired-get-file-for-visit)
(buffer-file-name))) (buffer-file-name)))
nil t))) nil t)))
(command (format "open %s" (args (cons "open"
(if app-name (append (if app-name (list "-a" app-name))
(format "-a %s '%s'" (shell-quote-argument app-name) path) (list path)))))
(format "'%s'" path))))) (message "Running: %S" args)
(message "Running: %s" command) (apply #'doom-call-process args)))
(shell-command command)))
(defmacro +macos--open-with (id &optional app dir) (defmacro +macos--open-with (id &optional app dir)
`(defun ,(intern (format "+macos/%s" id)) () `(defun ,(intern (format "+macos/%s" id)) ()