mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-08-22 09:16:29 +00:00
Always use login shells
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user