I have the following Drush command:

   * @command mycommand
  public function myCommand() {
    $this->io()->success('MY TEST');

If I type in CLI:

drush mycommand -> Formatted, but no colors

drush mycommand --ansi -> Formatted AND colors

Why does not colorize it in the first place? Running composer for example uses color without an issue.

My system

  • UBUNTU 16.0 server VM (through PUTTY terminal)
  • Drush 9.5.2
  • Drupal 8.6.2
  • PHP 7.2
  • Both Composer and Drush uses Symfony Console AFAIK. Since you get colors by default in Composer, I don't understand what is going on. Maybe better to post it as a bug report? – hansfn Dec 20 '18 at 9:05
  • Most probably yes, I thought it something common. Btw also my colleagues have the same issue. – ssibal Jan 2 at 10:00

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.