macos: for windowShouldClose, only close the tab if we have multiple (#7566)

Fixes a regression from our undo/redo rework. We were accidentally
closing the entire window when the "X" button in the tab bar was
clicked.
pull/7567/head
Mitchell Hashimoto 2025-06-10 12:46:47 -07:00 committed by GitHub
commit e5f5e19eef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -1046,7 +1046,12 @@ class TerminalController: BaseTerminalController {
//MARK: - NSWindowDelegate
override func windowShouldClose(_ sender: NSWindow) -> Bool {
// If we have tabs, then this should only close the tab.
if window?.tabGroup?.windows.count ?? 0 > 1 {
closeTab(sender)
} else {
closeWindow(sender)
}
// We will always explicitly close the window using the above
return false