FIx macOS fallback shell triggering too often

This commit is contained in:
crschnick 2024-10-09 10:26:56 +00:00
parent c2427da60d
commit 2db320e1bd
2 changed files with 10 additions and 1 deletions

View file

@ -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();

View file

@ -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) {