From 5b5b170f7902e81826fd8efbec88eb38e23e2807 Mon Sep 17 00:00:00 2001 From: Jens Neuhalfen Date: Sat, 5 Jul 2025 22:21:36 +0200 Subject: [PATCH] fix(macos): avoid calling nushell's `open` Using `shell-command` risks calling any `open` commands defined by the user's $SHELL. --- modules/os/macos/autoload.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/os/macos/autoload.el b/modules/os/macos/autoload.el index 2ae66e829..4a11947f2 100644 --- a/modules/os/macos/autoload.el +++ b/modules/os/macos/autoload.el @@ -13,12 +13,11 @@ (dired-get-file-for-visit) (buffer-file-name))) nil t))) - (command (format "open %s" - (if app-name - (format "-a %s '%s'" (shell-quote-argument app-name) path) - (format "'%s'" path))))) - (message "Running: %s" command) - (shell-command command))) + (args (cons "open" + (append (if app-name (list "-a" app-name)) + (list path))))) + (message "Running: %S" args) + (apply #'doom-call-process args))) (defmacro +macos--open-with (id &optional app dir) `(defun ,(intern (format "+macos/%s" id)) ()