Remove unnecessary launch flags

This allows users on non-linux but unix-based systems to install ports of the `setsid` command that might not be feature complete.
This commit is contained in:
ME1312 2021-04-09 17:12:36 -04:00
parent 18953046b8
commit 0ac4238dc8
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
2 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,7 @@ public class Executable {
exec.replace("\\", "/\\").replace("\"", "\\\"").replace("^", "^^").replace("%", "^%").replace("&", "^&").replace("<", "^<").replace(">", "^>").replace("|", "^|") + '"';
cmd = new String[]{"cmd.exe", "/q", "/c", '"'+exec+'"'};
} else if (USE_SESSION_TRACKING) {
cmd = new String[]{"setsid", "-w", "sh", "-lc", exec};
cmd = new String[]{"setsid", "sh", "-lc", exec};
} else {
cmd = new String[]{"sh", "-lc", exec};
}
@ -41,7 +41,7 @@ public class Executable {
static {
USE_SESSION_TRACKING = Platform.getSystem() != Platform.WINDOWS && Util.getDespiteException(() -> {
Process test = Runtime.getRuntime().exec(new String[]{"setsid", "-w", "bash", "-c", "exit 0"});
Process test = Runtime.getRuntime().exec(new String[]{"setsid", "bash", "-c", "exit 0"});
test.waitFor(); // The purpose of this block is to test for the 'setsid' command
return test.exitValue() == 0;
}, false);

View File

@ -32,7 +32,7 @@ public class Executable {
exec.replace("\\", "/\\").replace("\"", "\\\"").replace("^", "^^").replace("%", "^%").replace("&", "^&").replace("<", "^<").replace(">", "^>").replace("|", "^|") + '"';
cmd = new String[]{"cmd.exe", "/q", "/c", '"'+exec+'"'};
} else if (USE_SESSION_TRACKING) {
cmd = new String[]{"setsid", "-w", "sh", "-lc", exec};
cmd = new String[]{"setsid", "sh", "-lc", exec};
} else {
cmd = new String[]{"sh", "-lc", exec};
}
@ -41,7 +41,7 @@ public class Executable {
static {
USE_SESSION_TRACKING = Platform.getSystem() != Platform.WINDOWS && Util.getDespiteException(() -> {
Process test = Runtime.getRuntime().exec(new String[]{"setsid", "-w", "bash", "-c", "exit 0"});
Process test = Runtime.getRuntime().exec(new String[]{"setsid", "bash", "-c", "exit 0"});
test.waitFor(); // The purpose of this block is to test for the 'setsid' command
return test.exitValue() == 0;
}, false);