mirror of https://github.com/buggins/dlangide.git
run a program with run-script, so terminal will not close immediately after execution
This commit is contained in:
parent
efce30b76e
commit
f8fe92aa77
|
@ -75,10 +75,22 @@ class ProgramExecutionNoDebug : Thread, ProgramExecution {
|
||||||
// external console support
|
// external console support
|
||||||
if (!_terminalExecutable.empty) {
|
if (!_terminalExecutable.empty) {
|
||||||
string cmdline = escapeShellCommand(params);
|
string cmdline = escapeShellCommand(params);
|
||||||
params.length = 0;
|
string shellScript = `
|
||||||
params ~= _terminalExecutable;
|
rm $0
|
||||||
params ~= "-e";
|
` ~ cmdline ~ `
|
||||||
params ~= cmdline;
|
exit_code=$?
|
||||||
|
echo "
|
||||||
|
-----------------------
|
||||||
|
(program returned exit code: $exit_code)"
|
||||||
|
echo "Press any key to continue..."
|
||||||
|
dummy_var=""
|
||||||
|
read dummy_var
|
||||||
|
exit $exit_code
|
||||||
|
`;
|
||||||
|
std.file.write(std.path.buildPath(_executableWorkingDir, "dlangide_run_script.sh"), shellScript);
|
||||||
|
string setExecFlagCommand = escapeShellCommand("chmod", "+x", "dlangide_run_script.sh");
|
||||||
|
spawnShell(setExecFlagCommand, stdin, stdout, stderr, null, Config.none, _executableWorkingDir);
|
||||||
|
params = [_terminalExecutable, "-e", "./dlangide_run_script.sh"];
|
||||||
}
|
}
|
||||||
|
|
||||||
File newstdin;
|
File newstdin;
|
||||||
|
|
Loading…
Reference in New Issue