Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset sequence for exceptions is written on next line #119

Closed
matkoch opened this issue Oct 20, 2021 · 2 comments · Fixed by #120
Closed

Reset sequence for exceptions is written on next line #119

matkoch opened this issue Oct 20, 2021 · 2 comments · Fixed by #120

Comments

@matkoch
Copy link
Contributor

matkoch commented Oct 20, 2021

Hopefully, this is not my own fault in some way, but it does appear that reset sequences for the exception message and following stacktraces are written on the next line, instead at the end of the current line. To illustrate the issue:

image

This also results in the situation that ::endgroup:: is not recognized by GitHubActions, since it's prefixed with the reset sequence.

My guess is that this here:

while ((nextLine = lines.ReadLine()) != null)
{
var style = nextLine.StartsWith(StackFrameLinePrefix) ? ConsoleThemeStyle.SecondaryText : ConsoleThemeStyle.Text;
var _ = 0;
using (_theme.Apply(output, style, ref _))
output.WriteLine(nextLine);
}

Should rather be:

while ((nextLine = lines.ReadLine()) != null)
{
    var style = nextLine.StartsWith(StackFrameLinePrefix) ? ConsoleThemeStyle.SecondaryText : ConsoleThemeStyle.Text;
    var _ = 0;
    using (_theme.Apply(output, style, ref _))
        output.Write(nextLine);
    output.WriteLine();
}

It doesn't break any tests. Let me know if you agree and want a PR.

@nblumhardt
Copy link
Member

Makes sense - thanks for tracking it down 👍

@matkoch
Copy link
Contributor Author

matkoch commented Oct 20, 2021

idk why I closed this :/

@matkoch matkoch reopened this Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants