Skip to content
Snippets Groups Projects
Commit b2d98bb2 authored by rswindell's avatar rswindell
Browse files

Bug-fix: when using Telnet, we would *always* send the terminal type

(if the server supported the option), as "ANSI". Now, if the current cterm
emualation is PETASCII [sic], or ATASCII, send "PETSCII" or "ATASCII"
instead.

Now this brings up a couple of discussion points:
1. Should that default Telnet term-type be "ANSI-BBS" (or "ansi-bbs") instead?
2. Similarlly, RLogin connections *always* send the term-type as "ansi-bbs" -
   I think a similar change is needed in rlogin.c to be technically correct,
   but we should probably be consistent about how SyncTERM in ANSI-BBS emulation
   mode identifies itself ("ANSI", "ANSI-BBS", or "ansi-bbs").
3. If there is terminal type advertised via SSH, that probably needs addressing
   as well.
parent f251cec5
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@
#include <string.h>
#include "term.h"
#include "cterm.h"
#include "genwrap.h"
#include "sockwrap.h"
......@@ -158,11 +159,21 @@ BYTE* telnet_interpret(BYTE* inbuf, int inlen, BYTE* outbuf, int *outlen)
/* sub-option terminated */
if(option==TELNET_TERM_TYPE && telnet_cmd[3]==TELNET_TERM_SEND) {
char buf[32];
int len=sprintf(buf,"%c%c%c%cANSI%c%c"
const char *termtype = "ANSI";
switch(cterm->emulation) {
case CTERM_EMULATION_PETASCII:
termtype = "PETSCII";
break;
case CTERM_EMULATION_ATASCII:
termtype = "ATASCII";
break;
}
int len=sprintf(buf,"%c%c%c%c%s%c%c"
,TELNET_IAC,TELNET_SB
,TELNET_TERM_TYPE,TELNET_TERM_IS
,termtype
,TELNET_IAC,TELNET_SE);
lprintf(LOG_INFO,"TX: Terminal Type is ANSI");
lprintf(LOG_INFO,"TX: Terminal Type is %s", termtype);
putcom(buf,len);
request_telnet_opt(TELNET_WILL, TELNET_NEGOTIATE_WINDOW_SIZE);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment