问题描述
每当我尝试从 GNU Emacs 的 Windows 发行版中启动 M-x 术语时,我都会收到错误消息:
whenever I try to launch M-x term from my Windows distribution of GNU Emacs, I get the error:
apply: Spawning child process: invalid argument
在接受要运行的默认程序(bash.exe"或zsh.exe",来自 Cygwin,并存在于我的 Windows PATH 环境变量中)之后.
after accepting the default program to run (either "bash.exe" or "zsh.exe", from Cygwin, and present in my Windows PATH environment variable).
M-x shell 可以与 Cygwin 的 Zsh/Bash 一起使用.但我想使用 Term 来获得更多功能...
M-x shell does work with Zsh/Bash from Cygwin. But I'd like to use Term to get more features...
有什么帮助吗?
推荐答案
根据我的经验,Windows 不支持 Emacs 中的任何终端模拟器(term、ansi-term、multi-term).看起来主要原因是它们都依赖于 Windows 未提供的对终端(stty 等)的低级支持.试图通过编辑对例如的引用来强制 Emacs 使用 Cygwin bash.term.el 中的/bin/sh 也无济于事.它可能在 Cygwin Emacs 中工作,但我很久没有使用它了,因为原生 W32 Emacs 好得多(对我来说).Shell 模式适用于 Cygwin bash 或 Windows cmd(通过 cmdproxy,它是 Emacs 安装的一部分).如果你这样做,你可以支持 ANSI 颜色
From my experience none of the terminal emulators in Emacs (term, ansi-term, multi-term) is supported under Windows. It looks like the main reason is all of them rely on low-level support for terminals (stty, etc) which is not provided by Windows. Trying to force Emacs to use, say, Cygwin bash by editing references to e.g. /bin/sh in term.el doesn't help either. It may work in Cygwin Emacs but I haven't used it in a long time because native W32 Emacs is so much better (for me). Shell mode works fine with either Cygwin bash or Windows cmd (via cmdproxy which is part of Emacs install). You can have support for ANSI colors if you do
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
我曾多次尝试过 eshell,但最终还是在 bash 中使用了 shell 模式,因为我经常使用管道和重定向.是否有任何需要全功能终端支持的特定应用程序?一开始我错过了 top
,但后来我才开始使用 M-x proced
.
I tried eshell many times but ended up using the shell mode with bash because I tend to use pipes and redirections a lot. Are there any particular applications that you would like to use that require full-featured terminal support? I was missing top
at first but then I just started using M-x proced
.
更新:term
、ansi-term
和 multi-term
do 在 Cygwin emacs 中工作.
UPDATE: term
, ansi-term
, and multi-term
do work in Cygwin emacs.
这篇关于在 MS Windows 上使用 Emacs 的“M-x 术语":错误产生子进程:无效参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!