Add test to check if escapeKeys is empty
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
This commit is contained in:
parent
f1f25b8d14
commit
e1cfb29255
5
proxy.go
5
proxy.go
|
@ -13,7 +13,6 @@
|
||||||
// CHANGES:
|
// CHANGES:
|
||||||
// - update package
|
// - update package
|
||||||
|
|
||||||
|
|
||||||
package gottyclient
|
package gottyclient
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -50,6 +49,10 @@ func NewEscapeProxy(r io.Reader, escapeKeys []byte) io.Reader {
|
||||||
func (r *escapeProxy) Read(buf []byte) (int, error) {
|
func (r *escapeProxy) Read(buf []byte) (int, error) {
|
||||||
nr, err := r.r.Read(buf)
|
nr, err := r.r.Read(buf)
|
||||||
|
|
||||||
|
if len(r.escapeKeys) == 0 {
|
||||||
|
return nr, err
|
||||||
|
}
|
||||||
|
|
||||||
preserve := func() {
|
preserve := func() {
|
||||||
// this preserves the original key presses in the passed in buffer
|
// this preserves the original key presses in the passed in buffer
|
||||||
nr += r.escapeKeyPos
|
nr += r.escapeKeyPos
|
||||||
|
|
Loading…
Reference in New Issue