Running composer --version on a Windows maschine, I get the following:
C:\>composer --version
鈫怺32mComposer鈫怺39m version 鈫怺33m1.1.0鈫怺39m 2016-05-10 15:21:19
This is just happening since the update to (I guess) 1.1.0.
Looks more like an issue with your terminal not interpreting escape sequences properly.
Please see if a --rollback resolves it.
The thing is that npm works fine (I think it uses the same technique to provide colors?).
Rolled back to version 1.0-dev (7c62e2b5346a6a656dd9587203719e35bb768056) 2016-03-16 08:47:37 - at least the escape sequences for shells are not present anymore.
Using self-update (version 1.2-dev (74e8f4479917608d573e54e1b9b4a1e52e724110) 2016-05-13 07:15:42) is causing those issues again.
It's working fine here

Very strange.
But I see, no big changes in the Output Class here, maybe I should open an issue in the symphony/console repo.
I just encountered the same problem on my Windows 10 Insider Preview 2016/05/06
I don't have other (regular w10) build around to test it against, but everything is ok in win7
Which build of Win10 are you guys using?
OK, seems like a problem with Windows 10 cmd.exe in preview builds. Also, it seems as something to be handled in symfony/console, as reported here -> https://github.com/symfony/symfony/issues/17499
No preview build here, I am using Windows 10 Pro 1511 Build 10586.318 here.
Issue is not presens in an early 1.1.0 build of composer, but 1.2dev definitly has those issues.
This really needs to be dealt with in symfony/console as we are merely consuming it. I'll keep this open for now as a reminder but please discuss details over there as much as possible.
It's not just Windows; I noticed this a few days back on Ubuntu. At first, it seemed to be only when in tmux, which reports as TERM=screen and/or TERM=screen-256color; however, on investigating it later today, I noticed it fails to render colors under TERM=xterm-256color (default under gnome-terminal) or TERM=xterm (the most common across terminal types in linux).
@twaileit In Windows you should right click on console window title and in options uncheck "Use legacy console (requires relaunch)". After console relaunch, everything is working fine with the newest composer version (1.1.1).
@kurkowskik I was already using it, since the non-legacy version was broken in PHPStorm the days I switched to Windows 10.
Edit: I switched to non-legacy for testing reasons and get a full colored output now... weird:

Output with legacy console on 1.1.1:

@twaileit note that @kurkowskik wrote "uncheck", so specifically suggesting not to use it. :-)
@alcohol guess I ignored the "un"check. shame on me :(
I'm using Git Bash on Win10 - output is borked here too.

Legacy mode is unchecked here.
Same with mine Git Bash on Win 10 as @mindplay-dk

Same issue as @Mariyo and @mindplay-dk . Windows 10 Pro x64

Use powershell, as there it is still OK (even on Win 10 build 14393)
@bckp Same advice as "Use Linux or Mac"...
Actually problem fixed with upgraded Git to 2.9+
I have Window 10 1551 (10586.494) and I use the native command line but I have ANSICON installed. Colors work well. But probably because of that ANSICON :)
Same issue. Not sure why they made this decision. Works in powershell bot not in native cmd.
I updated GIT to version 2.9.2 today and the problem is still their. @Mariyo did you just installed a new GIT version ? Did you change other configuration parameters ?
@bgaillard he explicitly says he makes use of https://github.com/adoxa/ansicon
@alcohol ah ok did not saw this comment at first. Their are 2 different Mario* in the conversation :-), as you said @maryo uses ANSICON so it should explain why it works in his case. But the advice of @Mariyo (simply updgrading GIT) does now work (at least on my Windows 10 Pro 64 machine). Thanks
@bgaillard oh drats, I totally overlooked that. My mistake :>
@Mariyo it is not advice, it is working workaround.
@bgaillard I unistalled old version and installed new GIT 2.9.2 My previous version was 1.9 I think (for sure less than v2)
With Windows 10 Anniversary Update (1607, Build 14393.51), output in CMD is completely broken (Screenshot shows Output in non-legacy mode, while legacy has same output like months before).
Composer version is 1.2.0
Using Ubuntu Bash (Beta) or Powershell "fixes" it.
@twaileit Same here, not only composer it seems all the other outputs that uses ANSI are broken as well.
Yeap! I concur, looks like last Windows 10 updates broke the ANSI output in CMD. Perfect timing to switch to powershell, farewell cmd.exe! (but it's still an annoying bug)
I hope you reported this to Microsoft as well and not just here because it
sure sounds like a bug over there.
See symfony/symfony#19520
If this hasn't been mentioned before, the global workaround for Windows is:
C:\ProgramData\ComposerSetup\bin\composer.bat
(edit its content)
php "%~dp0composer.phar" %* --no-ansi
Adding the "--no-ansi" flag at the launch script of composer eliminates the need to flag it for every command.
@cirdog hi, do you have a fix for laravel? it's not working for laravel artisan..
@lino10 : you can also add --no-ansi to artisan commands ;
php artisan --no-ansi
@shockgonewild Sorry, I meant the fix without inputting '--no-ansi' in every command.. Editing the composer.bat above is not working
@lino10 you can either make a cmd file containing:
@php artisan --no-ansi %*
and save it in your php directory as artisan.cmd
note that you'll have to emit php from your commands, i.e.: artisan serve
or if you DO want colors you can also just install ANSICON (using ansicon.exe -i)
@piksel Sorry for the late reply. Thanks, it's working 馃憤
Thanks @piksel, ansicon.exe -i solved the issue.
Also note that ConEmu enables colors by default but only inside ConEmu application, not inside the "native" cmd.exe.
I find this a weird issue, this is in git bash, it can show colors, and then again it can't

the case where you have an issue is not in composer, so it is the wrong place to report it. Report it to the artisan mantainers
I did some digging - apparently Microsoft decided to disable ANSI support by default, it was previously enabled by default, but that changed with a Win 10 update at some point. Applications need to explicitly enable ANSI support, and it looks like current Windows builds of PHP don't do that yet.
Downgrading Git from 2.11 to 2.10 solved my problem https://github.com/git-for-windows/git/releases/tag/v2.10.0.windows.1
Some Problem here.
Console colors seem to be an issue of newer Windows 10...
http://stackoverflow.com/q/44047988/985454

Composer does not output ANSI colors on Windows 10 anymore automatically, as it updated its symfony/console dependency to a version where the rules were updated to account for the changes in Windows 10 compared to the first insider preview versions.
But you have to make sure that your composer version is uptodate.
If you want to have colors on windows when using Composer, you will still need to use Ansicon or ConEmu for now, (which worked since years), until the day where PHP adds support for the Windows API enabling native support of colors (and composer is updated to use this new API).
Find your composer.bat file. Mine is at this location
C:\ProgramData\ComposerSetup\bin\
add --no-ansi to the launching command
@ECHO OFF php "%~dp0composer.phar " %* --no-ansi
-or-
switch to cygwin
Thanks a lot, i added in composer.bat next code:
php "%~dp0composer.phar" %* --no-ansi
and it's working for
composer -v
in console.
But for
laravel -v
in console
is the same problem.
How to fix the problem?
Most helpful comment
If this hasn't been mentioned before, the global workaround for Windows is:
Adding the "--no-ansi" flag at the launch script of composer eliminates the need to flag it for every command.