This commit is contained in:
crschnick 2024-04-21 04:48:44 +00:00
parent 409b24ff8a
commit eb873f2225
2 changed files with 8 additions and 3 deletions

View file

@ -33,7 +33,8 @@ public class ScriptHelper {
WorkingDirectoryFunction workingDirectory,
List<String> 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);

View file

@ -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);
}