macOS: probable cli should return false on macOS for desktop launch (#8544)

Fixes #8542

The comment explains why this is needed.
pull/8538/head
Mitchell Hashimoto 2025-09-06 12:45:11 -07:00 committed by GitHub
commit 43d532475b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -4535,6 +4535,13 @@ fn probableCliEnvironment() bool {
// its not a real supported target and GTK via WSL2 assuming // its not a real supported target and GTK via WSL2 assuming
// single instance is probably fine. // single instance is probably fine.
.windows => return false, .windows => return false,
// On macOS, we don't want to detect `open` calls as CLI envs.
// Our desktop detection on macOS is very accurate due to how
// processes are launched on macOS, so if we detect we're launched
// from the app bundle then we're not in a CLI environment.
.macos => if (internal_os.launchedFromDesktop()) return false,
else => {}, else => {},
} }