mirror of
https://github.com/HistacomUnity/Histacom2-old.git
synced 2025-01-22 09:02:01 -05:00
commit
5a22c8aa92
1 changed files with 15 additions and 4 deletions
|
@ -28,7 +28,7 @@ public partial class WinClassicTerminal : UserControl
|
||||||
public static string prefix = @"C:\WINDOWS>";
|
public static string prefix = @"C:\WINDOWS>";
|
||||||
public static string workingDir = $"{SaveSystem.ProfileWindowsDirectory}";
|
public static string workingDir = $"{SaveSystem.ProfileWindowsDirectory}";
|
||||||
public string output = "";
|
public string output = "";
|
||||||
|
public bool cls = false;
|
||||||
public WinClassicTerminal(bool readOnly)
|
public WinClassicTerminal(bool readOnly)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
@ -107,9 +107,10 @@ private void btnFont_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//TODO: Add font UC(?)
|
//TODO: Add font UC(?)
|
||||||
}
|
}
|
||||||
|
|
||||||
private void richTextBox1_KeyUp(object sender, KeyEventArgs e)
|
private void richTextBox1_KeyUp(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (e.KeyData == Keys.Return)
|
if (e.KeyData == Keys.Return)
|
||||||
{
|
{
|
||||||
string[] cmd = cmdPrompt.Lines[currentLine].Substring(prefix.Length).Split(' ');
|
string[] cmd = cmdPrompt.Lines[currentLine].Substring(prefix.Length).Split(' ');
|
||||||
|
@ -151,6 +152,12 @@ private void richTextBox1_KeyUp(object sender, KeyEventArgs e)
|
||||||
dline = dline.Insert(34, "bytes free");
|
dline = dline.Insert(34, "bytes free");
|
||||||
output += dline;
|
output += dline;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "cls":
|
||||||
|
currentLine = 0;
|
||||||
|
cmdPrompt.Clear();
|
||||||
|
cls = true;
|
||||||
|
output = prefix;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// Temporary CMD redirect
|
// Temporary CMD redirect
|
||||||
|
@ -180,8 +187,12 @@ private void richTextBox1_KeyUp(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
currentLine++;
|
currentLine++;
|
||||||
}
|
}
|
||||||
cmdPrompt.AppendText($"\n\n{prefix}"); // Append the text to the RichTextBox
|
if (!cls)
|
||||||
currentLine = currentLine + 3;
|
{
|
||||||
|
cmdPrompt.AppendText($"\n\n{prefix}"); // Append the text to the RichTextBox
|
||||||
|
currentLine = currentLine + 3;
|
||||||
|
}
|
||||||
|
cls = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue