From 1604e117b3f60f10ba8b511494d1f5b77e702b3b Mon Sep 17 00:00:00 2001 From: dcorral Date: Thu, 6 Nov 2025 22:22:23 +0100 Subject: [PATCH] Term sourcery again --- go.mod | 1 + main.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/go.mod b/go.mod index cfc57b5..a2d8f61 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.24.0 require ( github.com/creack/pty/v2 v2.0.1 golang.org/x/crypto v0.43.0 + golang.org/x/term v0.37.0 ) require golang.org/x/sys v0.37.0 // indirect diff --git a/main.go b/main.go index 1977287..b8ce344 100644 --- a/main.go +++ b/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)