Term sourcery again
This commit is contained in:
4
main.go
4
main.go
@@ -11,6 +11,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"golang.org/x/crypto/ssh"
|
||||
"golang.org/x/term"
|
||||
"github.com/creack/pty/v2"
|
||||
)
|
||||
|
||||
@@ -148,6 +149,9 @@ func handleChannel(channel ssh.Channel, requests <-chan *ssh.Request) {
|
||||
log.Println("PTY start error:", err)
|
||||
return
|
||||
}
|
||||
if err := term.MakeRaw(int(ptmx.Fd())); err != nil {
|
||||
log.Println("MakeRaw master error:", err)
|
||||
}
|
||||
go func() {
|
||||
defer ptmx.Close()
|
||||
go io.Copy(channel, ptmx)
|
||||
|
||||
Reference in New Issue
Block a user