macOS: Support building with Xcode 16 (#9162)

With this you can test most of the old tab bar behaviour without using a
virtual machine
pull/9168/head
Xiangbao Meng 2025-10-12 16:25:18 +02:00 committed by GitHub
parent 6faf7fcac3
commit cbc06a0abc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 28 additions and 0 deletions

View File

@ -12,8 +12,10 @@ struct CloseTerminalIntent: AppIntent {
)
var terminal: TerminalEntity
#if compiler(>=6.2)
@available(macOS 26.0, *)
static var supportedModes: IntentModes = .background
#endif
@MainActor
func perform() async throws -> some IntentResult {

View File

@ -19,8 +19,10 @@ struct CommandPaletteIntent: AppIntent {
)
var command: CommandEntity
#if compiler(>=6.2)
@available(macOS 26.0, *)
static var supportedModes: IntentModes = .background
#endif
@MainActor
func perform() async throws -> some IntentResult & ReturnsValue<Bool> {

View File

@ -12,8 +12,10 @@ struct FocusTerminalIntent: AppIntent {
)
var terminal: TerminalEntity
#if compiler(>=6.2)
@available(macOS 26.0, *)
static var supportedModes: IntentModes = .background
#endif
@MainActor
func perform() async throws -> some IntentResult {

View File

@ -17,8 +17,10 @@ struct GetTerminalDetailsIntent: AppIntent {
)
var terminal: TerminalEntity
#if compiler(>=6.2)
@available(macOS 26.0, *)
static var supportedModes: IntentModes = .background
#endif
static var parameterSummary: some ParameterSummary {
Summary("Get \(\.$detail) from \(\.$terminal)")

View File

@ -24,8 +24,10 @@ struct InputTextIntent: AppIntent {
)
var terminal: TerminalEntity
#if compiler(>=6.2)
@available(macOS 26.0, *)
static var supportedModes: IntentModes = [.background, .foreground]
#endif
@MainActor
func perform() async throws -> some IntentResult {
@ -74,8 +76,10 @@ struct KeyEventIntent: AppIntent {
)
var terminal: TerminalEntity
#if compiler(>=6.2)
@available(macOS 26.0, *)
static var supportedModes: IntentModes = [.background, .foreground]
#endif
@MainActor
func perform() async throws -> some IntentResult {
@ -136,8 +140,10 @@ struct MouseButtonIntent: AppIntent {
)
var terminal: TerminalEntity
#if compiler(>=6.2)
@available(macOS 26.0, *)
static var supportedModes: IntentModes = [.background, .foreground]
#endif
@MainActor
func perform() async throws -> some IntentResult {
@ -197,8 +203,10 @@ struct MousePosIntent: AppIntent {
)
var terminal: TerminalEntity
#if compiler(>=6.2)
@available(macOS 26.0, *)
static var supportedModes: IntentModes = [.background, .foreground]
#endif
@MainActor
func perform() async throws -> some IntentResult {
@ -265,8 +273,10 @@ struct MouseScrollIntent: AppIntent {
)
var terminal: TerminalEntity
#if compiler(>=6.2)
@available(macOS 26.0, *)
static var supportedModes: IntentModes = [.background, .foreground]
#endif
@MainActor
func perform() async throws -> some IntentResult {

View File

@ -16,8 +16,10 @@ struct KeybindIntent: AppIntent {
)
var action: String
#if compiler(>=6.2)
@available(macOS 26.0, *)
static var supportedModes: IntentModes = [.background, .foreground]
#endif
@MainActor
func perform() async throws -> some IntentResult & ReturnsValue<Bool> {

View File

@ -45,8 +45,10 @@ struct NewTerminalIntent: AppIntent {
// Performing in the background can avoid opening multiple windows at the same time
// using `foreground` will cause `perform` and `AppDelegate.applicationDidBecomeActive(_:)`/`AppDelegate.applicationShouldHandleReopen(_:hasVisibleWindows:)` running at the 'same' time
#if compiler(>=6.2)
@available(macOS 26.0, *)
static var supportedModes: IntentModes = .background
#endif
@available(macOS, obsoleted: 26.0, message: "Replaced by supportedModes")
static var openAppWhenRun = false

View File

@ -5,8 +5,10 @@ struct QuickTerminalIntent: AppIntent {
static var title: LocalizedStringResource = "Open the Quick Terminal"
static var description = IntentDescription("Open the Quick Terminal. If it is already open, then do nothing.")
#if compiler(>=6.2)
@available(macOS 26.0, *)
static var supportedModes: IntentModes = .background
#endif
@MainActor
func perform() async throws -> some IntentResult & ReturnsValue<[TerminalEntity]> {

View File

@ -23,11 +23,15 @@ class TerminalController: BaseTerminalController, TabGroupCloseCoordinator.Contr
case "hidden": "TerminalHiddenTitlebar"
case "transparent": "TerminalTransparentTitlebar"
case "tabs":
#if compiler(>=6.2)
if #available(macOS 26.0, *) {
"TerminalTabsTitlebarTahoe"
} else {
"TerminalTabsTitlebarVentura"
}
#else
"TerminalTabsTitlebarVentura"
#endif
default: defaultValue
}