-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[FancyLogger] Show link to project outputs #8324
Conversation
This is really slick, but I think it hurts a critical use case: getting a path to an output so I can run it. I often do
I find this easier than Fortunately I think there's an easy fix: don't truncate the path, but still hyperlink it. Then I can copy/paste but also see it in Explorer. |
Alright. Do you think we should clip them if they're too long? |
I'm torn on this but lean toward "no, output the whole path". Would happily receive feedback! |
@@ -10,10 +10,45 @@ namespace Microsoft.Build.Logging.FancyLogger | |||
{ | |||
internal static class ANSIBuilder | |||
{ | |||
public static string ANSIRegex = @"\x1b(?:[@-Z\-_]|\[[0-?]*[ -\/]*[@-~])"; | |||
public static string ANSIRegex = @"\x1b(?:[@-Z\-_]|\[[0-?]*[ -\/]*[@-~]|(?:\]8;;.*?\x1b\\))"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For follow-up PR: this should be a static Regex
constructed with RegexOptions.Compiled
, which should dramatically reduce overhead of scanning using it. On .NET 7, we should use a [GeneratedRegex]
.
Co-authored-by: Rainer Sigwald <raines@microsoft.com>
@edvilme can you please merge |
Conflicts: src/MSBuild/LiveLogger/LiveLogger.cs src/MSBuild/LiveLogger/TerminalBuffer.cs
Conflicts: src/MSBuild/LiveLogger/ANSIBuilder.cs src/MSBuild/LiveLogger/LiveLogger.cs src/MSBuild/LiveLogger/MessageNode.cs src/MSBuild/LiveLogger/ProjectNode.cs
I merged #8314 into this speculatively and it's looking good but blocked on that, so drafted for now. |
Undrafted since #8314 went in. Still LGTM to me, so marking merge-when. |
Fixes #
Context
One of the key features of the old console logger is showing the path to the output file for each project using the format
Project -> path/to/output
.To save space, FancyLogger only shows the filename of the output in a clickable link that redirects to the output file following the same format.
Changes Made
ANSIBuilder.Formatting.Hyperlink
to support clickable hyperlinksTesting
Notes