Skip to content

Stderr/Console.Error will hold back unicode escaped log messages #4144

Closed
@mxschmitt

Description

@mxschmitt

TL;DR: log messages which are unicode escaped and are logged to the stderr are not shown. If you use the stdout instead, it works as expected.

Repro:

namespace Example;

public class Tests
{
    [Test]
    public void Test1()
    {
        Console.Error.WriteLine("\u001B THIS WONT GET LOGGED!");
        Console.Error.WriteLine("\a THIS WONT GET LOGGED!");
        Console.WriteLine("\a THIS WILL GET LOGGED!");
        Console.Error.WriteLine("THIS WORKS");

        // original repro
        Console.Error.WriteLine("\u001b[38;5;45;1mpw:api \u001b[0mTHIS WONT GET LOGGED! \u001b[38;5;45m+23ms\u001b[0m");
        Assert.Pass();
    }
}

Expected: Two lines which get logged to the console.
Actual: Only the second line gets logged to the console.

Version: 3.13.3

Was reproducible with dotnet new nunit -n Example.

Looks related to this: #1787

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions