Term sourcery again
Some checks failed
Build, Test and Push Docker Image / e2e-test (push) Failing after 4s
Build, Test and Push Docker Image / build-and-push (push) Has been skipped

This commit is contained in:
2025-11-06 22:22:23 +01:00
parent 39e1c65bfe
commit 1604e117b3
2 changed files with 5 additions and 0 deletions

1
go.mod
View File

@@ -5,6 +5,7 @@ go 1.24.0
require ( require (
github.com/creack/pty/v2 v2.0.1 github.com/creack/pty/v2 v2.0.1
golang.org/x/crypto v0.43.0 golang.org/x/crypto v0.43.0
golang.org/x/term v0.37.0
) )
require golang.org/x/sys v0.37.0 // indirect require golang.org/x/sys v0.37.0 // indirect

View File

@@ -11,6 +11,7 @@ import (
"os" "os"
"os/exec" "os/exec"
"golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh"
"golang.org/x/term"
"github.com/creack/pty/v2" "github.com/creack/pty/v2"
) )
@@ -148,6 +149,9 @@ func handleChannel(channel ssh.Channel, requests <-chan *ssh.Request) {
log.Println("PTY start error:", err) log.Println("PTY start error:", err)
return return
} }
if err := term.MakeRaw(int(ptmx.Fd())); err != nil {
log.Println("MakeRaw master error:", err)
}
go func() { go func() {
defer ptmx.Close() defer ptmx.Close()
go io.Copy(channel, ptmx) go io.Copy(channel, ptmx)