Yeachan-Heo/oh-my-codex · error · Error

failed to capture tmux pane owner: ${ownerResult.stderr}

Error message

failed to capture tmux pane owner: ${ownerResult.stderr}

What it means

`tmux show-option -qv -p -t <pane> @omx_team_pane_owner_id` failed while capturing pane ownership. The owner option is part of the authority tuple that later guards destructive effects, so a failed read (as opposed to an empty one) aborts capture. Embedded stderr explains the tmux-side failure.

Source

Thrown at src/team/tmux-session.ts:308

    'display-message', '-p', '-t', target,
    '#{session_name}\t#{session_id}\t#{session_created}\t#{window_index}\t#{window_id}\t#{pane_id}\t#{pane_pid}',
  ]);
  if (!result.ok) throw new Error(`failed to capture tmux source authority: ${result.stderr}`);
  const fields = result.stdout.split('\t');
  if (fields.length !== 7) throw new Error('malformed tmux source authority');
  const [sessionName, sessionId, sessionCreated, windowIndex, windowId, capturedPaneId, panePid] = fields;
  if (!sessionName || !/^\$[0-9]+$/.test(sessionId) || !/^[0-9]+$/.test(sessionCreated)
    || !/^[0-9]+$/.test(windowIndex) || !/^@[0-9]+$/.test(windowId)
    || capturedPaneId !== target || !/^[1-9][0-9]*$/.test(panePid)) {
    throw new Error('malformed tmux source authority');
  }
  const parsedPid = Number(panePid);
  if (!Number.isSafeInteger(parsedPid) || parsedPid <= 0) throw new Error('malformed tmux source authority');
  const proof = readExactPaneProofSync(target);
  if (proof.status === 'unavailable') throw new ExactPaneProofUnavailableError(proof);
  if (proof.status !== 'live' || proof.pid !== parsedPid) throw new Error(`tmux pane identity changed: ${target}`);
  const ownerResult = runTmuxStructured(['show-option', '-qv', '-p', '-t', target, OMX_TEAM_PANE_OWNER_OPTION]);
  if (!ownerResult.ok) throw new Error(`failed to capture tmux pane owner: ${ownerResult.stderr}`);
  const teamPaneOwnerId = ownerResult.stdout.trim() || null;
  if (teamPaneOwnerId && !/^[A-Za-z0-9._:-]+$/.test(teamPaneOwnerId)) {
    throw new Error('malformed tmux pane owner');
  }
  if (expectedTeamPaneOwnerId !== undefined && teamPaneOwnerId !== expectedTeamPaneOwnerId) {
    throw new Error(`tmux pane team owner changed: ${target}`);
  }
  return {
    paneId: target,
    panePid: parsedPid,
    sessionName,
    sessionId,
    sessionCreated,
    windowId,
    windowIndex,
    teamPaneOwnerId,
  };
}

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Retry the capture with a freshly discovered pane ID
  2. Check embedded stderr for 'no such pane' vs option errors
  3. Confirm tmux >= 3.0 supports pane-scoped user options (`tmux -V`)
Defensive patterns

Strategy: retry

Validate before calling

const r = runTmuxStructured(['show-option','-qv','-p','-t',paneId,'@omx_team_pane_owner_id']);
if (!r.ok) await sleep(50); // transient; retry once before capture

Try / catch

catch (e) { if (/failed to capture tmux pane owner/.test(e.message)) return retryCapture(); throw e; }

Prevention

When it happens

Trigger: captureSourcePaneAuthority on a pane that disappears between the display-message and show-option calls, a tmux server error, or a tmux version that rejects pane-scoped user options with -p.

Common situations: Pane closed mid-capture (race); older tmux (<3.0) with limited pane-option support; corrupted server state after socket issues.

Related errors


AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27). Data as JSON: /api/errors/4889d261998da081. Report an issue: GitHub.