From 891e5e0d1b8ae2d137a3d1055c47670782e3bf40 Mon Sep 17 00:00:00 2001 From: dcorral Date: Thu, 6 Nov 2025 21:48:48 +0100 Subject: [PATCH] Init PTY after size set --- main.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.go b/main.go index d4a2922..b251be0 100644 --- a/main.go +++ b/main.go @@ -133,12 +133,11 @@ func handleChannel(channel ssh.Channel, requests <-chan *ssh.Request) { cmd.Env = []string{"PATH=/bin", "TERM=xterm"} cmd.Dir = "/" var err error - ptmx, err = pty.Start(cmd) + ptmx, err = pty.StartWithSize(cmd, &pty.Winsize{Cols: uint16(termWidth), Rows: uint16(termHeight)}) if err != nil { log.Println("PTY start error:", err) return } - pty.Setsize(ptmx, &pty.Winsize{Cols: uint16(termWidth), Rows: uint16(termHeight)}) go func() { defer ptmx.Close() go io.Copy(channel, ptmx)