Closed foobit closed 3 years ago
I've read somewhere before that ANSI codes have limited support on macOS but can't verify for sure. As I'm not a daily user of Mac myself it's hard for me to test this out. Feel free to post a PR if you come up with a fix or if you find out more information on the state of ANSI color codes in the Mac ecosystem that could be of use in developing a solution.
I'm still investigating. Note: Pastel color output works properly when running inside Visual Studio Code Terminal window.
As you said the macOS terminal is not interpreting it correctly. I'm going to look in to the Console.ForegroundColor
source and see if there is something similar to Windows where we need to set a specific console mode.
Can confirm this, it doesn't work with Terminal.
Ok, I found the issue.
The macOS terminal does not support the SGR 38
and 48
color parameters modes (24 bit color). However, the SGR 3/4/8 bit color modes formats do work. Wikipedia: ANSI escape codes
For me a proper fix would be:
_planeFormatModifiers
and _formatStringColor
to dynamically support all 4/8/24 bit formats.Unfortunately, that doesn't sound like a simple pull request. However, at least it would be testable on non macOS terminals.
Interesting finds there! I'll glady review any PRs to determine if this could be seamlessly merged into the library.
Closing due to inactivity.
Uhm, I still wait for a fix. What activity do you want? Nothing changed.
I understand but as no one has contributed with a pull request in support of a solution I'd keep things tidy to not have a bunch of stale issues lying around. If things change I'd gladly reopen the issue or post a new one.
In the example below, the first WriteLine does not output red in the macOS Terminal (Catalina). However, the second WriteLine does output in red.
Notes
NO_COLOR
is not definedI also tested the above example in Windows 10 and Ubuntu 18.04 which behaves as expected.