我使用 Windows 图形化 Emacs 有一段时间了,我正尝试将它与 Windows 10 的新 Windows Bash 一起使用。我想要做的是,当我输入 Windows Emacs M-x shell
时,我希望它使用 Windows Bash shell,而不是普通的 Windows cmd。我尝试将其添加到我的 .emacs 文件中:
(setq explicit-shell-file-name "C:/path/to/bash.exe")
(setq shell-file-name "bash")
(setq explicit-bash.exe-args '("--noediting" "--login" "-i"))
(setenv "SHELL" shell-file-name)
(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)
我从 here 得到的.这一点,当我运行 M-x shell
时,出现了 Spawning child process: invalid argument
错误。我试着省略第三行,因为它是关于争论的,但那没有任何作用。有没有办法做到这一点?提前致谢。
最佳答案
所以这个 defun 对我来说可以启动 WSL
bash shell。
(defun run-win-ubuntu ()
(交互的)
(let ((shell-file-name "C:\\Windows\\System32\\bash.exe"))
(外壳“*ubuntu*”))
)
关于windows - 更改 Emacs M-x shell 以使用 Windows 10 bash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40432242/