From 80ba91f1a8f846c3a7a3f88db1dca0d1f6ce35a3 Mon Sep 17 00:00:00 2001 From: Jim-wiselike Date: Sat, 21 Jul 2018 17:22:17 +0800 Subject: [PATCH] Support / Keyboard keys for PuTTY When my SSH and telnet client is PuTTY, the readline-demo can't parse / Keyboard keys!!! It seems that "readline" can't adapt to old shells very well. --- utils.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils.go b/utils.go index af4e005..4bdee9e 100644 --- a/utils.go +++ b/utils.go @@ -113,8 +113,13 @@ func escapeExKey(key *escapeKeyPair) rune { case 'F': r = CharLineEnd case '~': - if key.attr == "3" { + switch key.attr { + case "1": + r = CharLineStart + case "3": r = CharDelete + case "4": + r = CharLineEnd } default: }