Skip to content

--no-color does not remove all color #5744

@quinncomendant

Description

@quinncomendant

Bug Report

When using --no-color, ANSI color codes are still printed for error messages.

As an example, here's the output from running wp plugin update --all with normal output (e.g., implied --color) that shows color for Warning: and Error::

Screenshot 2023-03-02 at 11 17 38

After adding the --no-color option, the color for Warning: is gone, but Error: is still colorized:

Screenshot 2023-03-02 at 11 17 48

Describe what you expect as the correct outcome

When using --no-color, wp-cli should never output ANSI color escape codes.

Let us know what environment you are running this on

OS:     Linux 5.14.0-162.12.1.el9_1.0.2.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jan 30 22:14:42 UTC 2023 x86_64
Shell:  /bin/bash
PHP binary:     /usr/bin/php
PHP version:    8.0.20
php.ini used:   /etc/php.ini
MySQL binary:   /usr/bin/mysql
MySQL version:  mysql  Ver 15.1 Distrib 10.5.16-MariaDB, for Linux (x86_64) using  EditLine wrapper
SQL modes:
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /home/mhs/www.milehighsports.com
WP-CLI packages dir:
WP-CLI cache dir:       /home/mhs/.wp-cli/cache
WP-CLI global config:   
WP-CLI project config:  
WP-CLI version: 2.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions