diff --git a/ShiftOS.Engine/ShiftOS.Engine.csproj b/ShiftOS.Engine/ShiftOS.Engine.csproj index 384d356..db21b5a 100644 --- a/ShiftOS.Engine/ShiftOS.Engine.csproj +++ b/ShiftOS.Engine/ShiftOS.Engine.csproj @@ -76,6 +76,12 @@ + + UserControl + + + ShiftButton.cs + UserControl @@ -1102,8 +1108,6 @@ - - - + \ No newline at end of file diff --git a/ShiftOS.Engine/UI/ShiftButton.Designer.cs b/ShiftOS.Engine/UI/ShiftButton.Designer.cs new file mode 100644 index 0000000..a84ba4a --- /dev/null +++ b/ShiftOS.Engine/UI/ShiftButton.Designer.cs @@ -0,0 +1,37 @@ +namespace ShiftOS.Engine.UI +{ + partial class ShiftButton + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/ShiftOS.Engine/UI/ShiftButton.cs b/ShiftOS.Engine/UI/ShiftButton.cs new file mode 100644 index 0000000..ebf6e2b --- /dev/null +++ b/ShiftOS.Engine/UI/ShiftButton.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ShiftOS.Engine.UI +{ + public partial class ShiftButton : UserControl + { + public ShiftButton() + { + InitializeComponent(); + } + } +} diff --git a/ShiftOS.Main/Terminal/TerminalBackend.cs b/ShiftOS.Main/Terminal/TerminalBackend.cs index 59e4f27..7904718 100644 --- a/ShiftOS.Main/Terminal/TerminalBackend.cs +++ b/ShiftOS.Main/Terminal/TerminalBackend.cs @@ -30,6 +30,7 @@ namespace ShiftOS.Main.Terminal var theParams = new string[command.Split(' ').Length - 1]; Array.Copy(command.Split(' '), 1, theParams, 0, command.Split(' ').Length - 1); + bool complete = false; foreach (TerminalCommand instance in instances) { if (instance.Name.ToLower() == name.ToLower()) @@ -38,14 +39,17 @@ namespace ShiftOS.Main.Terminal // Add a new line! Array.Find(trm.ToArray(), w => w.TerminalID == TermID).termmain.AppendText("\n"); instance.Run(theParams); - return; - } - else - { - Array.Find(trm.ToArray(), w => w.TerminalID == TermID).termmain.AppendText($"\nsbash: {command.Split(' ').First()}: invalid command"); + complete = true; return; } } + if(!complete) + { + Array.Find(trm.ToArray(), w => w.TerminalID == TermID).termmain.AppendText($"\nsbash: {command.Split(' ').First()}: invalid command"); + return; + } + + Array.Find(trm.ToArray(), w => w.TerminalID == TermID).termmain.Text += " \n The command cannot be found. \n"; }