How do I stop npm's colored output from looking ugly in Emacs term-mode?

Rangi Lin picture Rangi Lin · Dec 20, 2013 · Viewed 9.1k times · Source

When using npm in M-x term, it generate color message like this (even with -q) :

inverse color

Information from what-cursor-position

There are text properties here:
font-lock-face       (:foreground "red3" :background "black" :inverse-video nil)
fontified            t

It is ugly, and also hard to read in other themes, is it possible to change the color on the fly ? For example, change color of text that match npm http, npm ERR!

Thanks.

Answer

Aaron Miller picture Aaron Miller · Dec 20, 2013

You can disable colors in npm with the command:

npm config set color false

This doesn't exactly answer your question, in that it's not a way to override ANSI colors in term-mode, but it will solve your problem, in that the npm output will no longer be ugly and hard to read.