macOS: zig build run disables window saved state

This commit is contained in:
Mitchell Hashimoto
2025-07-05 19:54:01 -07:00
parent b799462745
commit 8c3caee15c
3 changed files with 38 additions and 7 deletions

View File

@@ -48,6 +48,26 @@ extension Ghostty {
}
}
// MARK: General Helpers
extension Ghostty {
enum LaunchSource: String {
case cli
case app
case zig_run
}
/// Returns the mechanism that launched the app. This is based on an env var so
/// its up to the env var being set in the correct circumstance.
static var launchSource: LaunchSource {
guard let envValue = ProcessInfo.processInfo.environment["GHOSTTY_MAC_LAUNCH_SOURCE"] else {
return .app
}
return LaunchSource(rawValue: envValue) ?? .app
}
}
// MARK: Swift Types for C Types
extension Ghostty {