为什么shell模式显示一些垃圾代码? [英] Why does shell mode display some rubbish code?
问题描述
如图所示,当我在 Mx shell
中使用 bower
时,会显示一些垃圾代码
When I use bower
in M-x shell
, as you can see in the picture, some rubbish code is displayed.
但是 MX ansi-term
效果很好
可能是什么问题?可以使shell模式正确显示吗?
What could be the problem ? Is it possible to make shell mode display properly ?
推荐答案
请尝试使用黄瓜的ANSI颜色弄乱了emacs编译缓冲区:
(require 'ansi-color)
(defun colorize-compilation-buffer ()
(toggle-read-only)
(ansi-color-apply-on-region (point-min) (point-max))
(toggle-read-only))
(add-hook 'compilation-filter-hook 'colorize-compilation-buffer)
在emacs24上对我来说很漂亮。
that works beautifuly for me on emacs24.
ps:进一步着色我喜欢玩的shell输出
ps: to colorize even more the shell output I like to play with
M-x highlight-regexp RET a regexp, i.e. \[OK\] RET a color (make use of TAB to see choices)
或
(add-hook 'shell-mode-hook (lambda () (highlight-regexp "\\[OK\\]" "hi-green-b")))
和( add-hook'shell-mode-hook(lambda()(goto-address-mode)))
使URL易于理解。在文件路径中寻找相同的东西。
and (add-hook 'shell-mode-hook (lambda () (goto-address-mode )))
to make URLs clikable. Looking for the same stuff for file paths.
编辑:使文件路径可点击就像使用 compilation-shell-minor-mode一样简单
:)
edit: making file paths clickable is as easy as using compilation-shell-minor-mode
:)
edit2:我的来源: http://wikemacs.org/index.php/Shell
edit2: my sources: http://wikemacs.org/index.php/Shell
这篇关于为什么shell模式显示一些垃圾代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!