最近为了访问SUA - http://www.suacommunity.com - subsystem而购买了Windows7旗舰版,我一直在努力让SUA的bash实用程序(/usr/local/bin/bash)与EmacsW32一起工作。默认情况下,SUA附带ksh和csh,所以我安装了一个社区包来获取bash进程。
M-x shell通常会调用shell进程,并通过Emacs缓冲区通过管道传输stdio。这与Cygwin配合得很好。我尝试调整emacs变量,如w32-shell-*,将其指向SUA bash可执行文件,还尝试通过SUA提供的posix.exe工具调用bash。我经常看到,与bash进程相关联的文件描述符在EmacsW32创建进程后立即被删除。
与SUA相比,Cygwin的速度非常慢,所以我非常希望这个工具能与EmacsW32 + SUA组合使用。任何提示,经验,解决方案将不胜感激。
发布于 2010-05-21 01:31:18
我不知道w32-shell-*变量。也许你可以展示一些代码来说明你的意思。
我也不了解SUA。我在Windows上使用GNU emacs v22,我将powershell作为一个次要的shell运行。我最初遇到了一些困难,与您的类似,并通过更好地了解如何启动shell来解决这些问题。也许这会对你有帮助。
我使用以下变量:
(setq explicit-shell-file-name
"c:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe")
(setq explicit-powershell.exe-args
'("-Command" "-" )) ;; interactive, but no command prompt我有困难,直到我意识到两件事:
-i进程指定命令行参数,emacs将默认使用emacs。在powershell的情况下,这个论点要么不被支持,要么它做了我想要的以外的事情(我忘了)。所以我必须显式地设置参数来调用shell。explicit-sh-args。如果是bsh,则为explicit-bsh-args。如果您使用的是Windows,则需要使用正确的exe名称,包括.exe后缀。它看起来像是一个奇怪的变量名,但它是有效的。将powershell作为下级emacs shell启动的完整代码如下所示:
;; get a name for the buffer
(setq buffer (get-buffer-create "*PowerShell*"))
(let ((tmp-shellfile explicit-shell-file-name))
(setq explicit-shell-file-name
"c:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe")
(setq explicit-powershell.exe-args
'("-Command" "-" )) ; interactive, but no command prompt
;; launch the shell
(shell buffer)
; restore the original shell
(if tmp-shellfile
(setq explicit-shell-file-name tmp-shellfile)))也许这样的东西对你来说是可行的。
https://stackoverflow.com/questions/2873934
复制相似问题