mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-07-06 20:04:04 +00:00
Update vendor shazow/ssh-chat (#1029)
This commit is contained in:
19
vendor/github.com/shazow/ssh-chat/sshd/terminal/terminal.go
generated
vendored
19
vendor/github.com/shazow/ssh-chat/sshd/terminal/terminal.go
generated
vendored
@ -129,6 +129,8 @@ const (
|
||||
keyRight
|
||||
keyAltLeft
|
||||
keyAltRight
|
||||
keyAltF
|
||||
keyAltB
|
||||
keyHome
|
||||
keyEnd
|
||||
keyDeleteWord
|
||||
@ -155,8 +157,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
|
||||
@ -206,6 +212,15 @@ func bytesToKey(b []byte, pasteActive bool) (rune, []byte) {
|
||||
}
|
||||
}
|
||||
|
||||
if !pasteActive && len(b) >= 2 && b[0] == keyEscape {
|
||||
switch b[1] {
|
||||
case 'f':
|
||||
return keyAltF, b[2:]
|
||||
case 'b':
|
||||
return keyAltB, b[2:]
|
||||
}
|
||||
}
|
||||
|
||||
if !pasteActive && len(b) >= 6 && bytes.Equal(b[:6], pasteStart) {
|
||||
return keyPasteStart, b[6:]
|
||||
}
|
||||
@ -467,10 +482,14 @@ func (t *Terminal) handleKey(key rune) (line string, ok bool) {
|
||||
return
|
||||
}
|
||||
t.eraseNPreviousChars(1)
|
||||
case keyAltB:
|
||||
fallthrough
|
||||
case keyAltLeft:
|
||||
// move left by a word.
|
||||
t.pos -= t.countToLeftWord()
|
||||
t.moveCursorToPos(t.pos)
|
||||
case keyAltF:
|
||||
fallthrough
|
||||
case keyAltRight:
|
||||
// move right by a word.
|
||||
t.pos += t.countToRightWord()
|
||||
|
2
vendor/github.com/shazow/ssh-chat/sshd/terminal/util.go
generated
vendored
2
vendor/github.com/shazow/ssh-chat/sshd/terminal/util.go
generated
vendored
@ -14,7 +14,7 @@
|
||||
// panic(err)
|
||||
// }
|
||||
// defer terminal.Restore(0, oldState)
|
||||
package terminal // import "golang.org/x/crypto/ssh/terminal"
|
||||
package terminal
|
||||
|
||||
import (
|
||||
"golang.org/x/sys/unix"
|
||||
|
5
vendor/github.com/shazow/ssh-chat/sshd/terminal/util_solaris.go
generated
vendored
5
vendor/github.com/shazow/ssh-chat/sshd/terminal/util_solaris.go
generated
vendored
@ -4,12 +4,13 @@
|
||||
|
||||
// +build solaris
|
||||
|
||||
package terminal // import "golang.org/x/crypto/ssh/terminal"
|
||||
package terminal
|
||||
|
||||
import (
|
||||
"golang.org/x/sys/unix"
|
||||
"io"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// State contains the state of a terminal.
|
||||
|
Reference in New Issue
Block a user