Hyperlinks with the same ID and different URIs collide when they shouldn't #10712

Open
opened 2026-01-31 02:28:03 +00:00 by claunia · 0 comments
Owner

Originally created by @PhMajerus on GitHub (Sep 22, 2020).

Originally assigned to: @DHowett on GitHub.

In Windows Terminal Preview 1.4.2652.0.
Hyperlinks support is a great addition, but from my understanding there is a bug with how links IDs are parsed and handled.

Character cells that have the same target URI and the same nonempty id are always underlined together on mouseover.
The same id is only used for connecting character cells whose URIs is also the same. Character cells pointing to different URIs should never be underlined together when hovering over.
(Source: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#hover-underlining-and-the-id-parameter )

But testing the same ID with different URIs shows Windows Terminal is grouping them together and using the URI of the last one for both :
echo -e '\e]8;id=a;http://www.microsoft.com/\aMicrosoft\e]8;;\a \e]8;id=a;http://www.google.com/\aGoogle\e]8;;\a'

image

Even different IDs are grouped together if they are not numbers:
echo -e '\e]8;id=a;http://www.microsoft.com/\aMicrosoft\e]8;;\a \e]8;id=b;http://www.google.com/\aGoogle\e]8;;\a'

While the page about hyperlinks explicitely shows and states that these IDs are strings, not numbers:

params is an optional list of key=value assignments, separated by the : character. Example: id=xyz123:foo=bar:baz=quux.

Complex apps that display data that might itself contain OSC 8 hyperlinks (such as terminal multiplexers, less -R) should do the following: If the encountered OSC 8 hyperlink already has an id, they should prefix it with some static string, or if multiple windows/panes are supported by the app, a prefix that's unique to that window/pane to prevent conflict with other windows/panes.

Originally created by @PhMajerus on GitHub (Sep 22, 2020). Originally assigned to: @DHowett on GitHub. In Windows Terminal Preview 1.4.2652.0. Hyperlinks support is a great addition, but from my understanding there is a bug with how links IDs are parsed and handled. > Character cells that have the same target URI and the same nonempty id are always underlined together on mouseover. > The same id is only used for connecting character cells whose URIs is also the same. Character cells pointing to different URIs should never be underlined together when hovering over. (Source: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#hover-underlining-and-the-id-parameter ) But testing the same ID with different URIs shows Windows Terminal is grouping them together and using the URI of the last one for both : `echo -e '\e]8;id=a;http://www.microsoft.com/\aMicrosoft\e]8;;\a \e]8;id=a;http://www.google.com/\aGoogle\e]8;;\a'` ![image](https://user-images.githubusercontent.com/25664275/93923654-f8499800-fd13-11ea-9db5-ab3a93860485.png) Even different IDs are grouped together if they are not numbers: `echo -e '\e]8;id=a;http://www.microsoft.com/\aMicrosoft\e]8;;\a \e]8;id=b;http://www.google.com/\aGoogle\e]8;;\a'` While the page about hyperlinks explicitely shows and states that these IDs are strings, not numbers: > params is an optional list of key=value assignments, separated by the : character. Example: id=xyz123:foo=bar:baz=quux. > Complex apps that display data that might itself contain OSC 8 hyperlinks (such as terminal multiplexers, less -R) should do the following: If the encountered OSC 8 hyperlink already has an id, they should prefix it with some static string, or if multiple windows/panes are supported by the app, a prefix that's unique to that window/pane to prevent conflict with other windows/panes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10712