diff --git a/Flow.Launcher.Plugin.Putty/Plugin.cs b/Flow.Launcher.Plugin.Putty/Plugin.cs index d3582ba..2544de0 100644 --- a/Flow.Launcher.Plugin.Putty/Plugin.cs +++ b/Flow.Launcher.Plugin.Putty/Plugin.cs @@ -200,13 +200,15 @@ private bool LaunchPuttySession(string session, PuttySession puttySession = null var p = new Process { StartInfo = { FileName = puttyPath } }; - if (!string.IsNullOrEmpty(puttySession?.Hostname)) + if (!string.IsNullOrEmpty(puttySession?.Identifier)) { - p.StartInfo.Arguments = "-load \"" + puttySession.Identifier + "\""; + p.StartInfo.ArgumentList.Add("-load"); + p.StartInfo.ArgumentList.Add(puttySession.Identifier); } else if (!string.IsNullOrEmpty(session)) { - p.StartInfo.Arguments = "-ssh \"" + session + "\""; + p.StartInfo.ArgumentList.Add("-ssh"); + p.StartInfo.ArgumentList.Add(session); } if (settings.AlwaysStartsSessionMaximized) diff --git a/Flow.Launcher.Plugin.Putty/PuttySessionService.cs b/Flow.Launcher.Plugin.Putty/PuttySessionService.cs index 4994ac2..feedff9 100644 --- a/Flow.Launcher.Plugin.Putty/PuttySessionService.cs +++ b/Flow.Launcher.Plugin.Putty/PuttySessionService.cs @@ -31,13 +31,19 @@ public IEnumerable GetAll() } try { - results.Add(new PuttySession + var session = new PuttySession { Identifier = Uri.UnescapeDataString(subKey), Protocol = puttySessionSubKey.GetValue("Protocol").ToString(), Username = puttySessionSubKey.GetValue("UserName").ToString(), Hostname = puttySessionSubKey.GetValue("HostName").ToString(), - }); + }; + if (session.Protocol == "serial") + { + session.Hostname = $"{puttySessionSubKey.GetValue("SerialLine")}?baud={puttySessionSubKey.GetValue("SerialSpeed")}"; + session.Username = string.Empty; // ensure ToString doesn't append username + } + results.Add(session); } catch (Exception) { diff --git a/Flow.Launcher.Plugin.Putty/plugin.json b/Flow.Launcher.Plugin.Putty/plugin.json index 83e77d0..e96d659 100644 --- a/Flow.Launcher.Plugin.Putty/plugin.json +++ b/Flow.Launcher.Plugin.Putty/plugin.json @@ -4,7 +4,7 @@ "Name": "Putty", "Description": "Launch Putty Sessions", "Author":"Konstantin Zaitcev, Kai Eichinger (@cH40zLord)", - "Version":"2.1.3", + "Version":"2.2.0", "Language": "csharp", "Website": "https://github.com/jjw24/Flow.Launcher.Plugin.Putty", "ExecuteFileName": "Flow.Launcher.Plugin.Putty.dll",