Collect signals of child processes
Add logging if starting of a process was not successful
This commit is contained in:
20
tools.go
20
tools.go
@@ -583,7 +583,15 @@ func launch(command string, terminal bool) {
|
||||
Setsid: true,
|
||||
}
|
||||
|
||||
cmd.Start()
|
||||
if cmd.Start() != nil {
|
||||
log.Warn("Unable to launch terminal emulator!")
|
||||
} else {
|
||||
// Collect the exit code of the child process to prevent zombies
|
||||
// if the drawer runs in resident mode
|
||||
go func() {
|
||||
_ = cmd.Wait()
|
||||
}()
|
||||
}
|
||||
|
||||
if *resident {
|
||||
restoreStateAndHide()
|
||||
@@ -609,7 +617,15 @@ func open(filePath string, xdgOpen bool) {
|
||||
}
|
||||
log.Infof("Executing: %s", cmd)
|
||||
|
||||
cmd.Start()
|
||||
if cmd.Start() != nil {
|
||||
log.Warn("Unable to execute command!")
|
||||
} else {
|
||||
// Collect the exit code of the child process to prevent zombies
|
||||
// if the drawer runs in resident mode
|
||||
go func() {
|
||||
_ = cmd.Wait()
|
||||
}()
|
||||
}
|
||||
|
||||
if *resident {
|
||||
restoreStateAndHide()
|
||||
|
||||
Reference in New Issue
Block a user