mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Always use login shells
This commit is contained in:
parent
4daa183dad
commit
09a419f628
2 changed files with 3 additions and 11 deletions
|
@ -149,6 +149,7 @@ public final class OpenFileSystemModel {
|
|||
// Handle commands typed into navigation bar
|
||||
if (allowCommands
|
||||
&& evaluatedPath != null
|
||||
&& !evaluatedPath.isBlank()
|
||||
&& !FileNames.isAbsolute(evaluatedPath)
|
||||
&& fileSystem.getShell().isPresent()) {
|
||||
var directory = currentPath.get();
|
||||
|
|
|
@ -172,7 +172,7 @@ public interface ShellControl extends ProcessControl {
|
|||
FailableSupplier<SecretValue> getElevationPassword();
|
||||
|
||||
default ShellControl subShell(@NonNull ShellDialect type) {
|
||||
return subShell(p -> type.getOpenCommand(), (sc) -> type.getLoginOpenCommand())
|
||||
return subShell(p -> type.getLoginOpenCommand(), (sc) -> type.getLoginOpenCommand())
|
||||
.elevationPassword(getElevationPassword());
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,7 @@ public interface ShellControl extends ProcessControl {
|
|||
}
|
||||
|
||||
default ShellControl identicalSubShell() {
|
||||
return subShell(p -> p.getShellDialect().getOpenCommand(), (sc) -> sc.getShellDialect().getOpenCommand())
|
||||
return subShell(p -> p.getShellDialect().getLoginOpenCommand(), (sc) -> sc.getShellDialect().getLoginOpenCommand())
|
||||
.elevationPassword(getElevationPassword());
|
||||
}
|
||||
|
||||
|
@ -194,15 +194,6 @@ public interface ShellControl extends ProcessControl {
|
|||
return subShell(processControl -> command, (sc) -> command);
|
||||
}
|
||||
|
||||
default ShellControl enforcedDialect(ShellDialect type) throws Exception {
|
||||
start();
|
||||
if (getShellDialect().equals(type)) {
|
||||
return this;
|
||||
} else {
|
||||
return subShell(type).start();
|
||||
}
|
||||
}
|
||||
|
||||
default <T> T enforceDialect(@NonNull ShellDialect type, FailableFunction<ShellControl, T, Exception> sc) throws Exception {
|
||||
if (isRunning() && getShellDialect().equals(type)) {
|
||||
return sc.apply(this);
|
||||
|
|
Loading…
Reference in a new issue