diff --git a/core/src/main/java/io/xpipe/core/process/ShellProcessControl.java b/core/src/main/java/io/xpipe/core/process/ShellProcessControl.java index 25ee18a7..bf3a7f8e 100644 --- a/core/src/main/java/io/xpipe/core/process/ShellProcessControl.java +++ b/core/src/main/java/io/xpipe/core/process/ShellProcessControl.java @@ -64,8 +64,8 @@ public interface ShellProcessControl extends ProcessControl { SecretValue getElevationPassword(); default ShellProcessControl subShell(@NonNull ShellType type) { - return subShell(p -> type.openCommand(), (shellProcessControl, s) -> { - return s == null ? type.openCommand() : type.switchTo(s); + return subShell(p -> type.getNormalOpenCommand(), (shellProcessControl, s) -> { + return s == null ? type.getNormalOpenCommand() : type.executeCommandWithShell(s); }) .elevation(getElevationPassword()); } diff --git a/core/src/main/java/io/xpipe/core/process/ShellType.java b/core/src/main/java/io/xpipe/core/process/ShellType.java index 56bd0e43..0f812d9c 100644 --- a/core/src/main/java/io/xpipe/core/process/ShellType.java +++ b/core/src/main/java/io/xpipe/core/process/ShellType.java @@ -20,7 +20,7 @@ public interface ShellType { String createInitFileContent(String command); - String getOpenWithInitFileCommand(String file); + String getFileOpenCommand(String file); default String flatten(List command) { return command.stream() @@ -48,10 +48,6 @@ public interface ShellType { return ";"; } - default String getAndConcatenationOperator() { - return "&&"; - } - default String getOrConcatenationOperator() { return "||"; } @@ -74,9 +70,9 @@ public interface ShellType { String getPrintVariableCommand(String prefix, String name); - String openCommand(); + String getNormalOpenCommand(); - String switchTo(String cmd); + String executeCommandWithShell(String cmd); List createMkdirsCommand(String dirs);