Init file sourcing changes

This commit is contained in:
crschnick 2024-04-23 16:57:11 +00:00
parent 24600a98be
commit 627a8141cd
2 changed files with 4 additions and 13 deletions

View file

@ -48,16 +48,11 @@ public class ScriptHelper {
// Normalize line endings
content += nl + preInit.stream().flatMap(s -> s.lines()).collect(Collectors.joining(nl)) + nl;
var applyRcCommand = t.applyRcFileCommand();
if (applyRcCommand != null) {
content += nl + applyRcCommand + nl;
}
// We just apply the profile files always, as we can't be sure that they definitely have been applied.
// Especially if we launch something that is not the system default shell
var applyProfilesCommand = t.applyProfileFilesCommand();
if (applyProfilesCommand != null) {
content += nl + applyProfilesCommand + nl;
var applyCommand = t.applyInitFileCommand();
if (applyCommand != null) {
content += nl + applyCommand + nl;
}
if (config.getDisplayName() != null) {

View file

@ -62,16 +62,12 @@ public interface ShellDialect {
String addToPathVariableCommand(List<String> entries, boolean append);
default String applyRcFileCommand() {
default String applyInitFileCommand() {
return null;
}
String changeTitleCommand(String newTitle);
default String applyProfileFilesCommand() {
return null;
}
CommandControl createStreamFileWriteCommand(ShellControl shellControl, String file, long totalBytes);
default String getCdCommand(String directory) {