[PR #5327] fix scheme name resolution, and schema load on WSL #26261

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

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

State: closed
Merged: Yes


This PR fixes the scheme resolution bug outlined in #5326

The approach is as follows:

  • In [SchemeManager.cs], find the first scheme parser that actually
    successfully parses the scheme, as opposed to the existing code, which
    finds the first scheme parser which says it can parse the scheme, as
    that logic spuriously returns true currently.
  • In [XmlSchemeParser.cs] and [JsonParser.cs], ensure that the contents
    of the file are read and the contents passed to XmlDocument.LoadXXX,
    as this fails with an UriException on WSL otherwise.
  • Remove CanParse as it is superfluous. The check for a valid scheme
    parser should not just check an extension but also if the file exists
    • this is best done by the ParseScheme function as it already
      returns null on failure.
  • Add FileExtension to the interface because we need it lifted now.

Closes #5326

**Original Pull Request:** https://github.com/microsoft/terminal/pull/5327 **State:** closed **Merged:** Yes --- This PR fixes the scheme resolution bug outlined in #5326 The approach is as follows: * In [SchemeManager.cs], find the first scheme parser that actually successfully parses the scheme, as opposed to the existing code, which finds the first scheme parser which _says it can parse the scheme_, as that logic spuriously returns `true` currently. * In [XmlSchemeParser.cs] and [JsonParser.cs], ensure that the contents of the file are read and the contents passed to XmlDocument.LoadXXX, as this fails with an UriException on WSL otherwise. * Remove `CanParse` as it is superfluous. The check for a valid scheme parser should not just check an extension but also if the file exists - this is best done by the `ParseScheme` function as it already returns null on failure. * Add `FileExtension` to the interface because we need it lifted now. Closes #5326
claunia added the pull-request label 2026-01-31 09:14:59 +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#26261