diff options
| author | Michael <[email protected]> | 2017-06-02 08:15:51 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-06-02 08:15:51 -0400 |
| commit | ce5469464ad90e801f828dfc80ee630257e2dc96 (patch) | |
| tree | b5b0e7362a11e63da2dd50bbb7db6a4400b7e888 | |
| parent | 5246798b0ad07ac1a2dd9a1369da4ecad2383488 (diff) | |
| download | shiftos_thereturn-ce5469464ad90e801f828dfc80ee630257e2dc96.tar.gz shiftos_thereturn-ce5469464ad90e801f828dfc80ee630257e2dc96.tar.bz2 shiftos_thereturn-ce5469464ad90e801f828dfc80ee630257e2dc96.zip | |
Fix bug where terminal hangs on bad command
| -rw-r--r-- | ShiftOS_TheReturn/TerminalBackend.cs | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/ShiftOS_TheReturn/TerminalBackend.cs b/ShiftOS_TheReturn/TerminalBackend.cs index 6104927..09ef3d6 100644 --- a/ShiftOS_TheReturn/TerminalBackend.cs +++ b/ShiftOS_TheReturn/TerminalBackend.cs @@ -108,13 +108,7 @@ namespace ShiftOS.Engine if (!commandWasClient && !string.IsNullOrWhiteSpace(ns)) { - PrefixEnabled = false; - - ServerManager.SendMessage("script", $@"{{ - user: ""{ns}"", - script: ""{command}"", - args: ""{GetSentArgs(arguments)}"" -}}"); + Console.WriteLine("Error: Command not found."); } CommandProcessed?.Invoke(ns + "." + command, JsonConvert.SerializeObject(arguments)); @@ -369,27 +363,14 @@ namespace ShiftOS.Engine { var args = GetArgs(ref text); - Stopwatch debugger = new Stopwatch(); - debugger.Start(); bool commandWasClient = RunClient(text, args, isRemote); if (!commandWasClient) { - Console.WriteLine("Command not found."); - debugger.Stop(); - return; + Console.WriteLine("Error: Command not found."); + } CommandProcessed?.Invoke(text, GetSentArgs(args)); - debugger.Stop(); - ConsoleEx.ForegroundColor = ConsoleColor.White; - Console.Write("<"); - ConsoleEx.Bold = true; - ConsoleEx.ForegroundColor = ConsoleColor.Blue; - Console.Write("debugger"); - ConsoleEx.ForegroundColor = ConsoleColor.White; - ConsoleEx.Bold = false; - Console.Write("> "); - Console.WriteLine("Command " + text + " took " + debugger.Elapsed.ToString() + " to execute."); } catch (Exception ex) { |
