fix(macos): address MR feedback #5939

This commit is contained in:
McNight
2025-02-25 00:17:01 +01:00
parent aa4aaa200f
commit 1254c6b981
2 changed files with 15 additions and 5 deletions

View File

@@ -59,6 +59,11 @@ class QuickTerminalController: BaseTerminalController {
selector: #selector(ghosttyConfigDidChange(_:)),
name: .ghosttyConfigDidChange,
object: nil)
center.addObserver(
self,
selector: #selector(onNewTab),
name: Ghostty.Notification.ghosttyNewTab,
object: nil)
}
required init?(coder: NSCoder) {
@@ -496,6 +501,14 @@ class QuickTerminalController: BaseTerminalController {
syncAppearance()
}
@objc private func onNewTab(notification: SwiftUI.Notification) {
guard let surfaceView = notification.object as? Ghostty.SurfaceView else { return }
guard let window = surfaceView.window else { return }
guard window.windowController is QuickTerminalController else { return }
// Tabs aren't supported with Quick Terminals or derivatives
showNoNewTabAlert()
}
private struct DerivedConfig {
let quickTerminalScreen: QuickTerminalScreen
let quickTerminalAnimationDuration: Double