Merge `main`
parent
b0db51c45e
commit
9ed2385b48
|
|
@ -259,8 +259,16 @@ class AppDelegate: NSObject,
|
|||
// Setup signal handlers
|
||||
setupSignals()
|
||||
|
||||
// If we launched via zig run then we need to force foreground.
|
||||
if Ghostty.launchSource == .zig_run {
|
||||
switch Ghostty.launchSource {
|
||||
case .app:
|
||||
// Don't have to do anything.
|
||||
break
|
||||
|
||||
case .zig_run, .cli:
|
||||
// Part of launch services (clicking an app, using `open`, etc.) activates
|
||||
// the application and brings it to the front. When using the CLI we don't
|
||||
// get this behavior, so we have to do it manually.
|
||||
|
||||
// This never gets called until we click the dock icon. This forces it
|
||||
// activate immediately.
|
||||
applicationDidBecomeActive(.init(name: NSApplication.didBecomeActiveNotification))
|
||||
|
|
|
|||
|
|
@ -4535,6 +4535,13 @@ fn probableCliEnvironment() bool {
|
|||
// its not a real supported target and GTK via WSL2 assuming
|
||||
// single instance is probably fine.
|
||||
.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 => {},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue