fix: allow closing last session tab and restore DevTools shortcut
Closing the sole remaining non-welcome tab now resets to welcome; enable Tauri devtools, menu/shortcut toggle, and copy release artifacts from CARGO_TARGET_DIR. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
da95113e6d
commit
188f3556ed
14 files changed
+95
-38
No files matched your search
@@ -143,7 +143,8 @@ export function CommandPalette({
|
||||
shortcut: 'Ctrl+W',
|
||||
icon: <X size={16} />,
|
||||
action: () => {
|
||||
if (activeTabId && tabs.length > 1) {
|
||||
const active = tabs.find((tab) => tab.id === activeTabId)
|
||||
if (activeTabId && (tabs.length > 1 || active?.type !== 'welcome')) {
|
||||
void disposeAndCloseTab(activeTabId)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -912,7 +912,8 @@ export default function TerminalWorkspace({ tabId, isActive = true }: TerminalVi
|
||||
closePane(paneId)
|
||||
return
|
||||
}
|
||||
if (tabs.length <= 1) return
|
||||
const onlyTab = tabs.length === 1 ? tabs[0] : null
|
||||
if (tabs.length <= 1 && (!onlyTab || onlyTab.type === 'welcome' || onlyTab.id !== tabId)) return
|
||||
|
||||
const connectionId = connectionIdRef.current
|
||||
const paneShells = panesRef.current.flatMap((pane) => pane.shellId ? [pane.shellId] : [])
|
||||
@@ -935,7 +936,7 @@ export default function TerminalWorkspace({ tabId, isActive = true }: TerminalVi
|
||||
}
|
||||
closeTab(tabId)
|
||||
})()
|
||||
}, [closePane, closeTab, connectionIdRef, tabId, tabs.length])
|
||||
}, [closePane, closeTab, connectionIdRef, tabId, tabs])
|
||||
|
||||
const openTerminalContextMenu = useCallback((
|
||||
paneId: string,
|
||||
@@ -1246,7 +1247,7 @@ export default function TerminalWorkspace({ tabId, isActive = true }: TerminalVi
|
||||
hasSelection={contextMenu.hasSelection}
|
||||
canSplit={connectionState === 'connected'}
|
||||
canClosePane={panes.length > 1}
|
||||
canCloseTerminal={panes.length > 1 || tabs.length > 1}
|
||||
canCloseTerminal={panes.length > 1 || tabs.length > 1 || tabs[0]?.type !== 'welcome'}
|
||||
closeLabel={panes.length > 1 ? t('toolbar.closePaneLabel') : t('toolbar.closeTabLabel')}
|
||||
maximized={maximizedPaneId === contextMenu.paneId}
|
||||
onClose={() => setContextMenu(null)}
|
||||
|
||||
Reference in new issue
Block a user