mirror of
https://github.com/patriceckhart/zot.git
synced 2026-06-28 14:23:41 +02:00
Sets Setpgid on bash commands and sends SIGTERM/SIGKILL to the negative pgid so backgrounded children are cleaned up on esc. Also splits the status bar onto multiple lines on narrow terminals when a spinner is active.
20 lines
275 B
Go
20 lines
275 B
Go
//go:build windows
|
|
|
|
package tools
|
|
|
|
import (
|
|
"os/exec"
|
|
"time"
|
|
)
|
|
|
|
func setProcessGroup(_ *exec.Cmd) {}
|
|
|
|
func killProcessGroup(cmd *exec.Cmd) {
|
|
if cmd.Process == nil {
|
|
return
|
|
}
|
|
_ = cmd.Process.Kill()
|
|
time.AfterFunc(3*time.Second, func() {
|
|
_ = cmd.Process.Kill()
|
|
})
|
|
}
|