From 555cc1319aae4b6e7cf9421f63dee9ffc547cbd5 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 22 Jan 2017 10:01:13 -0500 Subject: Add trm.exit command for exiting remote sessions. --- ShiftOS.WinForms/Commands.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'ShiftOS.WinForms/Commands.cs') diff --git a/ShiftOS.WinForms/Commands.cs b/ShiftOS.WinForms/Commands.cs index 2f95fe2..2d297f5 100644 --- a/ShiftOS.WinForms/Commands.cs +++ b/ShiftOS.WinForms/Commands.cs @@ -42,6 +42,25 @@ namespace ShiftOS.WinForms [Namespace("trm")] public static class TerminalExtensions { + [Command("exit")] + public static bool StopRemoting() + { + if(TerminalBackend.IsForwardingConsoleWrites == true) + { + ServerManager.SendMessage("trm_handshake_stop", $@"{{ + guid: ""{TerminalBackend.ForwardGUID}"" +}}"); + Console.WriteLine("Goodbye!"); + } + else + { + return false; + } + + return true; + } + + [Command("setpass", true)] [RequiresArgument("pass")] public static bool setPass(Dictionary args) -- cgit v1.2.3