feat(ssh-terminal): add a duplicate tab action (#1510)

This commit is contained in:
ZacharyZcR authored and GitHub committed 2026-09-30 09:46:50 -05:00
1 parent 55d7c8837b
commit fef33142b3
4 files changed
+55 -2

No files matched your search

@@ -3,6 +3,7 @@ import "@xterm/xterm/css/xterm.css";
import { lazy, Suspense, type ComponentType } from "react";
import {
Braces,
Copy,
Hammer,
History,
Laptop,
@@ -12,6 +13,7 @@ import {
import type {
PanelProps,
PluginHostRecord,
PluginTabRecord,
StandaloneViewProps,
TabProps,
TermixApp,
@@ -117,6 +119,26 @@ export function activate(app: TermixApp): void {
},
);
app.registerAction(
"terminal.duplicateTab",
((_handle: unknown, tab?: PluginTabRecord) => {
if (tab?.type === "terminal" && tab.host) {
app.tabs.openTab(tab.host, "terminal", { forceNewTab: true });
}
}) as never,
{ permission: "use" },
);
app.registerSlotContribution("tab.menu", {
actionId: "terminal.duplicateTab",
titleKey: "terminal.duplicateTab",
icon: Copy,
kind: "button",
when: ({ tab }) => {
const target = tab as PluginTabRecord | undefined;
return target?.type === "terminal" && !!target.host;
},
});
app.registerHostAction({
id: "terminal",
titleKey: "nav.terminal",