Yeachan-Heo/oh-my-codex · error

Failed to create psmux question renderer shell pane.

Error message

Failed to create psmux question renderer shell pane.

What it means

Windows variant of pane creation: launchWindowsPsmuxShellQuestionPane runs the psmux (Windows tmux shim) command with '-F #{pane_id}' and -c cwd, then parses the pane id. If parsePaneIdFromTmuxOutput yields nothing, the psmux shell pane could not be created and the launch aborts before sending the question UI command.

Source

Thrown at src/question/renderer.ts:476

    cwd: string;
    env?: NodeJS.ProcessEnv;
    sessionId?: string;
    returnTarget?: string;
    launchedAt: string;
  },
): QuestionRendererState {
  const rawPane = execTmux([
    'new-window',
    '-n',
    'OMX Question',
    '-P',
    '-F',
    '#{pane_id}',
    '-c',
    options.cwd,
  ]);
  const paneId = parsePaneIdFromTmuxOutput(rawPane);
  if (!paneId) throw new Error('Failed to create psmux question renderer shell pane.');
  sleepImpl(QUESTION_RENDERER_PANE_SETTLE_MS);
  if (!isLaunchedQuestionPaneAlive(paneId, execTmux)) {
    throw new Error(`Question UI psmux pane ${paneId} disappeared immediately after launch.`);
  }

  const command = buildWindowsPsmuxQuestionUiCommand(recordPath, options);
  for (const argv of buildSendPaneArgvs(paneId, command, false)) {
    execTmux(argv);
  }
  sleepImpl(QUESTION_TEXT_SETTLE_MS);
  execTmux(['send-keys', '-t', paneId, 'C-m']);

  return {
    renderer: 'tmux-pane',
    target: paneId,
    launched_at: options.launchedAt,
    ...(options.returnTarget ? { return_target: options.returnTarget, return_transport: 'tmux-send-keys' as const } : {}),
  };

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Confirm psmux is installed and on PATH; run `psmux -V` (or the shim's version command).
  2. Reproduce the exact psmux command shown in logs with '-F #{pane_id}' to inspect its output/error.
  3. Update or align the psmux shim version so output matches the tmux pane-id format.
  4. Run from inside an active psmux session rather than spawning a detached one.
Defensive patterns

Strategy: fallback

Validate before calling

import { execFileSync } from 'node:child_process';
function psmuxWorks(): boolean {
  try { execFileSync('psmux', ['-V'], { encoding: 'utf-8' }); return true; } catch { return false; }
}

Try / catch

try { launchQuestionRenderer(opts); } catch (e) { if (e instanceof Error && /psmux question renderer shell pane/.test(e.message)) { /* fall back to non-interactive question mode on Windows */ } else throw e; }

Prevention

When it happens

Trigger: psmux not installed/misbehaving on Windows; the psmux command erroring (bad session, invalid cwd path with Windows separators); psmux output format differing from tmux's so the pane-id regex misses it.

Common situations: Windows environments where wintmux/psmux shim is missing, outdated, or its output includes extra lines; running from a shell without the shim on PATH; cwd pointing to a path psmux cannot -c into.

Related errors


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