macOS fixes

This commit is contained in:
crschnick 2024-03-13 07:04:54 +00:00
parent 4320040c9a
commit 32515720fc
2 changed files with 13 additions and 1 deletions

View file

@ -41,7 +41,7 @@ public abstract class MultiExecuteAction implements BranchAction {
@Override
public String getName(OpenFileSystemModel model, List<BrowserEntry> entries) {
var t = AppPrefs.get().terminalType().getValue();
return "in " + (t != null ? t.toTranslatedString() : "?");
return "in " + (t != null ? t.toTranslatedString().getValue() : "?");
}
@Override

View file

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