From 09a419f6289425c9ae01c2a06f26558341514972 Mon Sep 17 00:00:00 2001 From: crschnick Date: Tue, 19 Dec 2023 15:29:56 +0000 Subject: [PATCH] Always use login shells --- .../io/xpipe/app/browser/OpenFileSystemModel.java | 1 + .../java/io/xpipe/core/process/ShellControl.java | 13 ++----------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java b/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java index fcbb7a9db..87c3afef6 100644 --- a/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java +++ b/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java @@ -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(); diff --git a/core/src/main/java/io/xpipe/core/process/ShellControl.java b/core/src/main/java/io/xpipe/core/process/ShellControl.java index b82281e5c..9e454859e 100644 --- a/core/src/main/java/io/xpipe/core/process/ShellControl.java +++ b/core/src/main/java/io/xpipe/core/process/ShellControl.java @@ -172,7 +172,7 @@ public interface ShellControl extends ProcessControl { FailableSupplier 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 enforceDialect(@NonNull ShellDialect type, FailableFunction sc) throws Exception { if (isRunning() && getShellDialect().equals(type)) { return sc.apply(this);