1

当我使用bowerin 时M-x shell,如图所示,会显示一些垃圾代码。

Emacs 外壳模式

不过M-x ansi-term效果很好

反项

可能是什么问题呢 ?是否可以正确显示 shell 模式?

4

3 回答 3

2

尝试Cucumber's ANSI colours messing up emacs compilation buffer中给出的解决方案:

 (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 上对我很有效。


ps:为我喜欢玩的shell输出着色更多

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 可点击。为文件路径寻找相同的东西。

编辑:使文件路径可点击就像使用一样简单compilation-shell-minor-mode:)

edit2:我的来源:http ://wikemacs.org/index.php/Shell

于 2013-12-18T16:25:23.573 回答
2

这些符号是终端仿真器用于更改文本颜色等视觉效果的 ANSI 转义序列。shell-mode 显然不知道如何默认显示这些代码。你想要的可能是Term Mode

有些程序(比如 Emacs 本身)需要对终端屏幕的外观进行详细控制。他们通过发出特殊的控制代码来做到这一点。术语模式识别和处理 ANSI 标准 VT100 样式的转义序列,大多数现代终端都接受这些转义序列,包括 xterm。(因此,您实际上可以在 Emacs Term 窗口中运行 Emacs。)

于 2013-12-18T16:20:13.637 回答
0

WRT 到 bash,有时设置 $PAGER 在这里有帮助,即

寻呼机=猫

于 2013-12-18T19:31:56.780 回答