mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Fix new tab not created on Quick Terminal
This commit is contained in:
@ -68,7 +68,7 @@ class QuickTerminalController: BaseTerminalController {
|
||||
object: nil)
|
||||
center.addObserver(
|
||||
self,
|
||||
selector: #selector(onNewTab(_:)),
|
||||
selector: #selector(onNewTab),
|
||||
name: Ghostty.Notification.ghosttyNewTab,
|
||||
object: nil)
|
||||
center.addObserver(
|
||||
@ -539,7 +539,13 @@ class QuickTerminalController: BaseTerminalController {
|
||||
syncAppearance()
|
||||
}
|
||||
|
||||
@objc func onNewTab(_ sender: Any?) {
|
||||
@objc func onNewTab(notification: SwiftUI.Notification) {
|
||||
guard let surfaceView = notification.object as? Ghostty.SurfaceView else { return }
|
||||
guard let window = surfaceView.window else { return }
|
||||
|
||||
// return if window is not in our managed windows
|
||||
guard window == self.window else { return }
|
||||
|
||||
tabManager.newTab()
|
||||
}
|
||||
|
||||
|
@ -329,6 +329,9 @@ class TerminalManager {
|
||||
guard let surfaceView = notification.object as? Ghostty.SurfaceView else { return }
|
||||
guard let window = surfaceView.window else { return }
|
||||
|
||||
// return if window is not in our managed windows
|
||||
guard windows.contains(where: { $0.controller.window == window }) else { return }
|
||||
|
||||
let configAny = notification.userInfo?[Ghostty.Notification.NewSurfaceConfigKey]
|
||||
let config = configAny as? Ghostty.SurfaceConfiguration
|
||||
|
||||
|
Reference in New Issue
Block a user