mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 09:16:11 +03:00
feat: respect maximize config on macOS
Signed-off-by: Aaron Ruan <i@ar212.com>
This commit is contained in:

committed by
Mitchell Hashimoto

parent
61f41e5c01
commit
5a5478abe1
@ -375,7 +375,11 @@ class TerminalController: BaseTerminalController {
|
||||
// If we have only a single surface (no splits) and that surface requested
|
||||
// an initial size then we set it here now.
|
||||
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 {
|
||||
// Get the current frame of the window
|
||||
var frame = window.frame
|
||||
|
@ -514,6 +514,14 @@ extension Ghostty {
|
||||
_ = ghostty_config_get(config, &v, key, UInt(key.count))
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user