diff --git a/src/types/keybindings.ts b/src/types/keybindings.ts index f34e09eb1..1c06d5c86 100644 --- a/src/types/keybindings.ts +++ b/src/types/keybindings.ts @@ -15,7 +15,8 @@ export type KeybindingActionType = | "runSnippet" | "nextTab" | "previousTab" - | "openCommandPalette"; + | "openCommandPalette" + | "reconnectSession"; export interface KeybindingAction { type: KeybindingActionType; diff --git a/src/ui/AppShell.tsx b/src/ui/AppShell.tsx index 70a43c3a6..e251469a4 100644 --- a/src/ui/AppShell.tsx +++ b/src/ui/AppShell.tsx @@ -517,9 +517,12 @@ export function AppShell({ ).filter( (binding) => binding.enabled && - ["nextTab", "previousTab", "openCommandPalette"].includes( - binding.action.type, - ), + [ + "nextTab", + "previousTab", + "openCommandPalette", + "reconnectSession", + ].includes(binding.action.type), ); }) .catch(() => {}); @@ -538,6 +541,17 @@ export function AppShell({ setCommandPaletteOpen(true); return; } + if (type === "reconnectSession") { + const tabId = activeTabIdRef.current; + if (!tabId) return; + const termRef = terminalRefs.current.get(tabId); + ( + termRef?.current as + | import("@/features/terminal/Terminal").TerminalHandle + | null + )?.reconnect(); + return; + } const currentTabs = tabsRef.current; if (currentTabs.length < 2) return; const index = currentTabs.findIndex( diff --git a/src/ui/locales/en.json b/src/ui/locales/en.json index f7ceeada6..ba06b0e36 100644 --- a/src/ui/locales/en.json +++ b/src/ui/locales/en.json @@ -4462,6 +4462,7 @@ "actionNextTab": "Switch to next tab", "actionPreviousTab": "Switch to previous tab", "actionOpenCommandPalette": "Open quick search", + "actionReconnectSession": "Reconnect current session", "controlCodeLabel": "Letter", "textLabel": "Text to send", "appendEnterLabel": "Press Enter after sending", diff --git a/src/ui/sidebar/KeybindingsDialog.tsx b/src/ui/sidebar/KeybindingsDialog.tsx index ad90f8e53..a0f1e91dd 100644 --- a/src/ui/sidebar/KeybindingsDialog.tsx +++ b/src/ui/sidebar/KeybindingsDialog.tsx @@ -47,6 +47,7 @@ const ACTION_LABEL_KEYS: Record = { nextTab: "newUi.sidebar.keybindings.actionNextTab", previousTab: "newUi.sidebar.keybindings.actionPreviousTab", openCommandPalette: "newUi.sidebar.keybindings.actionOpenCommandPalette", + reconnectSession: "newUi.sidebar.keybindings.actionReconnectSession", }; function generateId(): string { @@ -510,6 +511,9 @@ export function KeybindingsDialog({ + {actionType === "paste" && (