X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/760e88b21a672b2a4bb96c4c1bc041758eac1677..3f2d010c23f77862bb890b5f88244039bcf8f875:/ldisc.c diff --git a/ldisc.c b/ldisc.c index 492ad1e0..131cc428 100644 --- a/ldisc.c +++ b/ldisc.c @@ -132,6 +132,13 @@ void ldisc_send(char *buf, int len, int interactive) term_buflen--; } back->special(TS_EL); + /* + * We don't send IP, SUSP or ABORT if the user has + * configured telnet specials off! This breaks + * talkers otherwise. + */ + if (!cfg.telnet_keyboard) + goto default_case; if (c == CTRL('C')) back->special(TS_IP); if (c == CTRL('Z')) @@ -193,7 +200,7 @@ void ldisc_send(char *buf, int len, int interactive) back->send(term_buf, term_buflen); if (cfg.protocol == PROT_RAW) back->send("\r\n", 2); - else if (cfg.protocol == PROT_TELNET) + else if (cfg.protocol == PROT_TELNET && cfg.telnet_newline) back->special(TS_EOL); else back->send("\r", 1); @@ -204,6 +211,7 @@ void ldisc_send(char *buf, int len, int interactive) } /* FALLTHROUGH */ default: /* get to this label from ^V handler */ + default_case: if (term_buflen >= term_bufsiz) { term_bufsiz = term_buflen + 256; term_buf = saferealloc(term_buf, term_bufsiz); @@ -229,7 +237,10 @@ void ldisc_send(char *buf, int len, int interactive) if (keyflag && cfg.protocol == PROT_TELNET && len == 1) { switch (buf[0]) { case CTRL('M'): - back->special(TS_EOL); + if (cfg.protocol == PROT_TELNET && cfg.telnet_newline) + back->special(TS_EOL); + else + back->send("\r", 1); break; case CTRL('?'): case CTRL('H'):