Merge pull request #646 from manaflow-ai/cmux/cmd-w-fails

Fix browser split behavior and prevent tagged app auto-close
This commit is contained in:
Austin Wang 2026-02-27 17:03:51 -08:00 committed by GitHub
commit 5c065bcf05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4033,15 +4033,16 @@ extension Workspace: BonsplitDelegate {
return
}
// Get the focused terminal in the original pane to inherit config from
guard let sourceTabId = controller.selectedTab(inPane: originalPane)?.id,
let sourcePanelId = panelIdFromSurfaceId(sourceTabId),
terminalPanel(for: sourcePanelId) != nil else { return }
// Mirror Cmd+D behavior: split buttons should always seed a terminal in the new pane.
// When the focused source is a browser, inherit terminal config from nearby terminals
// (or fall back to defaults) instead of leaving an empty selector pane.
let sourceTabId = controller.selectedTab(inPane: originalPane)?.id
let sourcePanelId = sourceTabId.flatMap { panelIdFromSurfaceId($0) }
#if DEBUG
dlog(
"split.didSplit.autoCreate pane=\(newPane.id.uuidString.prefix(5)) " +
"fromPane=\(originalPane.id.uuidString.prefix(5)) sourcePanel=\(sourcePanelId.uuidString.prefix(5))"
"fromPane=\(originalPane.id.uuidString.prefix(5)) sourcePanel=\(sourcePanelId.map { String($0.uuidString.prefix(5)) } ?? "none")"
)
#endif