question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No Pastel color output in macOS Terminal

See original GitHub issue

In the example below, the first WriteLine does not output red in the macOS Terminal (Catalina). However, the second WriteLine does output in red.

using System;
using System.Drawing;
using Pastel;

namespace TestColorOutput
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!".Pastel(Color.Red));
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Hello World!");
        }
    }
}

Notes

  • NO_COLOR is not defined
  • Terminal preferences: Display ANSI colors is enabled.
  • Terminal preferences: Declare Terminal as xterm-256-color. I’ve tried other terms with no success.

I also tested the above example in Windows 10 and Ubuntu 18.04 which behaves as expected.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
silkfirecommented, Feb 26, 2021

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.

0reactions
silkfirecommented, Jun 15, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Terminal showing single color for all text
Terminal colours can be controlled by the themes (in the Preferences > Settings tab). Select new theme to confirm the other one is...
Read more >
How to enable colorized output for ls command in MacOS
Explains how to configure and enable Apple MacOS X (macOS) Terminal to have colorful ls command colorized output for bash shell permanently.
Read more >
Add Color to the Terminal in Mac OS X
How to Add Color 'ls' Command Output in Mac OS X Terminal · Open Terminal and type: · Use the arrow keys to...
Read more >
Customizing iTerm. Creating a display profile with Pastel ...
You can easily customize the color scheme from iTerm's preference. ... Defining the colors does not automatically colorize all output though ...
Read more >
How to get colored output in Mac terminal? - ssh
I recently tried to connect to a server via SSH using the Mac Terminal and ran the HTOP command, but the output was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found