[PR #16026] Fix URL sanitizer for long URLs #30810

Open
opened 2026-01-31 09:43:07 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/16026

State: closed
Merged: Yes


f1aa699 was fundamentally incorrect as it used IdnToAscii and
IdnToUnicode on the entire URL, even though these functions only work
on domain names. This commit fixes the issue by using the WinRT Url
class and its AbsoluteUri and AbsoluteCanonicalUri getters.
The algorithm still works the same way though.

Closes #16017

Validation Steps Performed

  • "`e]8;;https://www.xn--fcbook-3nf5b.com/`e\test`e]8;;`e\"
    still shows as two URLs in the popup
  • Shows the given URI if it's canonical and not an IDN
  • Works with >100 char long file:// URIs
**Original Pull Request:** https://github.com/microsoft/terminal/pull/16026 **State:** closed **Merged:** Yes --- f1aa699 was fundamentally incorrect as it used `IdnToAscii` and `IdnToUnicode` on the entire URL, even though these functions only work on domain names. This commit fixes the issue by using the WinRT `Url` class and its `AbsoluteUri` and `AbsoluteCanonicalUri` getters. The algorithm still works the same way though. Closes #16017 ## Validation Steps Performed * ``"`e]8;;https://www.xn--fcbook-3nf5b.com/`e\test`e]8;;`e\"`` still shows as two URLs in the popup ✅ * Shows the given URI if it's canonical and not an IDN ✅ * Works with >100 char long file:// URIs ✅
claunia added the pull-request label 2026-01-31 09:43:07 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30810