mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-03 21:00:27 +00:00
windowDidLoad undoes macOS automatic window tabbing by inspecting window.tabGroup. Accessing tabGroup on a fresh window materializes AppKit's tab group machinery, which takes ~15-20ms and is on the critical path of every window creation, including the first window at app launch. AppKit only auto-tabs a fresh window when the system tabbing preference is "always": the tab bar "+" button goes through newWindowForTab which we intercept and route through our own tab logic, so it never auto-tabs. Guard the check on NSWindow.userTabbingPreference == .always so everyone else skips the tab group materialization entirely. Measured on macOS (Apple Silicon) during app launch via the startup timeline instrumentation: windowDidLoad tab group check: 17.8ms -> ~0ms main() -> window visible: median ~173ms -> ~165ms (n=7)