Script order fixes [release]

This commit is contained in:
crschnick 2023-11-24 09:11:23 +00:00
parent 88c5c1c7ac
commit dbec0b8fd7
4 changed files with 6 additions and 5 deletions

View file

@ -40,6 +40,7 @@ public final class OpenFileSystemModel {
private final String name;
private final String tooltip;
private boolean local;
private int customScriptsStartIndex;
public OpenFileSystemModel(BrowserModel browserModel, DataStoreEntryRef<? extends FileSystemStore> entry) {
this.browserModel = browserModel;
@ -364,6 +365,7 @@ public final class OpenFileSystemModel {
BooleanScope.execute(busy, () -> {
var fs = entry.getStore().createFileSystem();
if (fs.getShell().isPresent()) {
this.customScriptsStartIndex = fs.getShell().get().getInitCommands().size();
ProcessControlProvider.get().withDefaultScripts(fs.getShell().get());
}
fs.open();
@ -400,7 +402,7 @@ public final class OpenFileSystemModel {
var snippet = directory != null ? new SimpleScriptSnippet(connection.getShellDialect().getCdCommand(directory),
ScriptSnippet.ExecutionType.BOTH) : null;
if (snippet != null) {
connection.withInitSnippet(snippet);
connection.getInitCommands().add(customScriptsStartIndex,snippet);
}
try {
@ -410,7 +412,7 @@ public final class OpenFileSystemModel {
// Restart connection as we will have to start it anyway, so we speed it up by doing it preemptively
connection.start();
} finally {
connection.removeInitSnippet(snippet);
connection.getInitCommands().remove(snippet);
}
}
});

View file

@ -157,8 +157,6 @@ public interface ShellControl extends ProcessControl {
ShellControl withInitSnippet(ScriptSnippet snippet);
ShellControl removeInitSnippet(ScriptSnippet snippet);
ShellControl additionalTimeout(int ms);
FailableSupplier<SecretValue> getElevationPassword();

View file

@ -6,6 +6,7 @@
- More startup performance improvements
- Fix dialog window order sometimes being wrong and shown behind main window
- Fix macOS Terminal.app sometimes not launching connection due to a race condition
- Many other small miscellaneous fixes and improvements
## Previous changes in 1.7

View file

@ -1 +1 @@
1.7.7
1.7.8