deno icon indicating copy to clipboard operation
deno copied to clipboard

deno_terminal: ansi color does not be handled correctly in file

Open familyboat opened this issue 1 year ago • 3 comments

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.

familyboat avatar Nov 02 '24 09:11 familyboat

@bartlomieju I would love to work on this. Any information on, were should I look would be nice.

0hmX avatar Nov 04 '24 07:11 0hmX

@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?

bartlomieju avatar Nov 04 '24 10:11 bartlomieju

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

familyboat avatar Nov 04 '24 14:11 familyboat

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.

0hmX avatar Nov 06 '24 07:11 0hmX