feat: respect maximize config on macOS (#5962)

Resolve #5928
This commit is contained in:
Mitchell Hashimoto
2025-02-27 15:25:17 -08:00
committed by GitHub
2 changed files with 13 additions and 1 deletions

View File

@ -375,7 +375,11 @@ class TerminalController: BaseTerminalController {
// If we have only a single surface (no splits) and that surface requested // If we have only a single surface (no splits) and that surface requested
// an initial size then we set it here now. // an initial size then we set it here now.
if case let .leaf(leaf) = surfaceTree { if case let .leaf(leaf) = surfaceTree {
if let initialSize = leaf.surface.initialSize, if config.maximize {
if let screen = window.screen ?? NSScreen.main {
window.setFrame(screen.visibleFrame, display: true)
}
} else if let initialSize = leaf.surface.initialSize,
let screen = window.screen ?? NSScreen.main { let screen = window.screen ?? NSScreen.main {
// Get the current frame of the window // Get the current frame of the window
var frame = window.frame var frame = window.frame

View File

@ -514,6 +514,14 @@ extension Ghostty {
_ = ghostty_config_get(config, &v, key, UInt(key.count)) _ = ghostty_config_get(config, &v, key, UInt(key.count))
return v return v
} }
var maximize: Bool {
guard let config = self.config else { return true }
var v = false;
let key = "maximize"
_ = ghostty_config_get(config, &v, key, UInt(key.count))
return v
}
} }
} }