diff --git a/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift b/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift index 807935806..7681a00fa 100644 --- a/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift +++ b/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift @@ -437,6 +437,16 @@ class QuickTerminalController: BaseTerminalController { } } + func showNoNewTabAlert() { + guard let window else { return } + let alert = NSAlert() + alert.messageText = "Cannot Create New Tab" + alert.informativeText = "Tabs aren't supported in the Quick Terminal." + alert.addButton(withTitle: "OK") + alert.alertStyle = .warning + alert.beginSheetModal(for: window) + } + // MARK: First Responder @IBAction override func closeWindow(_ sender: Any) { @@ -445,13 +455,7 @@ class QuickTerminalController: BaseTerminalController { } @IBAction func newTab(_ sender: Any?) { - guard let window else { return } - let alert = NSAlert() - alert.messageText = "Cannot Create New Tab" - alert.informativeText = "Tabs aren't supported in the Quick Terminal." - alert.addButton(withTitle: "OK") - alert.alertStyle = .warning - alert.beginSheetModal(for: window) + showNoNewTabAlert() } @IBAction func toggleGhosttyFullScreen(_ sender: Any) { diff --git a/macos/Sources/Features/Terminal/TerminalManager.swift b/macos/Sources/Features/Terminal/TerminalManager.swift index a75ee78f8..1647d066a 100644 --- a/macos/Sources/Features/Terminal/TerminalManager.swift +++ b/macos/Sources/Features/Terminal/TerminalManager.swift @@ -125,6 +125,12 @@ class TerminalManager { } private func newTab(to parent: NSWindow, withBaseConfig base: Ghostty.SurfaceConfiguration?) { + // If the parent window is a QuickTerminalWindow, we early return with an alert. + if let controller = parent.windowController as? QuickTerminalController { + controller.showNoNewTabAlert() + return + } + // If our parent is in non-native fullscreen, then new tabs do not work. // See: https://github.com/mitchellh/ghostty/issues/392 if let controller = parent.windowController as? TerminalController,