Skip to content

Commit 3276c8f

Browse files
author
Grzegorz Marszalek
committed
add no_pty conifg option to fix air-verse#533
1 parent 70c53bd commit 3276c8f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

runner/config.go

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ type cfgMisc struct {
9494
type cfgScreen struct {
9595
ClearOnRebuild bool `toml:"clear_on_rebuild"`
9696
KeepScroll bool `toml:"keep_scroll"`
97+
NoPTY bool `toml:"no_pty"`
9798
}
9899

99100
type sliceTransformer struct{}

runner/util_linux.go

+15
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ func (e *Engine) killCmd(cmd *exec.Cmd) (pid int, err error) {
3030

3131
func (e *Engine) startCmd(cmd string) (*exec.Cmd, io.ReadCloser, io.ReadCloser, error) {
3232
c := exec.Command("/bin/sh", "-c", cmd)
33+
if e.config.Screen.NoPTY {
34+
stderr, err := c.StderrPipe()
35+
if err != nil {
36+
return nil, nil, nil, err
37+
}
38+
stdout, err := c.StdoutPipe()
39+
if err != nil {
40+
return nil, nil, nil, err
41+
}
42+
err = c.Start()
43+
if err != nil {
44+
return nil, nil, nil, err
45+
}
46+
return c, stdout, stderr, err
47+
}
3348
f, err := pty.Start(c)
3449
return c, f, f, err
3550
}

0 commit comments

Comments
 (0)