简体   繁体   English

MSYS2 下级 shell 在 Emacs 在 Windows

[英]MSYS2 inferior shell in Emacs on Windows

Trying to launch an inferior shell (Mx shell) in Emacs on Windows that connects to MSYS2.尝试在连接到 MSYS2 的 Emacs 上的 Emacs 中启动劣质的 shell(Mx shell)。

I found this snippet from Mastering Emacs - Running Shells in Emacs Mastering Emacs, and adapted it:我从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)

I get the following:我得到以下信息:

bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
]0;~
me@computer MSYS ~
$ 

So I have some extra goofy characters and an inappropriate command passed to the MSYS shell, but this is progress.所以我有一些额外的傻瓜字符和一个不适当的命令传递给 MSYS shell,但这是进步。 MSYS2 + Emacs on Windows would be AMAZING. Windows 上的 MSYS2 + Emacs 会很棒。

The problem is -i for Bash. It means interactive, so Bash attempts to configure terminal with ioctl which is nonsense for native Windows Emacs. Strip -i in native Emacs when you are using MSYS2 Bash.问题是 Bash 的-i 。这意味着交互式,因此 Bash 尝试使用ioctl配置终端,这对于本机 Windows Emacs 是无意义的。当您使用 MSYS2 时,在本机 Emacs 中剥离-i Bash

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM