mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: show alert if new tab is attempted from quick term
This commit is contained in:
@ -57,6 +57,11 @@ class QuickTerminalController: BaseTerminalController {
|
|||||||
|
|
||||||
override func windowDidResignKey(_ notification: Notification) {
|
override func windowDidResignKey(_ notification: Notification) {
|
||||||
super.windowDidResignKey(notification)
|
super.windowDidResignKey(notification)
|
||||||
|
|
||||||
|
// We don't animate out if there is a modal sheet being shown currently.
|
||||||
|
// This lets us show alerts without causing the window to disappear.
|
||||||
|
guard window?.attachedSheet == nil else { return }
|
||||||
|
|
||||||
animateOut()
|
animateOut()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,4 +183,14 @@ class QuickTerminalController: BaseTerminalController {
|
|||||||
// Instead of closing the window, we animate it out.
|
// Instead of closing the window, we animate it out.
|
||||||
animateOut()
|
animateOut()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user