mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +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()
|
.get()
|
||||||
.singularSubShell(
|
.singularSubShell(
|
||||||
ShellOpenFunction.of(CommandBuilder.ofString(adjustedPath), false));
|
ShellOpenFunction.of(CommandBuilder.ofString(adjustedPath), false));
|
||||||
openTerminalAsync(name,directory,cc);
|
openTerminalAsync(name,directory,cc, true);
|
||||||
} else {
|
} else {
|
||||||
var cc = fileSystem.getShell().get().command(adjustedPath);
|
var cc = fileSystem.getShell().get().command(adjustedPath);
|
||||||
openTerminalAsync(name,directory,cc);
|
openTerminalAsync(name,directory,cc, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return Optional.ofNullable(currentPath.get());
|
return Optional.ofNullable(currentPath.get());
|
||||||
|
@ -539,7 +539,7 @@ public final class BrowserFileSystemTabModel extends BrowserStoreSessionTab<File
|
||||||
history.updateCurrent(null);
|
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(() -> {
|
ThreadHelper.runFailableAsync(() -> {
|
||||||
if (fileSystem == null) {
|
if (fileSystem == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -547,7 +547,7 @@ public final class BrowserFileSystemTabModel extends BrowserStoreSessionTab<File
|
||||||
|
|
||||||
BooleanScope.executeExclusive(busy, () -> {
|
BooleanScope.executeExclusive(busy, () -> {
|
||||||
if (fileSystem.getShell().isPresent()) {
|
if (fileSystem.getShell().isPresent()) {
|
||||||
var dock = shouldLaunchSplitTerminal();
|
var dock = shouldLaunchSplitTerminal() && dockIfPossible;
|
||||||
var uuid = UUID.randomUUID();
|
var uuid = UUID.randomUUID();
|
||||||
terminalRequests.add(uuid);
|
terminalRequests.add(uuid);
|
||||||
if (dock && browserModel instanceof BrowserFullSessionModel fullSessionModel &&
|
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.openTerminalAsync(entry.getRawFileEntry().getName(), model.getCurrentDirectory() != null
|
||||||
? model.getCurrentDirectory()
|
? model.getCurrentDirectory()
|
||||||
.getPath()
|
.getPath()
|
||||||
: null, cmd);
|
: null, cmd, entries.size() == 1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
false);
|
false);
|
||||||
|
|
|
@ -43,7 +43,7 @@ public abstract class MultiExecuteSelectionAction implements BrowserBranchAction
|
||||||
model.openTerminalAsync(getTerminalTitle(), model.getCurrentDirectory() != null
|
model.openTerminalAsync(getTerminalTitle(), model.getCurrentDirectory() != null
|
||||||
? model.getCurrentDirectory()
|
? model.getCurrentDirectory()
|
||||||
.getPath()
|
.getPath()
|
||||||
: null, cmd);
|
: null, cmd, true);
|
||||||
},
|
},
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class OpenTerminalAction implements BrowserLeafAction {
|
||||||
: Collections.singletonList((String) null);
|
: Collections.singletonList((String) null);
|
||||||
for (String dir : dirs) {
|
for (String dir : dirs) {
|
||||||
var name = (dir != null ? dir + " - " : "") + model.getName();
|
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