From c9c1bd0531f722c100bbac1e31db88ea50052d92 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 25 Jun 2024 10:03:05 -0700 Subject: [PATCH] macos: titlebar tabs should do nothing if no titlebar Fixes #1876 --- macos/Sources/Features/Terminal/TerminalWindow.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/macos/Sources/Features/Terminal/TerminalWindow.swift b/macos/Sources/Features/Terminal/TerminalWindow.swift index 2d54db321..80abeaca4 100644 --- a/macos/Sources/Features/Terminal/TerminalWindow.swift +++ b/macos/Sources/Features/Terminal/TerminalWindow.swift @@ -194,7 +194,9 @@ class TerminalWindow: NSWindow { newTabButtonImageLayer = nil effectViewIsHidden = false - if titlebarTabs { + // We can only update titlebar tabs if there is a titlebar. Without the + // styleMask check the app will crash (issue #1876) + if titlebarTabs && styleMask.contains(.titled) { guard let tabBarAccessoryViewController = titlebarAccessoryViewControllers.first(where: { $0.identifier == Self.TabBarController}) else { return } tabBarAccessoryViewController.layoutAttribute = .right