diff options
| author | lempamo <[email protected]> | 2017-09-23 22:09:24 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-09-23 22:09:24 -0500 |
| commit | 7599dce85f360d8a53d6d2f658dffff436362690 (patch) | |
| tree | 67951db39293b3136eec9dc3cb8c60809294a6ac | |
| parent | d55b0e22ae5006892e8a95d2f188a773dccada77 (diff) | |
| parent | e0254a72c2b31bf6aa274389eeb93879a240b9b5 (diff) | |
| download | histacom2-7599dce85f360d8a53d6d2f658dffff436362690.tar.gz histacom2-7599dce85f360d8a53d6d2f658dffff436362690.tar.bz2 histacom2-7599dce85f360d8a53d6d2f658dffff436362690.zip | |
Merge pull request #163 from jtsshieh/master
Fix the terminal indexing bug
| -rw-r--r-- | Histacom2/OS/Win95/Win95Apps/WinClassicTerminal.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicTerminal.cs b/Histacom2/OS/Win95/Win95Apps/WinClassicTerminal.cs index 668078e..ab736cb 100644 --- a/Histacom2/OS/Win95/Win95Apps/WinClassicTerminal.cs +++ b/Histacom2/OS/Win95/Win95Apps/WinClassicTerminal.cs @@ -174,11 +174,14 @@ namespace Histacom2.OS.Win95.Win95Apps 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; } } } |
