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 '19 at 10:00
  • I'm having this issue as well on a pretty fresh system. Ubuntu 18.04. I downloaded drush.phar for drush 8.3.2 and placed it in /usr/local/bin. $TERM is xterm-256color. composer has colored output. The Drupal site is 8.8.1, but I don't think it's relevant since I'm running a system level .phar. – adfaklsdjf Jan 8 at 22:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.