Have anyone added support for ansi-color in compilation-mode Emacs? If so what property/attribute does the color-writing program have to check for in order to make sure its active terminal supports ANSI-escape coloring.
Have anyone added support for ansi-color in compilation-mode Emacs? If so what property/attribute does
Share
There’s already a function for applying color to comint buffers. You simply need to enable it on compilation buffers:
Color writing programs should check the
TERMenvironment variable and the terminfo database to check if the terminal supports color. In practice, a lot of programs ignore this and rely on a user setting. Emacs will set the compilation terminal type todumbby default but this can be overriden by setting thecompilation-environmentvariable.Update: Note that in Emacs 24.5 the two calls to
(toggle-read-only)in the code above are not needed.