mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
From RDB: a patch to allow special keys (^C, ^Z, Delete, Return) to
send Telnet special sequences (Interrupt Process, Suspend, Erase Char, End Of Line) instead of their ASCII equivalents. In particular Return -> Telnet End Of Line is _always_ enabled irrespective of the configuration, while the others are optional. Also in this patch, an entertainingly ghastly use of `switch' to allow literal ^M^J to do the same thing as magic-^M (the Return key) when in Raw protocol. [originally from svn r1109]
This commit is contained in:
7
telnet.c
7
telnet.c
@ -653,7 +653,9 @@ static void telnet_send(char *buf, int len)
|
||||
char *p;
|
||||
static unsigned char iac[2] = { IAC, IAC };
|
||||
static unsigned char cr[2] = { CR, NUL };
|
||||
#if 0
|
||||
static unsigned char nl[2] = { CR, LF };
|
||||
#endif
|
||||
|
||||
if (s == NULL)
|
||||
return;
|
||||
@ -667,7 +669,7 @@ static void telnet_send(char *buf, int len)
|
||||
sk_write(s, q, p - q);
|
||||
|
||||
while (p < buf + len && !iswritable((unsigned char) *p)) {
|
||||
sk_write(s, (unsigned char) *p == IAC ? iac : nl, 2);
|
||||
sk_write(s, (unsigned char) *p == IAC ? iac : cr, 2);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
@ -759,6 +761,9 @@ static void telnet_special(Telnet_Special code)
|
||||
b[1] = xEOF;
|
||||
sk_write(s, b, 2);
|
||||
break;
|
||||
case TS_EOL:
|
||||
sk_write(s, "\r\n", 2);
|
||||
break;
|
||||
case TS_SYNCH:
|
||||
b[1] = DM;
|
||||
sk_write(s, b, 1);
|
||||
|
Reference in New Issue
Block a user