stuck task issue

This commit is contained in:
Ian Gulliver
2026-10-18 22:33:47 -07:00
parent c85266afd7
commit 131dfbecdc
4 changed files with 13 additions and 8 deletions
+3 -2
View File
@@ -334,6 +334,7 @@ func (s *Session) spawnLocked() error {
"GIT_COMMITTER_EMAIL="+s.opts.GitEmail,
)
cmd.Env = append(cmd.Env, s.opts.Env...)
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
stdin, err := cmd.StdinPipe()
if err != nil {
@@ -428,7 +429,7 @@ func (s *Session) restartLocked() error {
select {
case <-p.done:
case <-time.After(10 * time.Second):
p.cmd.Process.Kill()
syscall.Kill(-p.cmd.Process.Pid, syscall.SIGKILL)
<-p.done
}
return s.spawnLocked()
@@ -567,7 +568,7 @@ func (s *Session) Kill() {
s.mu.Unlock()
if p != nil {
p.cmd.Process.Kill()
syscall.Kill(-p.cmd.Process.Pid, syscall.SIGKILL)
<-p.done
}
s.die()