diff options
| author | FloppyDiskDrive <[email protected]> | 2017-11-21 17:47:37 -0600 |
|---|---|---|
| committer | FloppyDiskDrive <[email protected]> | 2017-11-21 17:47:37 -0600 |
| commit | 04ce34c09976bb3d28c6bc88db7a3bdc50bd543c (patch) | |
| tree | 5f205ba6b0d27ceef40837c906d02dca99e7dfd0 /ShiftOS.Main | |
| parent | 170aebeb6858e12c797aacb81eaa882c059548a9 (diff) | |
| download | shiftos-rewind-04ce34c09976bb3d28c6bc88db7a3bdc50bd543c.tar.gz shiftos-rewind-04ce34c09976bb3d28c6bc88db7a3bdc50bd543c.tar.bz2 shiftos-rewind-04ce34c09976bb3d28c6bc88db7a3bdc50bd543c.zip | |
yay mostly working terminal
Diffstat (limited to 'ShiftOS.Main')
| -rw-r--r-- | ShiftOS.Main/ShiftOS/Apps/Terminal.cs | 10 | ||||
| -rw-r--r-- | ShiftOS.Main/Terminal/TerminalBackend.cs | 5 |
2 files changed, 11 insertions, 4 deletions
diff --git a/ShiftOS.Main/ShiftOS/Apps/Terminal.cs b/ShiftOS.Main/ShiftOS/Apps/Terminal.cs index 28e301c..44452ab 100644 --- a/ShiftOS.Main/ShiftOS/Apps/Terminal.cs +++ b/ShiftOS.Main/ShiftOS/Apps/Terminal.cs @@ -2,6 +2,8 @@ using System.Windows.Forms; using ShiftOS.Engine; using ShiftOS.Main.Terminal; +using System.Linq; +using System.Collections.Generic; namespace ShiftOS.Main.ShiftOS.Apps { @@ -14,6 +16,7 @@ namespace ShiftOS.Main.ShiftOS.Apps public bool RunningCommand = false; public bool WaitingResponse = false; public string InputReturnText = ""; + public List<string> c = TerminalBackend.commandBuffer; // The below variables makes the terminal... a terminal! string OldText = ""; @@ -127,6 +130,11 @@ namespace ShiftOS.Main.ShiftOS.Apps Print(); e.Handled = true; } - } + else if (e.KeyCode == Keys.Up) + { + if (c.Count == 0) return; + termmain.AppendText(c.Last()); + } + } } } diff --git a/ShiftOS.Main/Terminal/TerminalBackend.cs b/ShiftOS.Main/Terminal/TerminalBackend.cs index b697ef8..52fd9b0 100644 --- a/ShiftOS.Main/Terminal/TerminalBackend.cs +++ b/ShiftOS.Main/Terminal/TerminalBackend.cs @@ -17,6 +17,7 @@ namespace ShiftOS.Main.Terminal public static List<ShiftOS.Apps.Terminal> trm = new List<ShiftOS.Apps.Terminal>(); public static int trmTopID = 0; + public static List<string> commandBuffer = new List<string>(); /// <summary> /// Runs a terminal command. /// </summary> @@ -40,6 +41,7 @@ namespace ShiftOS.Main.Terminal Array.Find(trm.ToArray(), w => w.TerminalID == TermID).termmain.AppendText("\n"); instance.Run(theParams); complete = true; + commandBuffer.Add(command); return; } } @@ -48,9 +50,6 @@ namespace ShiftOS.Main.Terminal Array.Find(trm.ToArray(), w => w.TerminalID == TermID).termmain.AppendText($"\n sbash: invalid command: {command.Split(' ').First()}"); return; } - - - Array.Find(trm.ToArray(), w => w.TerminalID == TermID).termmain.Text += " \n The command cannot be found. \n"; } } |
