{"record":{"id":"aadf84ed2cd584cc","repo":"affaan-m/ECC","slug":"tmux-split-window-did-not-return-a-pane-id-for-w","errorCode":null,"errorMessage":"tmux split-window did not return a pane id for ${workerPlan.workerName}","messagePattern":"tmux split-window did not return a pane id for (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/tmux-worktree-orchestrator.js","lineNumber":550,"sourceCode":"        'send-keys',\n        '-t',\n        plan.sessionName,\n        buildSessionBannerCommand(plan.sessionName, plan.coordinationDir),\n        'C-m'\n      ],\n      { cwd: plan.repoRoot }\n    );\n\n    for (const workerPlan of plan.workerPlans) {\n      const splitResult = runCommandImpl(\n        'tmux',\n        ['split-window', '-d', '-P', '-F', '#{pane_id}', '-t', plan.sessionName, '-c', workerPlan.worktreePath],\n        { cwd: plan.repoRoot }\n      );\n      const paneId = splitResult.stdout.trim();\n\n      if (!paneId) {\n        throw new Error(`tmux split-window did not return a pane id for ${workerPlan.workerName}`);\n      }\n\n      runCommandImpl('tmux', ['select-layout', '-t', plan.sessionName, 'tiled'], { cwd: plan.repoRoot });\n      runCommandImpl('tmux', ['select-pane', '-t', paneId, '-T', workerPlan.workerSlug], {\n        cwd: plan.repoRoot\n      });\n      runCommandImpl(\n        'tmux',\n        [\n          'send-keys',\n          '-t',\n          paneId,\n          `cd ${shellQuote(workerPlan.worktreePath)} && ${workerPlan.launchCommand}`,\n          'C-m'\n        ],\n        { cwd: plan.repoRoot }\n      );\n    }","sourceCodeStart":532,"sourceCodeEnd":568,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/tmux-worktree-orchestrator.js#L532-L568","documentation":"executePlan creates one tmux pane per worker via 'tmux split-window -d -P -F #{pane_id}' and relies on tmux echoing the new pane id on stdout. If the command succeeds but returns an empty string, the pane id cannot be targeted by later select-pane/send-keys calls, so it throws for that worker.","triggerScenarios":"tmux split-window exits 0 but prints nothing — typically a tmux version quirk with -P/-F, output being swallowed (stdio redirection issue in runCommandImpl), or a session that terminated between split and read; also when the spawn wrapper captures stdout but tmux writes the pane id to a different format target.","commonSituations":"Very old tmux versions without full -P/-F support; a custom runCommandImpl in the runtime override that drops stdout; the tmux server dying mid-run; race where the session closes immediately after split.","solutions":["Check your tmux version ('tmux -V'); upgrade to a modern tmux (>= 2.x) that reliably supports 'split-window -P -F #{pane_id}'.","Run the split command manually to see what it prints: tmux split-window -d -P -F '#{pane_id}' -t <session>.","If you pass a custom runtime.runCommand, verify it returns stdout from spawnSync (encoding: 'utf8') rather than discarding it.","Retry the run — a transient tmux server failure can produce an empty pane id."],"exampleFix":"// before (old tmux without -P support)\ntmux split-window -d -t my-session\ntmux list-panes -F '#{pane_id}' -t my-session | tail -1\n// after (tmux >= 2.1)\npaneId=$(tmux split-window -d -P -F '#{pane_id}' -t my-session)","handlingStrategy":"try-catch","validationCode":"const tmuxV = spawnSync('tmux', ['-V'], { encoding: 'utf8' }).stdout.trim();\nconst [ , major ] = tmuxV.match(/tmux (\\d+)/) || [];\nif (!major || Number(major) < 2) {\n  throw new Error(`tmux ${tmuxV} lacks reliable split-window -P support; upgrade tmux`);\n}","typeGuard":"const hasPaneId = (out) => typeof out === 'string' && /^%\\d+$/.test(out.trim());","tryCatchPattern":"const paneId = splitResult.stdout.trim();\nif (!paneId) {\n  console.error('tmux returned no pane id; tmux version:', spawnSync('tmux', ['-V'], { encoding: 'utf8' }).stdout.trim());\n  // fall back: list panes and diff before/after\n}","preventionTips":["Use tmux >= 2.1 where 'split-window -P -F #{pane_id}' is reliable","Never override runtime.runCommand with a wrapper that drops stdout","Smoke-test the exact split command manually against your tmux version","Keep the tmux server alive for the duration of orchestration (no detach-kill races)"],"tags":["tmux","process","version-compatibility"],"backgroundTag":"unexpected-response-shape","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}