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

Feature request: Add or document API option to disable color output #466

Open
DavidBiesack opened this issue Feb 15, 2024 · 0 comments
Open

Comments

@DavidBiesack
Copy link

The CLI contains a --no-color option, but the API options do not describe how to suppress color output (for example, if not connected to a tty). I don't want to pass colors: [ 'black' ], as that may not work if the user's terminal/console has a black/dark background. Consider a noColor: true option.

concurrently --no-color "echo 1" "echo 2" "echo 3"

There is a source code comment

        // This one is provided for free. Chalk reads this itself and removes colors.
        // https://www.npmjs.com/package/chalk#chalksupportscolor
        'no-color': {
            describe: 'Disables colors from logging',
            type: 'boolean',
        },

but that is cryptic at best; I don't know if that means I can use 'no-color' as an option in the prefixColors array

options.prefixColors = ['no-color'];

or something else (i.e. just omit prefixColors). If that is the intent, and there is no default prefixColors when
using the API, please update the README to reflect this.

The Chalk doc implies one can use an environment variable FORCE_COLOR=0 (see https://www.npmjs.com/package/chalk#supportscolor -- the source comment link cited above may be wrong) to disable colors, but that may not work if concurrently passes a default set of colors.

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

1 participant