From 32515720fceaba5337422c48d0c4d1cfc6ade160 Mon Sep 17 00:00:00 2001 From: crschnick Date: Wed, 13 Mar 2024 07:04:54 +0000 Subject: [PATCH] macOS fixes --- .../xpipe/app/browser/action/MultiExecuteAction.java | 2 +- .../java/io/xpipe/ext/base/browser/RunAction.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/xpipe/app/browser/action/MultiExecuteAction.java b/app/src/main/java/io/xpipe/app/browser/action/MultiExecuteAction.java index 39b7fe97e..9ebf963f7 100644 --- a/app/src/main/java/io/xpipe/app/browser/action/MultiExecuteAction.java +++ b/app/src/main/java/io/xpipe/app/browser/action/MultiExecuteAction.java @@ -41,7 +41,7 @@ public abstract class MultiExecuteAction implements BranchAction { @Override public String getName(OpenFileSystemModel model, List entries) { var t = AppPrefs.get().terminalType().getValue(); - return "in " + (t != null ? t.toTranslatedString() : "?"); + return "in " + (t != null ? t.toTranslatedString().getValue() : "?"); } @Override diff --git a/ext/base/src/main/java/io/xpipe/ext/base/browser/RunAction.java b/ext/base/src/main/java/io/xpipe/ext/base/browser/RunAction.java index 3e87786ef..36a35d861 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/browser/RunAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/browser/RunAction.java @@ -5,6 +5,7 @@ import io.xpipe.app.browser.OpenFileSystemModel; import io.xpipe.app.browser.action.MultiExecuteAction; import io.xpipe.core.process.OsType; import io.xpipe.core.process.ShellControl; +import io.xpipe.core.process.ShellDialects; import io.xpipe.core.store.FileKind; import io.xpipe.core.store.FileSystem; import javafx.scene.Node; @@ -36,10 +37,21 @@ public class RunAction extends MultiExecuteAction { return true; } + + if (ShellDialects.isPowershell(shell.get()) && Stream.of("ps1") + .anyMatch(s -> e.getPath().endsWith(s))) { + return true; + } + if (Stream.of("sh", "command").anyMatch(s -> e.getPath().endsWith(s))) { return true; } + if (!OsType.getLocal().equals(OsType.WINDOWS)) { + var attribs = e.getMode(); + return attribs.contains("x"); + } + return false; }