Files
Netcatty/components/systemManager/openInteractiveTerminal.ts
T
陈大猫 36267717ac feat(terminal): add system manager side panel for processes, tmux, and Docker
Introduce workspace-aware System side panel with remote process/tmux/Docker management, terminal popup for interactive attach, capability warmup, review-hardened IPC, performance optimizations, toast action errors, and SSH channel recovery on reconnect.
2026-06-11 04:19:21 +08:00

27 lines
844 B
TypeScript

import { canReuseTerminalConnection } from '../../application/state/terminalConnectionReuse';
import type { TerminalSession } from '../../types';
import type { useSystemManagerBackend } from '../../application/state/useSystemManagerBackend';
type Backend = ReturnType<typeof useSystemManagerBackend>;
export async function openInteractiveTerminal(
backend: Backend,
parentSession: TerminalSession,
title: string,
startupCommand: string,
): Promise<{ success: boolean; error?: string }> {
const result = await backend.openTerminalPopup({
title,
parentSessionId: parentSession.id,
startupCommand,
sourceSession: {
...parentSession,
startupCommand,
reuseConnectionFromSessionId: canReuseTerminalConnection(parentSession)
? parentSession.id
: undefined,
},
});
return result;
}