-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
(cli): enforce colored output #12270
Comments
Hey @metametadata 👋🏻 Thanks for suggesting this. I'm going to leave this issue as p2 which means that we are unable to work on this immediately. However we use +1s to help us prioritize our work, and as always we are happy to take contributions. If anyone is interested in lending a hand this is a great first issue to tackle. A good place to start is by following the steps described in our contribution guidelines. |
i went and search the codes and found reference of FORCE_COLOR in environment variable. it seem if you set this environment variable to "1" it will force ANSI out p.s. CodeBuild still strip it off |
It's can be irrelevant, but I found the following Node.js documentation about the environment variable FORCE_COLOR: https://nodejs.org/docs/latest-v18.x/api/tty.html#writestreamgetcolordepthenv
|
This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue. |
BackgroundThe shutoff of coloring for non-tty output happens in cli.ts by setting environment variable In CDK, setting
produces color output. A quick test of non-tty output in zsh shows similar behavior there:
produces monochrome output, but
produces color output Chalk recognizes 3 levels of color output and forces color support to truecolor (level 3) if environment variable ProposalAdd an optional Proposed description for
This will also require updates to the CDK Developer Guide. I’m not clear on the process for updating those docs. |
Introduce an arg for
cdk
CLI app to enforce colored output. There's no such feature yet, the user either can always disable colors (--no-color
) or let the app detect the TTY and use colors depending on that (default).Use Case
I call
cdk
programmatically from Clojure (using built-in JavaProcessBuilder
) and want to get the colored output to sometimes print it myself.The workarounds currently are to use pty4j or wrap calls with script so that
cdk
thinks it prints into TTY.Proposed Solution
It can be a new arg, e.g.
--always-color
.Or something like
--color=[auto, always, never]
similarly togit
CLI. But this may require deprecating--no-color
.This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: