-
Notifications
You must be signed in to change notification settings - Fork 152
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
No color on node 12 server #220
Comments
@jorgebucaran Wonder if env.COLOR_TERM check needs to be added to colorette. any ideas what term alpine uses? |
I'm not familiar with |
Running |
@bohendo Could you share contents of your process.env when running under that environment? |
@bohendo Ping? We'd love to fix this issue, but we need to understand which particular env values we could use in your particular case, looks like the one we already use are not sufficient in your environment. |
(env vars prefixed with Btw, I'm using
|
Oh wow, I just noticed in the env: fwiw, the command being executed is:
|
@bohendo I don't think this is related to Node version, Node 14 should be fine. There doesn't seem to be anything in your env that would allow Colorette to understand that your terminal supports colours. See lines 3-18 in https://github.com/jorgebucaran/colorette/blob/main/index.js That said, I am very surprised that it used to work with Chalk in the past. See how they are doing their checks: https://github.com/chalk/supports-color/blob/main/index.js @jorgebucaran I think what is happening is this: previously |
I suggest opening an issue on Colorette so we can discuss your suggestion. |
You can use something like:
My full example: It sucks obviously |
I'm currently suffering from the same problem. I have
in my env. |
@mcollina Will be fixed in the nearby future upstream, we've already discussed path forward with @jorgebucaran in jorgebucaran/colorette#42 That's an interesting TERM, will check if we need to expand colorette condition list. |
@mcollina I've checked colorette code, and it actually should work out-of-the-box with such ENV, unless you have "env.NO_COLOR" update: actually, no, there are additional conditions. you also need to have "process.stdout.isTTY" |
Which part: |
You should use https://nodejs.org/dist/latest-v16.x/docs/api/tty.html#tty_tty_isatty_fd with |
This should be fixed in the latest version of colorette, let us know. |
I've upgraded & am now using pino@6.13.2 & pino-pretty@7.0.0 & sadly, I still see the same lack of color as before. Fwiw, I've updated my server's base image to node:14.17.6-alpine3.14 I've added |
cc @kibertoad |
I think the problem is on our end as we do not enforce the colorize option properly.. that should take over any checks for TTY. |
I know. I'm waiting for jorgebucaran/colorette#42 to land in 2.0.0 |
I've tested & confirmed that this issue is now 100% resolved as of version 7.0.1. Great job, thank you! |
Noticed after upgrading to pino-pretty 6.0.0 so some problem was probably introduced by colorette in PR #218
In my utils I have:
Then on my server I have:
Result is white text:
Downgrading to pino-pretty 5.1.3 results in colored output:
This server is based on the
node:12.16.1-alpine3.11
docker image so it shouldn't be affected by colorette's problems w node v13The text was updated successfully, but these errors were encountered: