Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add no_pty conifg option to fix #533 #544

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions runner/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ type cfgMisc struct {
type cfgScreen struct {
ClearOnRebuild bool `toml:"clear_on_rebuild"`
KeepScroll bool `toml:"keep_scroll"`
NoPTY bool `toml:"no_pty"`
}

type sliceTransformer struct{}
Expand Down
18 changes: 18 additions & 0 deletions runner/util_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@ func (e *Engine) killCmd(cmd *exec.Cmd) (pid int, err error) {

func (e *Engine) startCmd(cmd string) (*exec.Cmd, io.ReadCloser, io.ReadCloser, error) {
c := exec.Command("/bin/sh", "-c", cmd)
if e.config.Screen.NoPTY {
c.SysProcAttr = &syscall.SysProcAttr{
Setpgid: true,
}
stderr, err := c.StderrPipe()
if err != nil {
return nil, nil, nil, err
}
stdout, err := c.StdoutPipe()
if err != nil {
return nil, nil, nil, err
}
err = c.Start()
if err != nil {
return nil, nil, nil, err
}
return c, stdout, stderr, err
}
f, err := pty.Start(c)
return c, f, f, err
}