diff --git a/macos/Sources/Features/Terminal/TerminalController.swift b/macos/Sources/Features/Terminal/TerminalController.swift index 252e40eb5..d7ddb793e 100644 --- a/macos/Sources/Features/Terminal/TerminalController.swift +++ b/macos/Sources/Features/Terminal/TerminalController.swift @@ -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 diff --git a/macos/Sources/Ghostty/Ghostty.Config.swift b/macos/Sources/Ghostty/Ghostty.Config.swift index ec23632f7..f30174b8e 100644 --- a/macos/Sources/Ghostty/Ghostty.Config.swift +++ b/macos/Sources/Ghostty/Ghostty.Config.swift @@ -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 + } } }