diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2019-10-18 16:47:37 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-10-18 16:47:37 +0200 |
| commit | 95867147f5cdf6650dbfc207c8dada86246f23ae (patch) | |
| tree | 4b65ff7b3395f4d271f9c7529588219be8db1afe | |
| parent | 37a9008f8e82b9469062f5a792a26f145012c617 (diff) | |
| download | busybox-w32-95867147f5cdf6650dbfc207c8dada86246f23ae.tar.gz busybox-w32-95867147f5cdf6650dbfc207c8dada86246f23ae.tar.bz2 busybox-w32-95867147f5cdf6650dbfc207c8dada86246f23ae.zip | |
telnet: add disabled code to emit EC and IP
> 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@googlemail.com>
| -rw-r--r-- | networking/telnet.c | 12 |
1 files changed, 12 insertions, 0 deletions
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) | |||
| 238 | *dst = '\r'; /* Enter -> CR LF */ | 238 | *dst = '\r'; /* Enter -> CR LF */ |
| 239 | *++dst = '\n'; | 239 | *++dst = '\n'; |
| 240 | } | 240 | } |
| 241 | #if 0 | ||
| 242 | /* putty's "special commands" mode does this: */ | ||
| 243 | /* Korenix 3005 switch needs at least the backspace tweak */ | ||
| 244 | if (c == 0x08 || c == 0x7f) { /* ctrl+h || backspace */ | ||
| 245 | *dst = IAC; | ||
| 246 | *++dst = EC; | ||
| 247 | } | ||
| 248 | if (c == 0x03) { /* ctrl+c */ | ||
| 249 | *dst = IAC; | ||
| 250 | *++dst = IP; | ||
| 251 | } | ||
| 252 | #endif | ||
| 241 | dst++; | 253 | dst++; |
| 242 | } | 254 | } |
| 243 | if (dst - outbuf != 0) | 255 | if (dst - outbuf != 0) |
