Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Commit

Permalink
Migrate from "github.com/kr/pty" to "github.com/creack/pty"
Browse files Browse the repository at this point in the history
Fixes "Setctty set but Ctty not valid in child with Go" error
with Go 1.15 and up.  See creack/pty#96
  • Loading branch information
anthonyfok committed Oct 30, 2020
1 parent a54f389 commit fba5c81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ See `gexpect_test.go` and the `examples` folder for full syntax

## Credits

github.com/creack/pty
github.com/kballard/go-shellquote
github.com/kr/pty
KMP Algorithm: "http://blog.databigbang.com/searching-for-substrings-in-streams-a-slight-modification-of-the-knuth-morris-pratt-algorithm-in-haxe/"
4 changes: 2 additions & 2 deletions gexpect.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"time"
"unicode/utf8"

"github.com/creack/pty"
shell "github.com/kballard/go-shellquote"
"github.com/kr/pty"
)

var (
Expand Down Expand Up @@ -387,7 +387,7 @@ func (expect *ExpectSubprocess) ReadUntil(delim byte) ([]byte, error) {
for i := 0; i < n; i++ {
if chunk[i] == delim {
if len(chunk) > i+1 {
expect.buf.PutBack(chunk[i+1:n])
expect.buf.PutBack(chunk[i+1 : n])
}
return join, nil
} else {
Expand Down

0 comments on commit fba5c81

Please sign in to comment.