nchan: delayed command execution

This prevents an empty popup window in certain browsers and devices
This commit is contained in:
bergware
2022-10-01 01:29:07 +02:00
parent 6e69c88cad
commit 2339b5c7eb

View File

@@ -39,7 +39,7 @@ if ($command && strncmp($name,$path,strlen($path))===0) {
$pid = pgrep($name);
} elseif ($start or !pgrep($name)) {
// start command in background and return pid
$pid = exec("nohup $name $args 1>/dev/null 2>&1 & echo \$!");
$pid = exec("nohup bash -c 'sleep .3 && $name $args' 1>/dev/null 2>&1 & echo \$!");
}
}
echo $pid;