[git commit] telnet: add disabled code to emit EC and IP

Denys Vlasenko vda.linux at googlemail.com
Fri Oct 18 14:47:37 UTC 2019


commit: https://git.busybox.net/busybox/commit/?id=95867147f5cdf6650dbfc207c8dada86246f23ae
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

> I'm trying to connect to a Korenix 3005 switch through telnet
> for management purposes, and all is well except for the backspace character
> - seems like my switch doesn't handle it too well and instead of erasing
> the last character all it does is print some garbage to the screen.
> I've had the same issue before while using putty, but saw a solution that
> suggests to enable "Telnet special commands" in the options menu, and it
> worked.

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 networking/telnet.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/networking/telnet.c b/networking/telnet.c
index 5c8805265..9fc85050b 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -238,6 +238,18 @@ static void handle_net_output(int len)
 			*dst = '\r'; /* Enter -> CR LF */
 			*++dst = '\n';
 		}
+#if 0
+/* putty's "special commands" mode does this: */
+/* Korenix 3005 switch needs at least the backspace tweak */
+		if (c == 0x08 || c == 0x7f) { /* ctrl+h || backspace */
+			*dst = IAC;
+			*++dst = EC;
+		}
+		if (c == 0x03) { /* ctrl+c */
+			*dst = IAC;
+			*++dst = IP;
+		}
+#endif
 		dst++;
 	}
 	if (dst - outbuf != 0)


More information about the busybox-cvs mailing list