summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--src/support/colors.cpp5
2 files changed, 4 insertions, 5 deletions
diff --git a/README.md b/README.md
index 7d168a1ed..5f7fa745c 100644
--- a/README.md
+++ b/README.md
@@ -131,9 +131,9 @@ You should see something like this:
![example output](https://raw.github.com/WebAssembly/wasm-emscripten/master/media/example.png)
-On Linux and Mac you should see pretty colors as in that image. Set `COLORS=0` in the env to disable colors if you prefer that. Set `COLORS=1` in the env to force colors (useful when piping to `more`, for example).
+By default you should see pretty colors as in that image. Set `COLORS=0` in the env to disable colors if you prefer that. On Linux and Mac, you can set `COLORS=1` in the env to force colors (useful when piping to `more`, for example). For Windows, pretty colors are only available when `stdout/stderr` are not redirected/piped.
-Pass `--debug` on the command line to see debug info, about asm.js functions as they are parsed, etc. `--debug=2` will show even more info.
+Pass `--debug` on the command line to see debug info, about asm.js functions as they are parsed, etc.
### C/C++ Source ⇒ asm2wasm ⇒ WebAssembly
diff --git a/src/support/colors.cpp b/src/support/colors.cpp
index 9a3b04f70..7d78306e0 100644
--- a/src/support/colors.cpp
+++ b/src/support/colors.cpp
@@ -43,9 +43,8 @@ void Colors::outputColorCode(std::ostream& stream, const char* colorCode) {
void Colors::outputColorCode(std::ostream&stream, const WORD &colorCode) {
const static bool has_color = []() {
- return (getenv("COLORS") && getenv("COLORS")[0] == '1') || // forced
- (_isatty(_fileno(stdout)) &&
- (!getenv("COLORS") || getenv("COLORS")[0] != '0')); // implicit
+ return _isatty(_fileno(stdout)) &&
+ (!getenv("COLORS") || getenv("COLORS")[0] != '0'); // implicit
}();
static HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
static HANDLE hStderr = GetStdHandle(STD_ERROR_HANDLE);