Always use login shells

This commit is contained in:
crschnick 2023-12-19 15:29:56 +00:00
parent 4daa183dad
commit 09a419f628
2 changed files with 3 additions and 11 deletions

View file

@ -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();

View file

@ -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);