purcell / exec-path-from-shell

Make Emacs use the $PATH set up by the user's shell
Other
1.41k stars 81 forks source link

exec-path-from-shell-printf path issue on Windows 11 using Git Bash #117

Closed zhedye closed 7 months ago

zhedye commented 7 months ago

I am running the Emacs 29.2 native binary on Windows 11 using Git Bash 2.42.0.2.

The path invoked for printf is c:/Program Files/Git/usr/bin/printf.exe, but the an error message is returned bash: c:/Program: No such file or directory.

The entire error message and backtrace:

Message: Non-zero exit code from shell C:\Program Files\Git\usr\bin\bash.exe invoked with args ("-l" "-i" "-c" "c:/Program Files/Git/usr/bin/printf.exe '__RESULT\\000%s\\000__RESULT' \"${SSH_AGENT_PID-bfa9e8c5cee9604e34a9ea2bdc07399f}\"").  Output was:
    "bash: cannot set terminal process group (-1): Inappropriate ioctl for device
    bash: no job control in this shell
    bash: c:/Program: No such file or directory
    "
    Backtrace:
      (error "Non-zero exit code from shell %s invoked with args %S.  Output was:\n%S" "C:\\Program Files\\Git\\usr\\bin\\bash.exe" ("-l" "-i" "-c" "c:/Program Files/Git/usr/bin/printf.exe '__RESULT\\000%s\\000__RESULT' \"${SSH_AGENT_PID-bfa9e8c5cee9604e34a9ea2bdc073...
      (exec-path-from-shell-printf "%s" ("${SSH_AGENT_PID-bfa9e8c5cee9604e34a9ea2bdc07399f}"))
      (exec-path-from-shell-getenvs ("SSH_AGENT_PID"))
      (exec-path-from-shell-copy-envs ("SSH_AGENT_PID"))
      (exec-path-from-shell-copy-env "SSH_AGENT_PID")
      (progn (exec-path-from-shell-copy-env "SSH_AGENT_PID") (exec-path-from-shell-copy-env "SSH_AUTH_SOCK"))
      (progn (progn (exec-path-from-shell-copy-env "SSH_AGENT_PID") (exec-path-from-shell-copy-env "SSH_AUTH_SOCK")) t)
      (condition-case err (progn (progn (exec-path-from-shell-copy-env "SSH_AGENT_PID") (exec-path-from-shell-copy-env "SSH_AUTH_SOCK")) t) ((debug error) (funcall use-package--warning167 :config err)))
      (if (not (require 'exec-path-from-shell nil t)) (display-warning 'use-package (format "Cannot load %s" 'exec-path-from-shell) :error) (condition-case err (progn (progn (exec-path-from-shell-copy-env "SSH_AGENT_PID") (exec-path-from-shell-copy-env "SSH_AUTH_SOCK...
      (condition-case err (if (not (require 'exec-path-from-shell nil t)) (display-warning 'use-package (format "Cannot load %s" 'exec-path-from-shell) :error) (condition-case err (progn (progn (exec-path-from-shell-copy-env "SSH_AGENT_PID") (exec-path-from-shell-cop...
      (load-with-code-conversion "c:/Users/User/.doom.d/config.el" "c:/Users/User/.doom.d/config.el" nil t)
      (load "~/.doom.d/config" nil nomessage)
purcell commented 7 months ago

Hi, I pushed a fix, and the MELPA package is updated too. Would you mind trying it out please?

zhedye commented 7 months ago

It works! Thanks for the quick fix.

purcell commented 7 months ago

Great, thanks.