Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FORCE_COLOR=1 to default environment variables #63

Merged
merged 2 commits into from
Jul 29, 2020
Merged

Add FORCE_COLOR=1 to default environment variables #63

merged 2 commits into from
Jul 29, 2020

Conversation

Alhadis
Copy link
Collaborator

@Alhadis Alhadis commented Dec 2, 2018

To cut a long story short, Mocha's coloured output is causing Emacs users grief because Emac's default compile command chokes on ANSI escape sequences when emitted from make -k feedback. @plroebuck identified the crux of the problem in chalk/supports-color handling of TERM=dumb environments.

I submitted a pull-request which fixes this, and simultaneously fixes compiler-mode's problems whilst affecting the coloured output of mocha.el:

Mocha.el: Before Mocha.el: After

Basically, the fix is to add FORCE_COLOR=1 in the environment, which is picked up by the supports-color module as a user's wish to go and use coloured output anyway, irrespective o f the TERM=dumb variable being set in both compiler-modes.

We can merge this now, it won't get noticed because the package's highlighting is currently working fine. But users will notice once chalk/supports-color#89 gets merged and shipped in a new release; having this the default for mocha-environment-variables ensures there's absolutely no friction when it does. =)

Alhadis added a commit to Alhadis/language-emacs-lisp that referenced this pull request Dec 2, 2018
We already had about 10, this commit finishes the job by adding the rest
which were noticed while examining `mocha.el`'s codebase.

References: scottaj/mocha.el#63
@plroebuck
Copy link

The "supports-color" PR for TERM=dumb does the same thing as FORCE_COLOR="0" would.
Wouldn't this technically be undoing the effect of chalk/supports-color#89 (when implemented)?

@Alhadis
Copy link
Collaborator Author

Alhadis commented Dec 2, 2018

Nope. :=) Like I said in another thread, @scottaj gets it right because the escapes are going where they have to. But the command that was screwing it up was launching an extra shell per process, which means the ANSI escapes were interpreted literally by their dumb terminals before being piped through to the top-level process layer or something....

@Alhadis
Copy link
Collaborator Author

Alhadis commented Dec 2, 2018

So we're not undoing anything because we're giving his application a chance to force colours even if the TERM=dumb was already being set in his environment each time.

@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 22, 2019

Nudging @scottaj for review.

@Alhadis
Copy link
Collaborator Author

Alhadis commented Jul 22, 2020

@scottaj Err... little help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants