diff --git a/ui/goose2/src/app/AppShell.tsx b/ui/goose2/src/app/AppShell.tsx index a7922706c4..70afa3b73d 100644 --- a/ui/goose2/src/app/AppShell.tsx +++ b/ui/goose2/src/app/AppShell.tsx @@ -383,10 +383,18 @@ export function AppShell({ children }: { children?: React.ReactNode }) { e.preventDefault(); setSidebarCollapsed((prev) => !prev); } + // Cmd+W closes the active tab instead of the window + if (e.key === "w" && e.metaKey) { + e.preventDefault(); + const { activeTabId } = useChatSessionStore.getState(); + if (activeTabId) { + closeAndCleanupTab(activeTabId); + } + } }; window.addEventListener("keydown", handler); return () => window.removeEventListener("keydown", handler); - }, []); + }, [closeAndCleanupTab]); const activeSessionPersonaId = activeTab ? sessionStore.getSession(activeTab.sessionId)?.personaId