mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:50:43 +00:00
26 lines
489 B
Go
26 lines
489 B
Go
//go:build !windows
|
|
|
|
package main
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
"os/exec"
|
|
"syscall"
|
|
)
|
|
|
|
func configureCodexPromptCommand(command *exec.Cmd) {
|
|
command.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
|
command.Cancel = func() error {
|
|
if command.Process == nil {
|
|
return os.ErrProcessDone
|
|
}
|
|
err := syscall.Kill(-command.Process.Pid, syscall.SIGKILL)
|
|
if errors.Is(err, syscall.ESRCH) {
|
|
return os.ErrProcessDone
|
|
}
|
|
return err
|
|
}
|
|
command.WaitDelay = docsI18nCommandWaitDelay()
|
|
}
|