设置shell为msys bash后,执行M-x shell 出现乱序尾字符

设置如下,

(setq explicit-shell-file-name "C:/msys32/usr/bin/bash.exe")
(setq explicit-bash.exe-args '("--noediting" "--login" "-i"))
(setq shell-file-name explicit-shell-file-name)

执行 M-x shell, 看到echo结束后,出现了一串乱序字符,请问如何解决,谢谢!

…用 ansi-term。

Windows 用 eshell。

shell 主要是用来让 Emacs 和命令行程序交互的,所以会显示返回值。

但是,windows下ansi-term好像用不了,会报错:

Spawning child process: Invalid argument

http://stackoverflow.com/questions/20263012/m-x-term-with-emacs-on-ms-windows-error-spawning-child-process-invalid-argum

eshell我试过一下,感觉比cygwin差远啦

我希望用 msys2 自带的bash.exe,可惜不够完美。

这些字符是哪里来的?会不会是你的 Prompt 导致的?(如果有可能的话,试试改下 Prompt 试试,如:PS1="$ ")总之这些字符肯定不是无缘无故来的,弄清楚它的来源后,相信就能解决。

我这边没有遇到你提到的问题。

1 个赞