diff --git a/macos/Sources/Features/App Intents/GhosttyIntentError.swift b/macos/Sources/Features/App Intents/GhosttyIntentError.swift --- a/macos/Sources/Features/App Intents/GhosttyIntentError.swift +++ b/macos/Sources/Features/App Intents/GhosttyIntentError.swift @@ -5,9 +5,9 @@ var localizedStringResource: LocalizedStringResource { switch self { - case .appUnavailable: return "The Ghostty app isn't properly initialized." - case .surfaceNotFound: return "The terminal no longer exists." - case .permissionDenied: return "Ghostty doesn't allow Shortcuts." + case .appUnavailable: "The Ghostty app isn't properly initialized." + case .surfaceNotFound: "The terminal no longer exists." + case .permissionDenied: "Ghostty doesn't allow Shortcuts." } } } diff --git a/macos/Sources/Helpers/Extensions/Array+Extension.swift b/macos/Sources/Helpers/Extensions/Array+Extension.swift --- a/macos/Sources/Helpers/Extensions/Array+Extension.swift +++ b/macos/Sources/Helpers/Extensions/Array+Extension.swift @@ -34,12 +34,12 @@ func helper(index: Int, accumulated: [UnsafePointer?], body: ([UnsafePointer?]) throws -> T) rethrows -> T { if index == count { return try body(accumulated) - } else { - return try self[index].withCString { cStr in - var newAccumulated = accumulated - newAccumulated.append(cStr) - return try helper(index: index + 1, accumulated: newAccumulated, body: body) - } + } + + return try self[index].withCString { cStr in + var newAccumulated = accumulated + newAccumulated.append(cStr) + return try helper(index: index + 1, accumulated: newAccumulated, body: body) } } diff --git a/macos/Sources/Features/App Intents/Entities/TerminalEntity.swift b/macos/Sources/Features/App Intents/Entities/TerminalEntity.swift --- a/macos/Sources/Features/App Intents/Entities/TerminalEntity.swift +++ b/macos/Sources/Features/App Intents/Entities/TerminalEntity.swift @@ -130,10 +130,10 @@ let controllers = NSApp.windows.compactMap { $0.windowController as? BaseTerminalController } - + // Get all our surfaces - return controllers.reduce([]) { result, c in - result + (c.surfaceTree.root?.leaves() ?? []) + return controllers.flatMap { + $0.surfaceTree.root?.leaves() ?? [] } } }