mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Fix multi executes
This commit is contained in:
parent
b350222769
commit
9248c38c8f
4 changed files with 7 additions and 7 deletions
|
@ -281,10 +281,10 @@ public final class BrowserFileSystemTabModel extends BrowserStoreSessionTab<File
|
|||
.get()
|
||||
.singularSubShell(
|
||||
ShellOpenFunction.of(CommandBuilder.ofString(adjustedPath), false));
|
||||
openTerminalAsync(name,directory,cc);
|
||||
openTerminalAsync(name,directory,cc, true);
|
||||
} else {
|
||||
var cc = fileSystem.getShell().get().command(adjustedPath);
|
||||
openTerminalAsync(name,directory,cc);
|
||||
openTerminalAsync(name,directory,cc, true);
|
||||
}
|
||||
});
|
||||
return Optional.ofNullable(currentPath.get());
|
||||
|
@ -539,7 +539,7 @@ public final class BrowserFileSystemTabModel extends BrowserStoreSessionTab<File
|
|||
history.updateCurrent(null);
|
||||
}
|
||||
|
||||
public void openTerminalAsync(String name, String directory, ProcessControl processControl) {
|
||||
public void openTerminalAsync(String name, String directory, ProcessControl processControl, boolean dockIfPossible) {
|
||||
ThreadHelper.runFailableAsync(() -> {
|
||||
if (fileSystem == null) {
|
||||
return;
|
||||
|
@ -547,7 +547,7 @@ public final class BrowserFileSystemTabModel extends BrowserStoreSessionTab<File
|
|||
|
||||
BooleanScope.executeExclusive(busy, () -> {
|
||||
if (fileSystem.getShell().isPresent()) {
|
||||
var dock = shouldLaunchSplitTerminal();
|
||||
var dock = shouldLaunchSplitTerminal() && dockIfPossible;
|
||||
var uuid = UUID.randomUUID();
|
||||
terminalRequests.add(uuid);
|
||||
if (dock && browserModel instanceof BrowserFullSessionModel fullSessionModel &&
|
||||
|
|
|
@ -39,7 +39,7 @@ public abstract class MultiExecuteAction implements BrowserBranchAction {
|
|||
model.openTerminalAsync(entry.getRawFileEntry().getName(), model.getCurrentDirectory() != null
|
||||
? model.getCurrentDirectory()
|
||||
.getPath()
|
||||
: null, cmd);
|
||||
: null, cmd, entries.size() == 1);
|
||||
}
|
||||
},
|
||||
false);
|
||||
|
|
|
@ -43,7 +43,7 @@ public abstract class MultiExecuteSelectionAction implements BrowserBranchAction
|
|||
model.openTerminalAsync(getTerminalTitle(), model.getCurrentDirectory() != null
|
||||
? model.getCurrentDirectory()
|
||||
.getPath()
|
||||
: null, cmd);
|
||||
: null, cmd, true);
|
||||
},
|
||||
false);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public class OpenTerminalAction implements BrowserLeafAction {
|
|||
: Collections.singletonList((String) null);
|
||||
for (String dir : dirs) {
|
||||
var name = (dir != null ? dir + " - " : "") + model.getName();
|
||||
model.openTerminalAsync(name, dir, model.getFileSystem().getShell().orElseThrow());
|
||||
model.openTerminalAsync(name, dir, model.getFileSystem().getShell().orElseThrow(), dirs.size() == 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue