From 2db320e1bd4c58ee84f3c0a0da2247e8ed0287f6 Mon Sep 17 00:00:00 2001 From: crschnick Date: Wed, 9 Oct 2024 10:26:56 +0000 Subject: [PATCH] FIx macOS fallback shell triggering too often --- .../main/java/io/xpipe/app/core/check/AppShellCheck.java | 4 +++- app/src/main/java/io/xpipe/app/prefs/AppPrefs.java | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/xpipe/app/core/check/AppShellCheck.java b/app/src/main/java/io/xpipe/app/core/check/AppShellCheck.java index 15dc09272..77160bc11 100644 --- a/app/src/main/java/io/xpipe/app/core/check/AppShellCheck.java +++ b/app/src/main/java/io/xpipe/app/core/check/AppShellCheck.java @@ -15,9 +15,11 @@ public class AppShellCheck { public static void check() throws Exception { var err = selfTestErrorCheck(); + // We don't want to fall back on macOS as occasional zsh spawn issues would cause many users to use sh var canFallback = !ProcessControlProvider.get() .getEffectiveLocalDialect() - .equals(ProcessControlProvider.get().getFallbackDialect()); + .equals(ProcessControlProvider.get().getFallbackDialect()) && + OsType.getLocal() != OsType.MACOS; if (err.isPresent() && canFallback) { var msg = formatMessage(err.get().getMessage()); ErrorEvent.fromThrowable(new IllegalStateException(msg)).handle(); diff --git a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java index 1f365d939..d28ad29f2 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java +++ b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java @@ -10,6 +10,8 @@ import io.xpipe.app.storage.DataStorage; import io.xpipe.app.terminal.ExternalTerminalType; import io.xpipe.app.update.XPipeDistributionType; import io.xpipe.app.util.PasswordLockSecretValue; +import io.xpipe.app.util.XPipeSession; +import io.xpipe.core.process.OsType; import io.xpipe.core.util.InPlaceSecretValue; import io.xpipe.core.util.ModuleHelper; @@ -518,6 +520,11 @@ public class AppPrefs { storageDirectory.setValue(DEFAULT_STORAGE_DIR); } + // Fix erroneous fallback shell set on macOS + if (OsType.getLocal() == OsType.MACOS && AppProperties.get().getVersion().equals("12.1.1") && XPipeSession.get().isNewBuildSession()) { + useLocalFallbackShell.setValue(false); + } + try { FileUtils.forceMkdir(storageDirectory.getValue().toFile()); } catch (Exception e) {