Rework working directory handling

This commit is contained in:
crschnick 2024-03-23 06:31:41 +00:00
parent 346855826e
commit ea7114178f
3 changed files with 3 additions and 5 deletions

View file

@ -45,7 +45,6 @@ public final class OpenFileSystemModel {
private FileSystem fileSystem;
private OpenFileSystemSavedState savedState;
private OpenFileSystemCache cache;
private int customScriptsStartIndex;
public OpenFileSystemModel(BrowserModel browserModel, DataStoreEntryRef<? extends FileSystemStore> entry) {
this.browserModel = browserModel;
@ -391,10 +390,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.getShell().get().onKill(() -> {
browserModel.closeFileSystemAsync(this);
});

View file

@ -17,7 +17,7 @@ public class LaunchExchangeImpl extends LaunchExchange
var store = getStoreEntryById(msg.getId(), false);
if (store.getStore() instanceof LaunchableStore s) {
var command = s.prepareLaunchCommand()
.prepareTerminalOpen(TerminalInitScriptConfig.ofName(store.getName()), null);
.prepareTerminalOpen(TerminalInitScriptConfig.ofName(store.getName()), sc -> null);
return Response.builder().command(split(command)).build();
}

View file

@ -22,6 +22,8 @@ public interface ShellControl extends ProcessControl {
List<UUID> getExitUuids();
void setWorkingDirectory(FailableFunction<ShellControl, String, Exception> workingDirectory);
Optional<ShellStore> getSourceStore();
ShellControl withSourceStore(ShellStore store);