aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-09-24 13:01:00 -0500
committerGitHub <[email protected]>2017-09-24 13:01:00 -0500
commit5a22c8aa92ba3de29bfe9a674441655736105095 (patch)
tree7815c14cda8a7b866166c71b4db6998bd441448e
parent7599dce85f360d8a53d6d2f658dffff436362690 (diff)
parentc9785e86e80413f325076d7b5fc0f4651867c5d2 (diff)
downloadhistacom2-5a22c8aa92ba3de29bfe9a674441655736105095.tar.gz
histacom2-5a22c8aa92ba3de29bfe9a674441655736105095.tar.bz2
histacom2-5a22c8aa92ba3de29bfe9a674441655736105095.zip
Merge pull request #164 from jtsshieh/master
added in clear command
-rw-r--r--Histacom2/OS/Win95/Win95Apps/WinClassicTerminal.cs19
1 files changed, 15 insertions, 4 deletions
diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicTerminal.cs b/Histacom2/OS/Win95/Win95Apps/WinClassicTerminal.cs
index ab736cb..d87dc4e 100644
--- a/Histacom2/OS/Win95/Win95Apps/WinClassicTerminal.cs
+++ b/Histacom2/OS/Win95/Win95Apps/WinClassicTerminal.cs
@@ -28,7 +28,7 @@ namespace Histacom2.OS.Win95.Win95Apps
public static string prefix = @"C:\WINDOWS>";
public static string workingDir = $"{SaveSystem.ProfileWindowsDirectory}";
public string output = "";
-
+ public bool cls = false;
public WinClassicTerminal(bool readOnly)
{
InitializeComponent();
@@ -107,9 +107,10 @@ namespace Histacom2.OS.Win95.Win95Apps
{
//TODO: Add font UC(?)
}
-
+
private void richTextBox1_KeyUp(object sender, KeyEventArgs e)
{
+
if (e.KeyData == Keys.Return)
{
string[] cmd = cmdPrompt.Lines[currentLine].Substring(prefix.Length).Split(' ');
@@ -152,6 +153,12 @@ namespace Histacom2.OS.Win95.Win95Apps
output += dline;
break;
+ case "cls":
+ currentLine = 0;
+ cmdPrompt.Clear();
+ cls = true;
+ output = prefix;
+ break;
default:
// Temporary CMD redirect
/*
@@ -180,8 +187,12 @@ namespace Histacom2.OS.Win95.Win95Apps
{
currentLine++;
}
- cmdPrompt.AppendText($"\n\n{prefix}"); // Append the text to the RichTextBox
- currentLine = currentLine + 3;
+ if (!cls)
+ {
+ cmdPrompt.AppendText($"\n\n{prefix}"); // Append the text to the RichTextBox
+ currentLine = currentLine + 3;
+ }
+ cls = false;
}
}
}