这在Mac上工作正常,但在尝试在Windows上进行设置时,它无效。
我已经在Windows路径上安装了msysGit Bash,并尝试按照其他说明进行设置。
(setq explicit-shell-file-name "bash")
(setq shell-file-name explicit-shell-file-name)
(setenv "SHELL" "bash")
(setq explicit-bash-args '("--noediting" "-i"))
(setq w32-quote-process-args ?\")
(setenv "PATH"
(concat ".:/usr/local/bin:/mingw/bin:/bin:"
(replace-regexp-in-string " " "\\\\ "
(replace-regexp-in-string "\\\\" "/"
(replace-regexp-in-string "\\([A-Za-z]\\):" "/\\1"
(getenv "PATH"))))))
答案 0 :(得分:0)
我添加了
(setq debug-on-error t)
重新运行命令M-x magit-version
以获得输出:
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
string-match("cmd\\.exe" nil)
(if (string-match "cmd\\.exe" tramp-encoding-shell) "/c" "-c")
eval((if (string-match "cmd\\.exe" tramp-encoding-shell) "/c" "-c"))
然后我设置
(setq tramp-encoding-shell explicit-shell-file-name)
一切都开始正常运作。