mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-09-24 15:49:09 +00:00
e8c291373b
Add Duplicate Session as an explicit fresh-login alternative to Copy Tab. Keep authenticated transport reuse for Copy Tab and double-clicks, preserve fresh intent across session restoration, and avoid sending a previous target's directory command to a fresh bastion login. Verified with focused and full tests, lint/build, independent local reviews, and real Electron menu operations against a local SSH server. Fixes #3221.
41 lines
1.7 KiB
TypeScript
41 lines
1.7 KiB
TypeScript
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
import React, { memo } from 'react';
|
|
|
|
import { TerminalFocusSidebar } from './TerminalFocusSidebar';
|
|
import { terminalLayerFocusSidebarPropsEqual } from './terminalLayerViewMemo';
|
|
|
|
type FocusSidebarContext = Record<string, any>;
|
|
|
|
function TerminalLayerFocusSidebarSectionInner({ ctx }: { ctx: FocusSidebarContext }) {
|
|
if (!ctx.isFocusMode || !ctx.activeWorkspace) return null;
|
|
|
|
return (
|
|
<TerminalFocusSidebar
|
|
activeWorkspace={ctx.activeWorkspace}
|
|
focusedSessionId={ctx.focusedSessionId}
|
|
onReorderWorkspaceSessions={ctx.onReorderWorkspaceSessions}
|
|
onRequestAddToWorkspace={ctx.onRequestAddToWorkspace}
|
|
onAppendHostToWorkspace={ctx.onAppendHostToWorkspace}
|
|
onCloseSession={ctx.handleCloseSession}
|
|
onCopySession={ctx.onCopySession}
|
|
onDuplicateSession={ctx.onDuplicateSession}
|
|
onCopySessionToNewWindow={ctx.onCopySessionToNewWindow}
|
|
onDetachSessionFromWorkspace={ctx.onRemoveSessionFromWorkspace}
|
|
onSetWorkspaceFocusedSession={ctx.onSetWorkspaceFocusedSession}
|
|
onToggleWorkspaceViewMode={ctx.onToggleWorkspaceViewMode}
|
|
onSubmitSessionRename={ctx.onSubmitSessionRename}
|
|
resolvedPreviewTheme={ctx.resolvedPreviewTheme}
|
|
sessionHostsMap={ctx.sessionHostsMap}
|
|
sessions={ctx.sessions}
|
|
dynamicTabTitleMode={ctx.terminalSettings?.dynamicTabTitleMode}
|
|
t={ctx.t}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export const TerminalLayerFocusSidebarSection = memo(
|
|
TerminalLayerFocusSidebarSectionInner,
|
|
(prev, next) => terminalLayerFocusSidebarPropsEqual(prev.ctx, next.ctx),
|
|
);
|
|
TerminalLayerFocusSidebarSection.displayName = 'TerminalLayerFocusSidebarSection';
|