Skip to content

Commit 07ace67

Browse files
committed
fix: Cmd+W closes browser tabs too, not just shell tabs
1 parent d8a3445 commit 07ace67

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

Sources/KanbanCode/CardDetailView.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,15 @@ struct CardDetailView: View {
411411
}
412412
.onReceive(NotificationCenter.default.publisher(for: .kanbanCloseTerminalTab)) { _ in
413413
guard selectedTab == .terminal else { return }
414-
// Only close extra shell tabs, not the Claude session
415-
guard let session = selectedTerminalSession else { return }
416-
onKillTerminal(session)
417-
let remaining = shellSessions.filter { $0 != session }
418-
selectedTerminalSession = remaining.first
414+
// Close the currently selected tab — shell or browser
415+
if let browserId = selectedBrowserTabId,
416+
let tab = browserTabs.first(where: { $0.id == browserId }) {
417+
closeBrowserTab(tab)
418+
} else if let session = selectedTerminalSession {
419+
onKillTerminal(session)
420+
let remaining = shellSessions.filter { $0 != session }
421+
selectedTerminalSession = remaining.first
422+
}
419423
}
420424
.onChange(of: focusTerminal) {
421425
if focusTerminal {

0 commit comments

Comments
 (0)