mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +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,
|
"ApplePressAndHoldEnabled": false,
|
||||||
])
|
])
|
||||||
|
|
||||||
// Let's launch our first window.
|
// Let's launch our first window. We only do this if we have no other windows. It
|
||||||
// TODO: we should detect if we restored windows and if so not launch a new window.
|
// is possible to have other windows if we're opening a URL since `application(_:openFile:)`
|
||||||
terminalManager.newWindow()
|
// is called before this.
|
||||||
|
if (terminalManager.windows.count == 0) {
|
||||||
|
terminalManager.newWindow()
|
||||||
|
}
|
||||||
|
|
||||||
// Initial config loading
|
// Initial config loading
|
||||||
configDidReload(ghostty)
|
configDidReload(ghostty)
|
||||||
|
@ -17,7 +17,7 @@ class TerminalManager {
|
|||||||
var focusedSurface: Ghostty.SurfaceView? { mainWindow?.controller.focusedSurface }
|
var focusedSurface: Ghostty.SurfaceView? { mainWindow?.controller.focusedSurface }
|
||||||
|
|
||||||
/// The set of windows we currently have.
|
/// 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
|
// 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
|
// windows "cascade" over each other and don't just launch directly on top
|
||||||
|
Reference in New Issue
Block a user