mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
Fix bug where terminal hangs on bad command
This commit is contained in:
parent
5246798b0a
commit
ce5469464a
1 changed files with 3 additions and 22 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue