diff --git a/engine/lifecycle.go b/engine/lifecycle.go index eeb1a8f3..0b0d5484 100644 --- a/engine/lifecycle.go +++ b/engine/lifecycle.go @@ -237,6 +237,8 @@ func (e *QueryEngine) spawn(file string) error { e.cmd = exec.Command(file, "-p", port, "--enable-raw-queries") + e.cmd.SysProcAttr = getSysProcAttr() + e.cmd.Stdout = os.Stdout e.onEngineError = make(chan string) diff --git a/engine/lifecycle_unix.go b/engine/lifecycle_unix.go new file mode 100644 index 00000000..8bba499a --- /dev/null +++ b/engine/lifecycle_unix.go @@ -0,0 +1,11 @@ +//go:build !windows + +package engine + +import "syscall" + +func getSysProcAttr() *syscall.SysProcAttr { + return &syscall.SysProcAttr{ + Setpgid: true, + } +} diff --git a/engine/lifecycle_windows.go b/engine/lifecycle_windows.go new file mode 100644 index 00000000..a0edc544 --- /dev/null +++ b/engine/lifecycle_windows.go @@ -0,0 +1,7 @@ +package engine + +import "syscall" + +func getSysProcAttr() *syscall.SysProcAttr { + return &syscall.SysProcAttr{} +}