tra*_*res 5 windows emacs shell msys2
尝试在 Windows 上的 Emacs 中启动连接到 MSYS2 的劣质 shell(Mx shell)。
我从Mastering Emacs - Running Shells in Emacs Mastering Emacs 中找到了这段代码,并对其进行了修改:
(setq explicit-shell-file-name "D:/msys64/usr/bin/bash.exe")
(setq shell-file-name "bash")
(setq explicit-bash.exe-args '("--login" "-i")) <- Have also tried -c, and without "--login"
(setenv "SHELL" shell-file-name)
(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)
Run Code Online (Sandbox Code Playgroud)
我得到以下信息:
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
]0;~
me@computer MSYS ~
$
Run Code Online (Sandbox Code Playgroud)
所以我有一些额外的愚蠢字符和一个不适当的命令传递到 MSYS shell,但这是进步!Windows 上的 MSYS2 + Emacs 会很棒。
问题出-i在 Bash 上。它意味着交互,因此 Bash 尝试配置终端,ioctl这对于本机 Windows Emacs 来说是无意义的。-i当您使用 MSYS2 Bash 时,请剥离本机 Emacs。