deno_terminal: ansi color does not be handled correctly in file
Steps to reproduce:
deno install --log-level trace npm:zustand
Ansi color displays correctly in terminal.
But with this:
deno install --log-level trace npm:zustand &> log
Ansi color does not be handled correctly, I think it should be striped.
If I use npm cli, ansi color displays correctly in terminal, and it is striped in file.
@bartlomieju I would love to work on this. Any information on, were should I look would be nice.
@cu8code I'm not yet sure. @familyboat can you please provide more info what logs are being colored? Are these logs coming from npm:zustand package?
Yes, colored information is from deno cli, not from npm:zustand package. I created a repository, and you can check the instructions. If
I miss something, you can mention it. @bartlomieju @cu8code
A quick node to anyone working on this, nodejs handle this was by check if the current environment is a tty process.env.isTTY, then it disable the color.