mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Don't kill processes in RunAndProcessLines
As we just did for tasks, close their stdout pipe instead. This makes the called process terminate more gracefully. This isn't a change that we *need* to make, it's just a bit nicer.
This commit is contained in:
parent
8d7740a5ac
commit
83046a05d4
|
|
@ -171,16 +171,17 @@ func (self *cmdObjRunner) RunAndProcessLines(cmdObj *CmdObj, onLine func(line st
|
|||
line := scanner.Text()
|
||||
stop, err := onLine(line)
|
||||
if err != nil {
|
||||
stdoutPipe.Close()
|
||||
return err
|
||||
}
|
||||
if stop {
|
||||
_ = Kill(cmd)
|
||||
stdoutPipe.Close() // close the pipe so that the called process terminates
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if scanner.Err() != nil {
|
||||
_ = Kill(cmd)
|
||||
stdoutPipe.Close()
|
||||
return scanner.Err()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue