async function showPicker() {
show('picker');
+ document.title = '任务列表 - CLI';
await renderTasks();
await renderSkillsSidebar();
}
}
document.getElementById('task-title').textContent = '🗂 ' + currentTask.name;
document.getElementById('task-cwd').textContent = currentTask.cwd;
+ updateTitle();
show('terminal');
initTerminal();
connectWS();
// 输入由 #msg-input 输入区处理,xterm 仅作 TUI 输出展示
}
+ // 浏览器标签页标题:会话名 - CLI,便于在多标签页间区分
+ function updateTitle() {
+ if (!currentTask) { document.title = 'CLI'; return; }
+ document.title = currentTask.name + ' - CLI';
+ }
+
function setConnected(v) {
statusDot.className = 'dot ' + (v ? 'connected' : 'disconnected');
statusText.textContent = v ? '已连接' : '未连接';
+ updateTitle();
if (v && term && term.focus) { try { term.focus(); } catch(e){} }
}