mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
Merge pull request #2138 from ghostty-org/macos-reopen
macos: do not open a window on reopen if terminal manager has any
This commit is contained in:
@ -208,6 +208,12 @@ class AppDelegate: NSObject,
|
|||||||
// of focusing one of them.
|
// of focusing one of them.
|
||||||
guard !flag else { return true }
|
guard !flag else { return true }
|
||||||
|
|
||||||
|
// If we have any windows in our terminal manager we don't do anything.
|
||||||
|
// This is possible with flag set to false if there a race where the
|
||||||
|
// window is still initializing and is not visible but the user clicked
|
||||||
|
// the dock icon.
|
||||||
|
guard terminalManager.windows.count == 0 else { return true }
|
||||||
|
|
||||||
// No visible windows, open a new one.
|
// No visible windows, open a new one.
|
||||||
terminalManager.newWindow()
|
terminalManager.newWindow()
|
||||||
return false
|
return false
|
||||||
|
Reference in New Issue
Block a user