Is there a way to permanently turn off ANSI for Co

2019-07-22 03:28发布

When I run Composer in my shell, it renders all of the text with a background color of dark yellow, so that it is almost impossible to read.

There's an option to supply the --no-ansi argument with every command I run, but this really seems like a pain. Is there a way to turn it off of the default? Or even change the color to something more readable?

2条回答
做自己的国王
2楼-- · 2019-07-22 04:09

Just to give a real answer to this question, because I still have the requirement to call composer with --no-ansi (on a Windows server), because of such output in Putty via SSH:

Wrong ANSI output in Putty on Windows servers

You can edit the batch file of composer:

C:\ProgramData\ComposerSetup\bin\composer.bat
(edit its content)
php "%~dp0composer.phar" %* --no-ansi

Source: https://github.com/symfony/symfony/issues/19520#issuecomment-242627544

查看更多
够拽才男人
3楼-- · 2019-07-22 04:15

So it turns out that it was because I was using an "old" version of Composer. When I tried to run an install, I was getting the

Warning: This development build of composer is over 30 days old. It is
recommended to update it by running "/usr/local/bin/composer self-update"
to get the latest version.

I ran self-update, and it saw that there hadn't even been a new version in the last 30 days, but it is now rendering in a readable color scheme.

查看更多
登录 后发表回答