diff --git a/app/src/main/java/io/xpipe/app/util/ScriptHelper.java b/app/src/main/java/io/xpipe/app/util/ScriptHelper.java index 8ceab5852..6dbe1bc2f 100644 --- a/app/src/main/java/io/xpipe/app/util/ScriptHelper.java +++ b/app/src/main/java/io/xpipe/app/util/ScriptHelper.java @@ -33,7 +33,8 @@ public class ScriptHelper { WorkingDirectoryFunction workingDirectory, List init, String toExecuteInShell, - TerminalInitScriptConfig config) + TerminalInitScriptConfig config, + boolean exit) throws Exception { String nl = t.getNewLine().getNewLineString(); var content = ""; @@ -71,7 +72,10 @@ public class ScriptHelper { if (toExecuteInShell != null) { // Normalize line endings content += String.join(nl, toExecuteInShell.lines().toList()) + nl; - content += nl + t.getPassthroughExitCommand() + nl; + } + + if (exit) { + content += nl + t.getPassthroughExitCommand(); } return createExecScript(t, processControl, new FilePath(t.initFileName(processControl)), content); diff --git a/app/src/main/java/io/xpipe/app/util/TerminalLauncher.java b/app/src/main/java/io/xpipe/app/util/TerminalLauncher.java index 47ea33bf3..28ff57e91 100644 --- a/app/src/main/java/io/xpipe/app/util/TerminalLauncher.java +++ b/app/src/main/java/io/xpipe/app/util/TerminalLauncher.java @@ -32,7 +32,8 @@ public class TerminalLauncher { title, type.shouldClear() && AppPrefs.get().clearTerminalOnInit().get(), - null)); + null), + true); var config = new ExternalTerminalType.LaunchConfiguration(null, title, title, script, sc.getShellDialect()); type.launch(config); }