mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
Merge pull request #2376 from lucymhdavies/macos-initial-window-false
Implements initial-window=false for macOS
This commit is contained in:
@ -173,7 +173,7 @@ class AppDelegate: NSObject,
|
|||||||
// is possible to have other windows in a few scenarios:
|
// is possible to have other windows in a few scenarios:
|
||||||
// - if we're opening a URL since `application(_:openFile:)` is called before this.
|
// - if we're opening a URL since `application(_:openFile:)` is called before this.
|
||||||
// - if we're restoring from persisted state
|
// - if we're restoring from persisted state
|
||||||
if terminalManager.windows.count == 0 {
|
if terminalManager.windows.count == 0 && ghostty.config.initialWindow {
|
||||||
terminalManager.newWindow()
|
terminalManager.newWindow()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -151,6 +151,14 @@ extension Ghostty {
|
|||||||
/// details on what each means. We only add documentation if there is a strange conversion
|
/// details on what each means. We only add documentation if there is a strange conversion
|
||||||
/// due to the embedded library and Swift.
|
/// due to the embedded library and Swift.
|
||||||
|
|
||||||
|
var initialWindow: Bool {
|
||||||
|
guard let config = self.config else { return true }
|
||||||
|
var v = true;
|
||||||
|
let key = "initial-window"
|
||||||
|
_ = ghostty_config_get(config, &v, key, UInt(key.count))
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
|
||||||
var shouldQuitAfterLastWindowClosed: Bool {
|
var shouldQuitAfterLastWindowClosed: Bool {
|
||||||
guard let config = self.config else { return true }
|
guard let config = self.config else { return true }
|
||||||
var v = false;
|
var v = false;
|
||||||
|
@ -1229,7 +1229,7 @@ keybind: Keybinds = .{},
|
|||||||
/// is run. Note that if `quit-after-last-window-closed` is `true` and
|
/// is run. Note that if `quit-after-last-window-closed` is `true` and
|
||||||
/// `quit-after-last-window-closed-delay` is set, setting `initial-window` to
|
/// `quit-after-last-window-closed-delay` is set, setting `initial-window` to
|
||||||
/// `false` will mean that Ghostty will quit after the configured delay if no
|
/// `false` will mean that Ghostty will quit after the configured delay if no
|
||||||
/// window is ever created. Only implemented on Linux.
|
/// window is ever created. Only implemented on Linux and macOS.
|
||||||
@"initial-window": bool = true,
|
@"initial-window": bool = true,
|
||||||
|
|
||||||
/// The position of the "quick" terminal window. To learn more about the
|
/// The position of the "quick" terminal window. To learn more about the
|
||||||
|
Reference in New Issue
Block a user