cli bug fix

This commit is contained in:
兔子 2020-07-27 14:19:05 +08:00
parent a94fc8d19d
commit 5c2cce2da2
2 changed files with 3 additions and 2 deletions

View File

@ -45,6 +45,7 @@ func Command(command string, args ...string) (*StarCmd, error) {
shell.stdoutBuf = bytes.NewBuffer(make([]byte, 0))
shell.stderrBuf = bytes.NewBuffer(make([]byte, 0))
shell.runningChan = make(chan int, 3)
shell.stopctx, shell.stopctxfunc = context.WithCancel(context.Background())
cmd := exec.Command(command, args...)
shell.CMD = cmd
shell.infile, err = shell.CMD.StdinPipe()

View File

@ -162,10 +162,10 @@ func (starcli *StarCmd) Release() error {
if err := starcli.CMD.Start(); err != nil {
return err
}
starcli.cmd.SysProcAttr = &syscall.SysProcAttr{
starcli.CMD.SysProcAttr = &syscall.SysProcAttr{
Setsid: true,
}
starcli.cmd.Process.Release()
starcli.CMD.Process.Release()
return nil
}