From 889288c65febdbaad2fe853acd0be92c2362f551 Mon Sep 17 00:00:00 2001 From: y4my4my4m <8145020+y4my4my4m@users.noreply.github.com> Date: Tue, 9 May 2023 01:35:03 +0900 Subject: [PATCH] fix --- src/Home/Telnet/Telnet.ZC | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/Home/Telnet/Telnet.ZC b/src/Home/Telnet/Telnet.ZC index c1dcaf2d..691ddf03 100755 --- a/src/Home/Telnet/Telnet.ZC +++ b/src/Home/Telnet/Telnet.ZC @@ -150,6 +150,7 @@ U0 InputTask(U0 *args) { DocTermNew; DocPrint(, "$$WW,1$$"); + DocCursor; U8 input_buffer[BUF_SIZE]; U8 *temp, ch; @@ -162,6 +163,7 @@ U0 InputTask(U0 *args) { DocBottom(input_task->put_doc); "\n$$RED$$$BK,1$Input$BK,0$$$BLACK$$:"; + // https://theasciicode.com.ar/ascii-control-characters/escape-ascii-code-27.html input_len = 0; while (1) { ch = CharGet(, FALSE); @@ -175,7 +177,15 @@ U0 InputTask(U0 *args) { break; } else if (ch == CH_ESC) { - input_buffer[input_len++] = 0x1B; + TCPSocketSendString(sock, 0x27); + break; + } + // else if (ch == CH_BACKSPACE) { + // TCPSocketSendString(sock, 0x08); + // break; + // } + else if (ch == 0x0F) { // TAB? + TCPSocketSendString(sock, 0x09); break; } else { @@ -185,7 +195,7 @@ U0 InputTask(U0 *args) { DocPrint(input_task->put_doc, "%c", ch); } } - input_buffer[input_len++] = '\0'; + // input_buffer[input_len++] = '\0'; if (!force_disconnect) { SysLog(input_buffer); @@ -218,8 +228,9 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) { WinHorz(Fs->win_left, Fs->win_left+window_width, Fs); WinVert(Fs->win_top + window_top, Fs->win_top + window_top + window_height, Fs); - WinToTop(Fs); - WinFocus(Fs); + DocCursor(OFF); + // WinToTop(Fs); + // WinFocus(Fs); sock = TelnetOpen(host, port); if (sock <= 0) { @@ -332,7 +343,7 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) { // Respond with cursor position // U8 response[32] = "\x1B[%d;%dR", window_width, window_height; SysLog("reported cursor position\n"); - TCPSocketSendString(sock, "\x1B[25;80R"); + TCPSocketSendString(sock, "\x1B\[25;80R"); } ptr++; } else if (*ptr == 'c') { @@ -529,7 +540,7 @@ U0 TelnetPrompt() { // Telnet("TextMMOde.com"); // Sands of Time / Deep Space MMO // Telnet("legendofthereddragon.ca"); // Legend of the Red Dragon (Canada) // Telnet("lord.stabs.org"); // Legend of the Red Dragon -Telnet("thehatshop.mudhosting.net", 3000); // Hallowed Halls +// Telnet("thehatshop.mudhosting.net", 3000); // Hallowed Halls // Telnet("batmud.bat.org"); // BatMUD // Telnet("forgottenkingdoms.org", 4000); // Forgotten Kingdoms // Telnet("igormud.org", 1701);// Igor MUD @@ -537,5 +548,7 @@ Telnet("thehatshop.mudhosting.net", 3000); // Hallowed Halls // Telnet("gcomm.com"); // Galacticomm BBS // Telnet("1984.ws"); // 1984 +Telnet("telnet.holdfastbbs.ca", 2323); + // ZealBBS dev server // Telnet("localhost", 8888); \ No newline at end of file