emacs strips away all ansi color codes in shells

久未见 提交于 2019-12-12 08:20:24

问题


I'm using emacs 24 on OS X and have the strange problem that I'm unable to see any color codes. Emacs seems to just ignore them. My motivation is to see colored output from cmake, llvm and the googletest framework for a C++ project. I'd like to see the colors in compile mode, however it would probably suffice to fix the display for comint or shell modes.

My problem differs from many others in the fact that I can neither see the raw ansi color sequences nor the colors they should produce. It seems that the codes are just stripped away from the output, but I can't find out where.

I tried out the obvious things like

  • requiring 'ansi-color
  • turning ansi-color-for-comint-mode on
  • unsuccessfully trying to produce any ansi-colored output in either shell, eshell, multi-term, ansi-term
  • setting my TERM to various settings, including xterm, xterm-color, xterm-256color

all to no avail.

Edit:

My emacs configuration is divided into my personal settings and a fork of emacs prelude in which I modified some minor settings, mainly adding packages


回答1:


So it turned out that the problem was caused by zenburn-theme 1.2. There was a bug there with the ansi-color-names-vector that's fixed in version 1.3 (released just now). If you're experiencing a similar problem make sure you upgrade your version of zenburn.




回答2:


I can definitely say it's working fine for me with just (ansi-color-for-comint-mode-on). FWIW you can browse my emacs config, but it's fairly big :)

https://github.com/aufflick/emacs.d



来源:https://stackoverflow.com/questions/9245486/emacs-strips-away-all-ansi-color-codes-in-shells

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!