Skip to content

Commit

Permalink
fix: pty start (#38)
Browse files Browse the repository at this point in the history
The default method will give control to the PTY, which I think is what
was causing some commands to hang.
  • Loading branch information
caarlos0 committed Mar 26, 2024
1 parent d4b1c86 commit e802314
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pty.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"os"
"os/exec"
"syscall"

"github.com/creack/pty"
)
Expand All @@ -11,9 +12,9 @@ import (
// The returned file is the pty's file descriptor and must be closed by the
// caller.
func (cfg Config) runInPty(c *exec.Cmd) (*os.File, error) {
return pty.StartWithSize(c, &pty.Winsize{
return pty.StartWithAttrs(c, &pty.Winsize{
Cols: 80,
Rows: 10,
X: uint16(cfg.Width),
})
}, &syscall.SysProcAttr{})
}

0 comments on commit e802314

Please sign in to comment.