Add requirement for TERM not to be dumb to enable colorization#1287
Merged
Delgan merged 3 commits intoDelgan:masterfrom Feb 10, 2025
Merged
Add requirement for TERM not to be dumb to enable colorization#1287Delgan merged 3 commits intoDelgan:masterfrom
Delgan merged 3 commits intoDelgan:masterfrom
Conversation
This and the previous commit need to be squashed
Owner
|
Hey @snosov1, thanks for your contribution! 👍 I agree with you that it seems fair to disable colors in this case. This is also what is done by I'm merging the PR as-is but note that I'll probably move the check to the code block right above. This is because I think the special case for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/terminfoon 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
dumbterminal seems like a sensible thing to do (and it solves my problem in Emacs).Please, let me know what you think.