mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
Merge pull request #980 from mitchellh/macos-open
macos: do not open an initial window if opening from URL
This commit is contained in:
@ -78,9 +78,12 @@ class AppDelegate: NSObject, ObservableObject, NSApplicationDelegate, UNUserNoti
|
||||
"ApplePressAndHoldEnabled": false,
|
||||
])
|
||||
|
||||
// Let's launch our first window.
|
||||
// TODO: we should detect if we restored windows and if so not launch a new window.
|
||||
terminalManager.newWindow()
|
||||
// Let's launch our first window. We only do this if we have no other windows. It
|
||||
// is possible to have other windows if we're opening a URL since `application(_:openFile:)`
|
||||
// is called before this.
|
||||
if (terminalManager.windows.count == 0) {
|
||||
terminalManager.newWindow()
|
||||
}
|
||||
|
||||
// Initial config loading
|
||||
configDidReload(ghostty)
|
||||
|
@ -17,7 +17,7 @@ class TerminalManager {
|
||||
var focusedSurface: Ghostty.SurfaceView? { mainWindow?.controller.focusedSurface }
|
||||
|
||||
/// The set of windows we currently have.
|
||||
private var windows: [Window] = []
|
||||
var windows: [Window] = []
|
||||
|
||||
// Keep track of the last point that our window was launched at so that new
|
||||
// windows "cascade" over each other and don't just launch directly on top
|
||||
|
Reference in New Issue
Block a user