fix(tmux): hide web terminal proxy sessions

This commit is contained in:
2026-08-12 11:20:58 +08:00
parent 50371cfb0c
commit d125a8d6ec
2 changed files with 31 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import { basename } from 'node:path';
import { runProcess } from '../process.js';
const PANE_FORMAT = '#{session_name}\t#{window_index}\t#{window_name}\t#{pane_id}\t#{pane_current_command}\t#{pane_current_path}';
const WEB_TERMINAL_SESSION_PATTERN = /^web-\d+-\d+$/;
const ENGINE_BY_COMMAND = {
claude: 'claude',
@@ -21,7 +22,9 @@ export function parseTmuxPanes(output) {
.map((line) => {
const [session, windowIndex, windowName, paneId, command, cwd] = line.split('\t');
const engine = ENGINE_BY_COMMAND[command];
if (!engine || !paneId) return null;
// Web terminal sessions only link an existing pane into a temporary view.
// They are not additional agents and must not be enumerated in Live Agents.
if (!engine || !paneId || WEB_TERMINAL_SESSION_PATTERN.test(session)) return null;
return { engine, session, windowIndex: Number(windowIndex), windowName, paneId, cwd };
})
.filter(Boolean);