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

Broken colors in forked processes #316

Open
dkundel opened this issue Jul 14, 2021 · 2 comments
Open

Broken colors in forked processes #316

dkundel opened this issue Jul 14, 2021 · 2 comments

Comments

@dkundel
Copy link
Member

dkundel commented Jul 14, 2021

It seems like chalk turns supportsColors to false in forked processes for some reason. We can turn that back on by adding FORCE_COLORS as 1. There's an example in this issue for chalk chalk/chalk#381.

The only thing for us to consider is that we'll override that process.env after spawning the forked process with the actual environment.

@philnash
Copy link
Contributor

Alternatively, we could try passing the original stdin, stdout and stderr from the parent process. It looks like you can do that with the stdio option for fork.

    const forked = fork(RUNNER_PATH, { stdio: 'inherit' });

@philnash
Copy link
Contributor

Nope, that does not work. FORCE_COLORS seems to be the way.

@makserik makserik added this to the Improvements/Nice to haves milestone Mar 25, 2024
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

No branches or pull requests

3 participants