From 7a560119400e30b58d212a7571460dfc9344ec00 Mon Sep 17 00:00:00 2001 From: EDToaster <7676229+EDToaster@users.noreply.github.com> Date: Mon, 9 Nov 2026 23:21:35 +0000 Subject: [PATCH] install_mac_app: launch natively on Apple Silicon instead of under Rosetta --- scripts/install_mac_app.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/install_mac_app.sh b/scripts/install_mac_app.sh index 60460193..407f0191 100755 --- a/scripts/install_mac_app.sh +++ b/scripts/install_mac_app.sh @@ -96,7 +96,17 @@ cat > "${macos}/toastty-launch" < an # independent, non-bundle-associated process + window. -"${support_bin}" >/dev/null 2>&1 & +# +# Because this shim is a script (no Mach-O header), LaunchServices can't infer +# its architecture and on Apple Silicon may start it under Rosetta. A +# translated parent prefers the x86_64 slice of universal binaries, which +# leaks into the terminal's shell (\`uname -m\` => x86_64). Explicitly request +# the native slice on arm64 hardware. +if [ "\$(/usr/sbin/sysctl -n hw.optional.arm64 2>/dev/null)" = "1" ]; then + /usr/bin/arch -arm64 "${support_bin}" >/dev/null 2>&1 & +else + "${support_bin}" >/dev/null 2>&1 & +fi exit 0 LAUNCH chmod 0755 "${macos}/toastty-launch" @@ -113,6 +123,11 @@ cat > "${contents}/Info.plist" <CFBundleShortVersionString${version} CFBundleExecutable toastty-launch LSMultipleInstancesProhibited + LSArchitecturePriority + + arm64 + x86_64 + CFBundlePackageType APPL LSMinimumSystemVersion 11.0 NSHighResolutionCapable