feat: respect maximize config on macOS

Signed-off-by: Aaron Ruan <i@ar212.com>
This commit is contained in:
Aaron Ruan
2025-02-25 15:05:53 +08:00
committed by Mitchell Hashimoto
parent 61f41e5c01
commit 5a5478abe1
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
}
} }
} }