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)