open reap children

This commit is contained in:
Midov
2020-10-02 17:22:00 +02:00
parent 180ecc36cc
commit 22b982d963
3 changed files with 11 additions and 1 deletions

View File

@ -20,8 +20,16 @@ package open
import (
"os/exec"
"maunium.net/go/gomuks/debug"
)
func Open(input string) error {
return exec.Command("xdg-open", input).Start()
cmd := exec.Command("xdg-open", input)
err := cmd.Start()
if err != nil {
debug.Print("xdg-open error:", err)
} else {
go cmd.Wait()
}
return err
}