mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 15:10:28 +00:00
hold the connection and cursor less buggy
This commit is contained in:
parent
fa14e6c581
commit
4aeb44362b
1 changed files with 9 additions and 1 deletions
|
@ -438,7 +438,12 @@ U0 ANSIParse()
|
||||||
case 'C':
|
case 'C':
|
||||||
// Cursor Right
|
// Cursor Right
|
||||||
// SysLog("Cursor Right %d %d\n", ansi_param_count, ansi_code[0]);
|
// SysLog("Cursor Right %d %d\n", ansi_param_count, ansi_code[0]);
|
||||||
DocPrint(term.doc, "$$CM,%d,0$$", ansi_code[0]);
|
// DocPrint(term.doc, "$$CM,%d,0$$", ansi_code[0]);
|
||||||
|
// seems to be less prone to bugs?
|
||||||
|
I64 cr;
|
||||||
|
for (cr=0; cr<ansi_code[0]; cr++){
|
||||||
|
DocPrint(term.doc, " ");
|
||||||
|
}
|
||||||
ptr++;
|
ptr++;
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
|
@ -677,6 +682,7 @@ U0 TerminalTask() {
|
||||||
}
|
}
|
||||||
|
|
||||||
while (term.sock_ready) {
|
while (term.sock_ready) {
|
||||||
|
receive_data:
|
||||||
term.buffer_len = TCPSocketReceive(term.sock, term.buffer, BUF_SIZE - 1);
|
term.buffer_len = TCPSocketReceive(term.sock, term.buffer, BUF_SIZE - 1);
|
||||||
if (term.buffer_len > 0) {
|
if (term.buffer_len > 0) {
|
||||||
term.buffer[term.buffer_len] = '\0';
|
term.buffer[term.buffer_len] = '\0';
|
||||||
|
@ -684,6 +690,8 @@ U0 TerminalTask() {
|
||||||
ANSIParse;
|
ANSIParse;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
// SysLog("BUF_SIZE: %d\n", BUF_SIZE);
|
||||||
|
goto receive_data;
|
||||||
// Buffer full or connection closed
|
// Buffer full or connection closed
|
||||||
DocPrint(term.doc, "Error: Connection closed by the remote host.\n");
|
DocPrint(term.doc, "Error: Connection closed by the remote host.\n");
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue