mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 23:25:24 +00:00
https://github.com/Termix-SSH/Support/issues/1264
This commit is contained in:
1 parent
2c8d13323b
commit
42e7861073
4 files changed
+24
-4
No files matched your search
@@ -15,7 +15,8 @@ export type KeybindingActionType =
|
|||||||
| "runSnippet"
|
| "runSnippet"
|
||||||
| "nextTab"
|
| "nextTab"
|
||||||
| "previousTab"
|
| "previousTab"
|
||||||
| "openCommandPalette";
|
| "openCommandPalette"
|
||||||
|
| "reconnectSession";
|
||||||
|
|
||||||
export interface KeybindingAction {
|
export interface KeybindingAction {
|
||||||
type: KeybindingActionType;
|
type: KeybindingActionType;
|
||||||
|
|||||||
+17
-3
@@ -517,9 +517,12 @@ export function AppShell({
|
|||||||
).filter(
|
).filter(
|
||||||
(binding) =>
|
(binding) =>
|
||||||
binding.enabled &&
|
binding.enabled &&
|
||||||
["nextTab", "previousTab", "openCommandPalette"].includes(
|
[
|
||||||
binding.action.type,
|
"nextTab",
|
||||||
),
|
"previousTab",
|
||||||
|
"openCommandPalette",
|
||||||
|
"reconnectSession",
|
||||||
|
].includes(binding.action.type),
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
@@ -538,6 +541,17 @@ export function AppShell({
|
|||||||
setCommandPaletteOpen(true);
|
setCommandPaletteOpen(true);
|
||||||
return;
|
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;
|
const currentTabs = tabsRef.current;
|
||||||
if (currentTabs.length < 2) return;
|
if (currentTabs.length < 2) return;
|
||||||
const index = currentTabs.findIndex(
|
const index = currentTabs.findIndex(
|
||||||
|
|||||||
@@ -4462,6 +4462,7 @@
|
|||||||
"actionNextTab": "Switch to next tab",
|
"actionNextTab": "Switch to next tab",
|
||||||
"actionPreviousTab": "Switch to previous tab",
|
"actionPreviousTab": "Switch to previous tab",
|
||||||
"actionOpenCommandPalette": "Open quick search",
|
"actionOpenCommandPalette": "Open quick search",
|
||||||
|
"actionReconnectSession": "Reconnect current session",
|
||||||
"controlCodeLabel": "Letter",
|
"controlCodeLabel": "Letter",
|
||||||
"textLabel": "Text to send",
|
"textLabel": "Text to send",
|
||||||
"appendEnterLabel": "Press Enter after sending",
|
"appendEnterLabel": "Press Enter after sending",
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ const ACTION_LABEL_KEYS: Record<KeybindingActionType, string> = {
|
|||||||
nextTab: "newUi.sidebar.keybindings.actionNextTab",
|
nextTab: "newUi.sidebar.keybindings.actionNextTab",
|
||||||
previousTab: "newUi.sidebar.keybindings.actionPreviousTab",
|
previousTab: "newUi.sidebar.keybindings.actionPreviousTab",
|
||||||
openCommandPalette: "newUi.sidebar.keybindings.actionOpenCommandPalette",
|
openCommandPalette: "newUi.sidebar.keybindings.actionOpenCommandPalette",
|
||||||
|
reconnectSession: "newUi.sidebar.keybindings.actionReconnectSession",
|
||||||
};
|
};
|
||||||
|
|
||||||
function generateId(): string {
|
function generateId(): string {
|
||||||
@@ -510,6 +511,9 @@ export function KeybindingsDialog({
|
|||||||
<option value="openCommandPalette">
|
<option value="openCommandPalette">
|
||||||
{t("newUi.sidebar.keybindings.actionOpenCommandPalette")}
|
{t("newUi.sidebar.keybindings.actionOpenCommandPalette")}
|
||||||
</option>
|
</option>
|
||||||
|
<option value="reconnectSession">
|
||||||
|
{t("newUi.sidebar.keybindings.actionReconnectSession")}
|
||||||
|
</option>
|
||||||
</select>
|
</select>
|
||||||
{actionType === "paste" && (
|
{actionType === "paste" && (
|
||||||
<span className="text-xs text-muted-foreground">
|
<span className="text-xs text-muted-foreground">
|
||||||
|
|||||||
Reference in new issue
Block a user