{"record":{"id":"02039c33a45d7ba2","repo":"Yeachan-Heo/oh-my-codex","slug":"omx-question-cannot-open-a-visible-renderer-becaus-02039c","errorCode":null,"errorMessage":"omx question cannot open a visible renderer because this tmux session has no attached client. Run omx question from an attached tmux pane.","messagePattern":"omx question cannot open a visible renderer because this tmux session has no attached client\\. Run omx question from an attached tmux pane\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/question/renderer.ts","lineNumber":868,"sourceCode":"      excludeRecordPath: options.recordPath,\n      nowIso: launchedAt,\n    });\n    return launchWindowsPsmuxShellQuestionPane(execTmux, sleepImpl, options.recordPath, {\n      cwd: options.cwd,\n      env: options.env,\n      sessionId: options.sessionId,\n      returnTarget,\n      launchedAt,\n    });\n  }\n\n  if (strategy === 'inside-tmux') {\n    const splitTarget = returnTarget ? ['-t', returnTarget] : [];\n    const attachedCheckTarget = safeString(env.TMUX).trim()\n      ? returnTarget || safeString(env.TMUX_PANE).trim() || undefined\n      : undefined;\n    if (safeString(env.TMUX).trim() && !isCurrentTmuxSessionAttached(execTmux, env, attachedCheckTarget)) {\n      throw new Error(\n        'omx question cannot open a visible renderer because this tmux session has no attached client. Run omx question from an attached tmux pane.',\n      );\n    }\n\n    supersedeLiveQuestionsForSession(options.cwd, options.sessionId, execTmux, {\n      excludeRecordPath: options.recordPath,\n      nowIso: launchedAt,\n    });\n\n    const sizingTarget = returnTarget || safeString(env.TMUX_PANE).trim() || undefined;\n    const availableWidthInfo = resolveAvailablePaneWidth(execTmux, sizingTarget);\n    const newWindowTarget = resolveNewWindowTarget(execTmux, returnTarget);\n    const newWindowTargetArgs = newWindowTarget ? ['-t', newWindowTarget] : [];\n    if (sizingTarget && availableWidthInfo.probeFailed) {\n      return launchQuestionPane(\n        execTmux,\n        sleepImpl,\n        [","sourceCodeStart":850,"sourceCodeEnd":886,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/question/renderer.ts#L850-L886","documentation":"Even when TMUX is set (strategy inside-tmux), the session must have at least one attached client for a visible split pane to make sense. isCurrentTmuxSessionAttached is checked against the return target or TMUX_PANE; if no client is attached, the renderer throws because the user would never see the question UI.","triggerScenarios":"Running inside a tmux session that was created detached (tmux new-session -d) and entered via `tmux send-keys`/automation; sessions where all clients detached while the process kept running; a switch-client state that reports no attached client for the target session.","commonSituations":"Automation/agent harnesses that drive tmux programmatically without attaching; long-running omx processes that survive a detach; scripts using new-session -d as a job runner.","solutions":["Attach a client to the session: `tmux attach-session -t <session>` (from another terminal).","Run omx question only while you are actively viewing the tmux session.","For automation, set OMX_QUESTION_RETURN_PANE to a pane in an attached session, or use a non-interactive question mode."],"exampleFix":"# before\ntmux new-session -d -s work\n# ...later, omx question fails: session has no attached client\n\n# after\n# from another terminal:\ntmux attach -t work\n# then run omx question inside that pane","handlingStrategy":"validation","validationCode":"function sessionAttached(): boolean {\n  try {\n    const out = execFileSync('tmux', ['list-sessions', '-F', '#{session_name}:#{session_attached}'], { encoding: 'utf-8' });\n    const mine = process.env.TMUX?.split(',').pop();\n    return out.split('\\n').some(l => { const [name, att] = l.split(':'); return att === '1' && (!mine || name === mine); });\n  } catch { return false; }\n}","typeGuard":null,"tryCatchPattern":"try { launchQuestionRenderer(opts); } catch (e) { if (e instanceof Error && /no attached client/.test(e.message)) { /* ask user to `tmux attach`, then retry once */ } else throw e; }","preventionTips":["Never drive omx question from a fully detached session (new-session -d automation).","Attach a client before triggering interactive questions in agent harnesses.","Retry after attaching; check session_attached before launching."],"tags":["tmux","detached-session","renderer"],"backgroundTag":"tmux-session-detached","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}