summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/crypto/ssh/terminal
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-07-18 17:27:41 +0200
committerGitHub <noreply@github.com>2020-07-18 17:27:41 +0200
commit23d8742f0d95096b92f11729fb47f86ac3b68d43 (patch)
tree7b8acb02b051ae06e5454fda4a9d5118428fe016 /vendor/golang.org/x/crypto/ssh/terminal
parent3b6a8be07b9422714db30fb50977f342057febf3 (diff)
downloadmatterbridge-msglm-23d8742f0d95096b92f11729fb47f86ac3b68d43.tar.gz
matterbridge-msglm-23d8742f0d95096b92f11729fb47f86ac3b68d43.tar.bz2
matterbridge-msglm-23d8742f0d95096b92f11729fb47f86ac3b68d43.zip
Update dependencies for 1.18.0 release (#1175)
Diffstat (limited to 'vendor/golang.org/x/crypto/ssh/terminal')
-rw-r--r--vendor/golang.org/x/crypto/ssh/terminal/terminal.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go b/vendor/golang.org/x/crypto/ssh/terminal/terminal.go
index d1b4fca3..2ffb97bf 100644
--- a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go
+++ b/vendor/golang.org/x/crypto/ssh/terminal/terminal.go
@@ -113,6 +113,7 @@ func NewTerminal(c io.ReadWriter, prompt string) *Terminal {
}
const (
+ keyCtrlC = 3
keyCtrlD = 4
keyCtrlU = 21
keyEnter = '\r'
@@ -151,8 +152,12 @@ func bytesToKey(b []byte, pasteActive bool) (rune, []byte) {
switch b[0] {
case 1: // ^A
return keyHome, b[1:]
+ case 2: // ^B
+ return keyLeft, b[1:]
case 5: // ^E
return keyEnd, b[1:]
+ case 6: // ^F
+ return keyRight, b[1:]
case 8: // ^H
return keyBackspace, b[1:]
case 11: // ^K
@@ -738,6 +743,9 @@ func (t *Terminal) readLine() (line string, err error) {
return "", io.EOF
}
}
+ if key == keyCtrlC {
+ return "", io.EOF
+ }
if key == keyPasteStart {
t.pasteActive = true
if len(t.line) == 0 {