mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-03 04:38:39 +03:00
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.
This commit is contained in:
@ -1046,7 +1046,12 @@ class TerminalController: BaseTerminalController {
|
||||
//MARK: - NSWindowDelegate
|
||||
|
||||
override func windowShouldClose(_ sender: NSWindow) -> Bool {
|
||||
closeWindow(sender)
|
||||
// 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
|
||||
|
Reference in New Issue
Block a user