-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
tweak(macos): use full path for open #8433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Use the full path for the MacOS "open" command. Using plain "open" will conflict with nushell's "open" command. Use the full path for open to make it working.
I'd rather avoid full paths where I can (so users can still shim or replace (defadvice! fixed-+macos-open-with (&optional app-name path)
:override #'+macos-open-with
(let* ((path (expand-file-name
(replace-regexp-in-string
"'" "\\'"
(or path (if (derived-mode-p 'dired-mode)
(dired-get-file-for-visit)
(buffer-file-name)))
nil t)))
(args (cons "open"
(append (if app-name (list "-a" app-name))
(list path)))))
(message "Running: %S" args)
(apply #'doom-call-process args))) |
That works |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then in that case, please make this change to +macos-open-with
:
(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)))
@neuhalje presumably this is because (setq shell-file-name (executable-find "bash"))
(let ((fishpath (executable-find "fish")))
(when fishpath
(setq explicit-shell-file-name fishpath
vterm-shell fishpath))) Otherwise I ran into a lot of problems with emacs modules that expected hlissner's suggestion looks good though - I don't think there's any need to use a shell for macos-open-with. |
Use the full path for the MacOS "open" command.
Using plain "open" will conflict with nushell's "open" command. Use the full path for open to make it working.