From 3b05eba2e26ecad71bbbae5f2c3407646e16582b Mon Sep 17 00:00:00 2001 From: Todd Hubers Date: Sat, 13 Nov 2021 03:05:02 +1100 Subject: [PATCH] Use SendKeys to Execute the Opening Command on the Putty window after logged in + NEWLINE. Tested and working. --- mRemoteNG/Connection/Protocol/PuttyBase.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mRemoteNG/Connection/Protocol/PuttyBase.cs b/mRemoteNG/Connection/Protocol/PuttyBase.cs index d20d7c72..ace86206 100644 --- a/mRemoteNG/Connection/Protocol/PuttyBase.cs +++ b/mRemoteNG/Connection/Protocol/PuttyBase.cs @@ -203,6 +203,10 @@ namespace mRemoteNG.Connection.Protocol string.Format(Language.PanelHandle, InterfaceControl.Parent.Handle), true); + NativeMethods.SetForegroundWindow(PuttyHandle); + var finalCommand = InterfaceControl.Info.OpeningCommand.TrimEnd() + "\n"; + SendKeys.SendWait(finalCommand); + Resize(this, new EventArgs()); base.Connect(); return true;