Colored console output in Unit Test Runner

i.e. I have a test:

[Test]
public void DoSomeOutput() {
     Console.ForegroundColor = ConsoleColor.Red;
     Console.Write("Some Red Message");
}

When I run it - I can see output in test runner but it is not colored.
Should I submit feature request for that or there is another way of making this work?

4
11 comments

Hello Sergei,

please submit feature request in our issue tracker: http://youtrack.jetbrains.net/

You were seconds faster than me. Thanks for submitting an issue.

Right now there is no workarounds to get coloring in output.

0

Submitted for TeamCity as well

0

This is sooo long ago but has this been added yet?

0
Avatar
Permanently deleted user

Hello,

This is sooo long ago but has this been added yet?


I'm not sure it would be. We're captuing the stdout stream out of the test
runner process to display in the output panel, and this stream has no color
information in it. Probably means implementing a console emulator? I don't
know of Windows apps that would do it, even PowerShell won't show colored
output.


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0

PowerShell let's you set the colour of the text using the -foregroundcolor parameter when calling Write-Host.

0
Avatar
Permanently deleted user

Hello,

PowerShell let's you set the colour of the text using the
-foregroundcolor parameter when calling Write-Host.


This isn't directly related to the matter. Test runner's own output is colored
just good, and so are stack traces in exceptions.

A closer example would be running MSBuild inside Power Shell ISE. All of
its coloring is lost.
Probably it's theoretically possible, but I haven't really seen this done.


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0

The output window also contains stack trace information if an error occurred, and this is rich-formatted, complete with links back into the code.  This needs to happen.

1

Gobsmacked that colour writing to the console isn't supported.

I write in colour in PowerShell and can even force GitLab CI system to use colour by injecting ascii codes. I thought in C# its going to be a doddle. Wrong.

0

Any news on this issue? I can see that it was implemented in Rider two years ago (https://youtrack.jetbrains.com/issue/RIDER-28867) but not much has happened here.

0

Hi silkfire

Unfortunately, this feature request has not been scheduled for any release yet. Please upvote the request to bring some more attention to it. 

0

Please sign in to leave a comment.