I try to generate colored console output using ANSI escape codes with the following minimal C# program:
using System;
// test.cs
class foo {
static void Main(string[] args) {
Console.WriteLine("x1b[36mTESTx1b[0m");
}
}
I am running Ansicon v1.66 on Windows 7 x64 with csc.exe (Microsoft (R) Visual C# Compiler version 4.6.0081.0).
Colored output works fine in this configuration; Ansicon itself is working flawlessly.
To cross-check I use a node.js one-liner that is 100% equivalent to the C# program:
// test.js
console.log("x1b[36mTESTx1b[0m");
And, even more basic, a hand-crafted text file:
Both of which which correctly do the expected thing: Print a teal-colored string "TEST":
Only the test.exe I built with csc prints something else. Why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…