mirror of
https://github.com/HistacomUnity/Histacom2-old.git
synced 2025-01-22 09:02:01 -05:00
Fix the terminal indexing bug
This commit is contained in:
parent
d55b0e22ae
commit
e0254a72c2
1 changed files with 7 additions and 4 deletions
|
@ -174,11 +174,14 @@ private void richTextBox1_KeyUp(object sender, KeyEventArgs e)
|
|||
|
||||
cmdPrompt.Focus();
|
||||
cmdPrompt.AppendText($"\n{output}"); // Append the command output
|
||||
|
||||
int numLines = output.Split('\n').Length; // Get the number of lines from the command output
|
||||
currentLine = currentLine + 2 + numLines; // Set the current line to equals the previous line plus 2 plus the number of lines from the command
|
||||
|
||||
string[] stringSeparators = new string[] { "\n" };
|
||||
string[] lines = output.Split(stringSeparators, StringSplitOptions.None);
|
||||
foreach (string s in lines)
|
||||
{
|
||||
currentLine++;
|
||||
}
|
||||
cmdPrompt.AppendText($"\n\n{prefix}"); // Append the text to the RichTextBox
|
||||
currentLine = currentLine + 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue