diff --git a/src/renderer/components/chat/AgentTerminal.tsx b/src/renderer/components/chat/AgentTerminal.tsx index 24601163..9fb2ca90 100644 --- a/src/renderer/components/chat/AgentTerminal.tsx +++ b/src/renderer/components/chat/AgentTerminal.tsx @@ -877,6 +877,15 @@ export function AgentTerminal({ { id: 'copy', label: t('Copy'), disabled: !terminal?.hasSelection() }, { id: 'paste', label: t('Paste') }, { id: 'selectAll', label: t('Select all') }, + ...(tmuxSessionNameRef.current + ? [ + { id: 'separator-2', label: '', type: 'separator' as const }, + { + id: 'copyTmuxRestore', + label: t('Copy tmux restore command'), + }, + ] + : []), ]; const selectedId = await window.electronAPI.contextMenu.show(menuItems); @@ -910,6 +919,12 @@ export function AgentTerminal({ case 'selectAll': terminal?.selectAll(); break; + case 'copyTmuxRestore': + if (tmuxSessionNameRef.current) { + const restoreCmd = `tmux -L enso attach-session -t ${tmuxSessionNameRef.current}`; + navigator.clipboard.writeText(restoreCmd); + } + break; } }, [terminal, clear, refreshRenderer, t, onSplit, canMerge, onMerge, onFocus] diff --git a/src/shared/i18n.ts b/src/shared/i18n.ts index c840ff07..5e2029b6 100644 --- a/src/shared/i18n.ts +++ b/src/shared/i18n.ts @@ -152,6 +152,7 @@ export const zhTranslations: Record = { 'Copy Commit ID': '复制 Commit ID', 'Copy Path': '复制路径', 'Copy Relative Path': '复制相对路径', + 'Copy tmux restore command': '复制 tmux 恢复命令', 'Revert commit': 'Revert 提交', 'Reset to commit': 'Reset 到此提交', 'Select reset mode for commit': '选择 Reset 模式',