Closed
Description
Bug Report or Feature Request
- [x] bug report
Command (mark with an x
)
- [x] serve
Versions
$ node --version
v8.11.3
$ ng --version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 6.1.2
Node: 8.11.3
OS: win32 x64
Angular: 6.1.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.7.2
@angular-devkit/build-angular 0.7.2
@angular-devkit/build-optimizer 0.7.2
@angular-devkit/build-webpack 0.7.2
@angular-devkit/core 0.7.2
@angular-devkit/schematics 0.7.2
@angular/cli 6.1.2
@ngtools/webpack 6.1.2
@schematics/angular 0.7.2
@schematics/update 0.7.2
rxjs 6.2.2
typescript 2.7.2
webpack 4.9.2
$ git --version
git version 2.14.2.windows.2
I use the mingw terminal.
Repro steps
Run ng serve
Expected: webpack output uses colors as in @angular/[email protected]
Actual: webpack output does not use color
Mention any other details that might be useful
The color detection logic in
angular-cli/packages/angular_devkit/core/src/terminal/caps.ts
Lines 79 to 144 in 44086c6
does not recognize the terminal as color capable, because the following if matches:
if (stream && !stream.isTTY) {
return 0;
}
(stream
is a Socket, no clue why)
However, git-bash does set a couple environment variables that may be helpful in detecting it, including:
MSYSTEM: 'MINGW64',
TERM: 'xterm',
I'll submit a PR shortly.