I have set up two drupal virtualhosts in a VPS server under two different users. I had installed these at two different times so am not too sure about the specific install steps for Drush that I used. However what I see is that inside one of the drupal folders, drush commands come out with color output while the other comes without color.

That looked like a config file issue. I then tried to see how I was setting $PATH for the two.

In the one where Drush colors were coming up fine, the local vendor folder inside the drupal folder was included (actually the one outside - I am using the drupal scaffolding with composer based installs) in $PATH.

In the one where Drush colors were not coming up, the global vendor folder in the users home was included in the path.

export PATH="$HOME/.config/composer/vendor/bin:$PATH"

In the one where Drush colors were coming up, the vendor folder in the Drupal folder was included in the path.

export PATH="$HOME/www/domain/vendor/bin:$PATH"

drush status showed that drush command was being run from the vendor folder in the drupal installation in both cases.

I have seen this in the past but thought I should get to the bottom of this, this time.

Thanks in advance for your help.

| improve this question | | | | |
  • 1
    What does drush --version return you in each environment? – leymannx Nov 9 '19 at 6:41
  • 2
    Yes, the no color drush is probably an older version. Installing drush in a global vendor dir is no longer supported anyway, so I would remove this drush install. – 4k4 Nov 9 '19 at 10:43
  • Thanks for looking into this. Both drush versions are 9.7.1. Also I see that the one where the colors are not working drush config loads an extra file /home/user/.drush/drush.yml in addition to the home/user/www/domain/vendor/drush/drush/drush.yml and home/user/vendor/drush/drush.yml files – anoopjohn Nov 9 '19 at 23:56
  • Ok. I removed the global drush install in the user that had the problem by editing the composer.json inside .config/composer and running composer update. I then updated .bashrc to only have the vendor bin folder inside the drupal root folder. Even then colors seem to not appear. I saw that ~/.drush had more config files for that user and that the one where colors were working ~/.drush had only a cache folder. So I deleted ~/.drush. Even then colors are not coming for drush output for that user. – anoopjohn Nov 11 '19 at 17:27
  • I did the following diff /working-path/vendor/drush/drush/drush.yml /not-working-ath/vendor/drush/drush/drush.yml diff /working-path/drush/drush.yml /not-working-path/drush/drush.yml diff /working-path/vendor/drush/drush/drush /not-working-path/vendor/drush/drush/drush - All files came out without any difference. So it is some other setting that is loaded that is causing the issue. Not from the yml files shown in drush status. – anoopjohn Nov 14 '19 at 2:37

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.