我在这里看到了如何启动cygwin shell的答案。但是,cygwin shell输出混乱了。
(defun cygwin-shell ()
"Run cygwin bash in shell mode."
(interactive)
(let ((explicit-shell-file-name "C:/cygwin/bin/bash"))
(call-interactively 'shell)))
(setq explicit-bash-args '("--login" "-i"))
这是外壳的示例输出
]0;~
seth@seth ~
$ cd ~
]0;~
seth@seth ~
$ dir
]0;~
seth@seth ~
可以看到,输出被搞砸了。我该如何解决?
编辑:我只是注意到^ [] 0总是出现在每个命令的结尾\,否则输出文本可以正常工作。无论如何摆脱这个结局?
最佳答案
好吧,我知道了。在〜/ .bashrc中,我添加了
export PS1="\e[0;31m[\u@\h \W]\$ \e[m "
这会使单行显示红色提示(与原始cygwin提示中的黄色提示相比,这在眼睛上很容易!)
看到
http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/
另外,您必须确保不使用dos结尾。要将dos结尾转换为unix,请键入C-x RET f unix并保存或放置在.emacs文件中
(set-buffer-file-coding-system 'unix)