msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

Detect and link URLs in Terminal Logger Output

Open Vake93 opened this issue 1 year ago • 4 comments

I was trying out a native AOT console app and got the following error. image

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

Vake93 avatar Aug 01 '24 07:08 Vake93

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.

KalleOlaviNiemitalo avatar Aug 01 '24 08:08 KalleOlaviNiemitalo

Yeah its Windows Terminal. image

Vake93 avatar Aug 01 '24 08:08 Vake93

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.

Vake93 avatar Aug 01 '24 08:08 Vake93

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.

baronfel avatar Aug 01 '24 13:08 baronfel