Terminal in Emacs in Windows - Error message: “Spawning child process; invalid argument”

前端 未结 6 627
南笙
南笙 2021-02-01 14:31

I\'m trying to start a cmd terminal in Emacs 23.2 (latest version) in Windows.

According to the Manual, I can enter in terminal mode (starting a new bu

6条回答
  •  南笙
    南笙 (楼主)
    2021-02-01 15:01

    I got the same error while trying to run M-x compile. I added the following to my .emacs file and it fixed the problem:

    ;; Make sure that the bash executable can be found
    (setq explicit-shell-file-name "C:/cygwin/bin/bash.exe")
    (setq shell-file-name explicit-shell-file-name)
    (add-to-list 'exec-path "C:/cygwin/bin")
    

    Obviously this solution will only work if you have Cygwin installed, but if you are running Emacs on Windows it is usually worth at least a minimal install of Cygwin because many Emacs commands can leverage the command-line tools made available by cygwin (M-x compile in my case).

提交回复
热议问题