From 96826853bde13bad0825cd0afe35584a0760d17a Mon Sep 17 00:00:00 2001 From: Lukas <134181853+bo2themax@users.noreply.github.com> Date: Fri, 7 Aug 2026 15:14:30 +0200 Subject: [PATCH] macOS: fix window sizing after dragging a split into a window --- macos/Sources/Features/Terminal/TerminalController.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/macos/Sources/Features/Terminal/TerminalController.swift b/macos/Sources/Features/Terminal/TerminalController.swift index c60c2fab7..64eac02d1 100644 --- a/macos/Sources/Features/Terminal/TerminalController.swift +++ b/macos/Sources/Features/Terminal/TerminalController.swift @@ -344,14 +344,15 @@ class TerminalController: BaseTerminalController, TabGroupCloseCoordinator.Contr confirmUndo: Bool = true, inheritBackgroundOpacity: Bool? = nil ) -> TerminalController { + // Calculate the target frame based on the tree's view bounds + // before moving into the new window + let treeSize: CGSize? = tree.root?.viewBounds() + let c = TerminalController.init(ghostty, withSurfaceTree: tree) if let inheritBackgroundOpacity { c.isBackgroundOpaque = inheritBackgroundOpacity } - // Calculate the target frame based on the tree's view bounds - let treeSize: CGSize? = tree.root?.viewBounds() - c.scheduleInitialPresentation { c.showWindow(self) if let window = c.window {