diff --git a/src/MSBuild/LiveLogger/LiveLogger.cs b/src/MSBuild/LiveLogger/LiveLogger.cs index f739081849e..7772b29a753 100644 --- a/src/MSBuild/LiveLogger/LiveLogger.cs +++ b/src/MSBuild/LiveLogger/LiveLogger.cs @@ -377,8 +377,15 @@ private void ProjectFinished(object sender, ProjectFinishedEventArgs e) // Ignore any GetDirectoryName exceptions. } + // Generates file:// schema url string which is better handled by various Terminal clients than raw folder name. + string urlString = url.ToString(); + if (Uri.TryCreate(urlString, UriKind.Absolute, out Uri? uri)) + { + urlString = uri.AbsoluteUri; + } + Terminal.WriteLine(ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("ProjectFinished_OutputPath", - $"{AnsiCodes.LinkPrefix}{url.ToString()}{AnsiCodes.LinkInfix}{outputPath}{AnsiCodes.LinkSuffix}")); + $"{AnsiCodes.LinkPrefix}{urlString}{AnsiCodes.LinkInfix}{outputPath}{AnsiCodes.LinkSuffix}")); } else {