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, WorkingDirectoryFunction workingDirectory,
List<String> init, List<String> init,
String toExecuteInShell, String toExecuteInShell,
TerminalInitScriptConfig config) TerminalInitScriptConfig config,
boolean exit)
throws Exception { throws Exception {
String nl = t.getNewLine().getNewLineString(); String nl = t.getNewLine().getNewLineString();
var content = ""; var content = "";
@ -71,7 +72,10 @@ public class ScriptHelper {
if (toExecuteInShell != null) { if (toExecuteInShell != null) {
// Normalize line endings // Normalize line endings
content += String.join(nl, toExecuteInShell.lines().toList()) + nl; 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); return createExecScript(t, processControl, new FilePath(t.initFileName(processControl)), content);

View file

@ -32,7 +32,8 @@ public class TerminalLauncher {
title, title,
type.shouldClear() type.shouldClear()
&& AppPrefs.get().clearTerminalOnInit().get(), && AppPrefs.get().clearTerminalOnInit().get(),
null)); null),
true);
var config = new ExternalTerminalType.LaunchConfiguration(null, title, title, script, sc.getShellDialect()); var config = new ExternalTerminalType.LaunchConfiguration(null, title, title, script, sc.getShellDialect());
type.launch(config); type.launch(config);
} }