msbuild
msbuild copied to clipboard
Detect and link URLs in Terminal Logger Output
I was trying out a native AOT console app and got the following error.
Clicking https://aka.ms/native takes me to a web site that has nothing to do with .NET AOT publishing.
I think the URL has a space between native and aot-prerequisites, using https://aka.ms/nativeaot-prerequisites works.
Further technical details
.NET SDK Version: 8.0.400-preview.0.24324.5
Is this on Windows Terminal? Which version?
The screen shot looks like the URL was broken because of the window width. I'm not sure whether the line break was added by MSBuild or by the terminal. If by MSBuild, then this could perhaps be fixed by making MSBuild recognise URLs in error messages and output OSC sequences to tell the terminal that the URL continues across the line break. But if the line was broken by the terminal, then the terminal should already understand this.
Yeah its Windows Terminal.
Ok I ran the command with the terminal maximized and the URL don't have a space and it works fine. Not sure if it was MSBuild or the terminal that added the line break.
MSBuild doesn't create terminal links for Uris in messages, that's going to be down to the heuristics in Windows Terminal. I'd suggest raising an issue there.
At the same time, I think it would be a reasonable suggestion for the TerminalLogger in MSBuild to detect Uris and generate these links taking word wrapping into account, so I'd also love to see a feature request issue there.