diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index 94e9865e63a..f20c106ee0b 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -2473,14 +2473,27 @@ namespace winrt::TerminalApp::implementation { return true; } + + // GH#10188: WSL paths are okay. We'll let those through. + if (host == L"wsl$" || host == L"wsl.localhost") + { + return true; + } + // TODO: by the OSC 8 spec, if a hostname (other than localhost) is provided, we _should_ be // comparing that value against what is returned by GetComputerNameExW and making sure they match. // However, ShellExecute does not seem to be happy with file URIs of the form // file://{hostname}/path/to/file.ext // and so while we could do the hostname matching, we do not know how to actually open the URI // if its given in that form. So for now we ignore all hostnames other than localhost + return false; } - return false; + + // In this case, the app manually output a URI other than file:// or + // http(s)://. We'll trust the user knows what they're doing when + // clicking on those sorts of links. + // See discussion in GH#7562 for more details. + return true; } // Important! Don't take this eventArgs by reference, we need to extend the