From 7b280ebde1d6917dff09b2b37704343f0cd3a019 Mon Sep 17 00:00:00 2001 From: ricardosantos9521 Date: Mon, 27 Dec 2021 18:16:43 +0000 Subject: [PATCH] [PT RUN] [VSCodeWorkspaces] no remote ssh machines are appearing in the result list #15106 (#15107) --- .../RemoteMachinesHelper/VSCodeRemoteMachinesApi.cs | 2 +- .../SshConfigParser/SshConfig.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/RemoteMachinesHelper/VSCodeRemoteMachinesApi.cs b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/RemoteMachinesHelper/VSCodeRemoteMachinesApi.cs index b00702bf67..66694ec8dc 100644 --- a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/RemoteMachinesHelper/VSCodeRemoteMachinesApi.cs +++ b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/RemoteMachinesHelper/VSCodeRemoteMachinesApi.cs @@ -35,7 +35,7 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.RemoteMachinesHelper try { - JsonElement vscodeSettingsFile = JsonSerializer.Deserialize(fileContent); + JsonElement vscodeSettingsFile = JsonSerializer.Deserialize(fileContent, new JsonSerializerOptions() { AllowTrailingCommas = true, ReadCommentHandling = JsonCommentHandling.Skip }); if (vscodeSettingsFile.TryGetProperty("remote.SSH.configFile", out var pathElement)) { var path = pathElement.GetString(); diff --git a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/SshConfigParser/SshConfig.cs b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/SshConfigParser/SshConfig.cs index ef113c0484..76c515cec8 100644 --- a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/SshConfigParser/SshConfig.cs +++ b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/SshConfigParser/SshConfig.cs @@ -21,7 +21,7 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.SshConfigParser public static IEnumerable Parse(string str) { - str = str.Replace('\r', '\0'); + str = str.Replace("\r", string.Empty); var list = new List(); foreach (Match match in _sshConfig.Matches(str)) {