Some file: OSC 8 URLs show up as "Invalid URI" because punycode/idn conversion blows up (?) #20523

Closed
opened 2026-01-31 07:16:27 +00:00 by claunia · 2 comments
Owner

Originally created by @DHowett on GitHub (Sep 22, 2023).

Windows Terminal version

No response

Windows build number

No response

Other Software

No response

Steps to reproduce

"`e]8;;file:D:\this\is\a\very\long\path\with\a\number\of\subdirectories\in\it\and\that\is\OKAY`e\Test URL`e]8;;`e\"

Expected Behavior

No response

Actual Behavior

Hover it! It shows up as an "invalid URI"!

Originally created by @DHowett on GitHub (Sep 22, 2023). ### Windows Terminal version _No response_ ### Windows build number _No response_ ### Other Software _No response_ ### Steps to reproduce ``` "`e]8;;file:D:\this\is\a\very\long\path\with\a\number\of\subdirectories\in\it\and\that\is\OKAY`e\Test URL`e]8;;`e\" ``` ### Expected Behavior _No response_ ### Actual Behavior Hover it! It shows up as an "invalid URI"!
claunia added the Issue-BugIn-PRProduct-TerminalArea-TerminalControl labels 2026-01-31 07:16:28 +00:00
Author
Owner

@237dmitry commented on GitHub (Sep 22, 2023):

Hover it! It shows up as an "invalid URI"!

Perhabs file:// ?

In my environment I could not reproduce.

Screenshot 2023-09-22 111051

@237dmitry commented on GitHub (Sep 22, 2023): > Hover it! It shows up as an "invalid URI"! Perhabs `file://` ? In my environment I could not reproduce. ![Screenshot 2023-09-22 111051](https://github.com/microsoft/terminal/assets/78153320/da7d8178-0829-4251-84b1-dfb5294e4f80)
Author
Owner

@lhecker commented on GitHub (Sep 22, 2023):

@237dmitry The issue only reproduced on a recent version off of main.

This happens because we use IdnToAscii incorrectly. It's designed for domain names, not for entire URLs, and so it fails to work for inputs >63 characters.

@lhecker commented on GitHub (Sep 22, 2023): @237dmitry The issue only reproduced on a recent version off of main. This happens because we use `IdnToAscii` incorrectly. It's designed for domain names, not for entire URLs, and so it fails to work for inputs >63 characters.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20523