"HTML-like anchors" are only functional in WSL sessions. #21633

Closed
opened 2026-01-31 07:50:19 +00:00 by claunia · 3 comments
Owner

Originally created by @Peter0x44 on GitHub (May 5, 2024).

Windows Terminal version

Version: 1.19.11213.0

Windows build number

WIndows 10 Version 22H2 (OS Build 19045.4291)

Other Software

GCC version 10 or later

Steps to reproduce

Install GCC 10 or later
I use w64devkit:
https://github.com/skeeto/w64devkit/releases/latest

Try compiling the following code:

#include <stdio.h>
int main(void) { printf("%f", 1); }

with:
gcc -Wall test.c -fdiagostics-urls=always

Observe that the hyperlink on [-Wformat=] does not work correctly

Expected Behavior

image
The expected behavior is what WSL does, the hyperlink is present, and ctrl+click opens it.

Actual Behavior

See above screenshot.

Originally created by @Peter0x44 on GitHub (May 5, 2024). ### Windows Terminal version Version: 1.19.11213.0 ### Windows build number WIndows 10 Version 22H2 (OS Build 19045.4291) ### Other Software GCC version 10 or later ### Steps to reproduce Install GCC 10 or later I use w64devkit: https://github.com/skeeto/w64devkit/releases/latest Try compiling the following code: ```c #include <stdio.h> int main(void) { printf("%f", 1); } ``` with: `gcc -Wall test.c -fdiagostics-urls=always` Observe that the hyperlink on [-Wformat=] does not work correctly ### Expected Behavior ![image](https://github.com/microsoft/terminal/assets/49879065/8d33a5bd-b854-4f03-9ab7-83bc58ed6f9a) The expected behavior is what WSL does, the hyperlink is present, and ctrl+click opens it. ### Actual Behavior See above screenshot.
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 07:50:20 +00:00
Author
Owner

@Peter0x44 commented on GitHub (May 5, 2024):

Strangely, this does work within powershell:

gcc test.c -Wall -fdiagnostics-urls=always 2> warning.txt
type warning.txt

as does:
printf '\e]8;;http://example.com\e\\This is a link\e]8;;\e\\\n'
from w64devkit's shell.

@Peter0x44 commented on GitHub (May 5, 2024): Strangely, this *does* work within powershell: ``` gcc test.c -Wall -fdiagnostics-urls=always 2> warning.txt type warning.txt ``` as does: `printf '\e]8;;http://example.com\e\\This is a link\e]8;;\e\\\n'` from w64devkit's shell.
Author
Owner

@Peter0x44 commented on GitHub (May 6, 2024):

Actually, this is probably GCC's fault somehow
It seems to be doing some weirdness here:
21e7aa5f3e/gcc/pretty-print.cc (L661-L701)

    /* If it is not a console, write everything as-is.  */
    write_all (h, read, strlen (read));

This would also explain why the redirection helps.

@Peter0x44 commented on GitHub (May 6, 2024): Actually, this is probably GCC's fault somehow It seems to be doing some weirdness here: https://github.com/gcc-mirror/gcc/blob/21e7aa5f3ea44ca2fef8deb8788edffc04901b5c/gcc/pretty-print.cc#L661-L701 ```c /* If it is not a console, write everything as-is. */ write_all (h, read, strlen (read)); ``` This would also explain why the redirection helps.
Author
Owner

@Peter0x44 commented on GitHub (May 8, 2024):

I did some more digging in GCC and there are multiple causes that result in this. It's not an issue with windows terminal, but I have some questions still. Can someone convert this to a discussion?

@Peter0x44 commented on GitHub (May 8, 2024): I did some more digging in GCC and there are multiple causes that result in this. It's not an issue with windows terminal, but I have some questions still. Can someone convert this to a discussion?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21633