Add requirement for TERM not to be dumb to enable colorization #1287
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
This is a trivial change to disable coloring in case the terminal is dumb. Personally, I encountered the problem in Emacs terminal/compilation buffers - the coloring symbols are just printed as is (i.e. ASCII).
Technically, some more comprehensive logic can be implemented to derive color support from the TERM variable - but I'm not sure it's actually warranted.
toe /usr/share/terminfo
on my Ubuntu instance returns about 40 different terminal types - for some, it's clear whether the color is supported or not, for others - not that clear.Anyway, just opting out in case of
dumb
terminal seems like a sensible thing to do (and it solves my problem in Emacs).Please, let me know what you think.