{"record":{"id":"725e4138c9e30701","repo":"Hmbown/CodeWhale","slug":"tmux-runtime-is-unavailable-tmux-v-failed-with","errorCode":null,"errorMessage":"tmux runtime is unavailable: `tmux -V` failed with {}: {}","messagePattern":"tmux runtime is unavailable: `tmux -V` failed with (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/lane/src/runtime.rs","lineNumber":562,"sourceCode":"#[derive(Debug, Clone, Copy, PartialEq, Eq)]\nenum TmuxSessionState {\n    Present,\n    Absent,\n}\n\nfn tmux_command(socket: &Path) -> Command {\n    let mut command = Command::new(\"tmux\");\n    command.arg(\"-S\").arg(socket);\n    command\n}\n\nfn ensure_tmux_available() -> Result<()> {\n    let output = Command::new(\"tmux\")\n        .arg(\"-V\")\n        .output()\n        .context(\"tmux runtime requires the `tmux` executable\")?;\n    if !output.status.success() {\n        bail!(\n            \"tmux runtime is unavailable: `tmux -V` failed with {}: {}\",\n            output.status,\n            String::from_utf8_lossy(&output.stderr).trim()\n        );\n    }\n    Ok(())\n}\n\nfn tmux_session_state(socket: &Path, session: &str) -> Result<TmuxSessionState> {\n    let output = tmux_command(socket)\n        .args([\"has-session\", \"-t\", session])\n        .stdout(Stdio::null())\n        .stderr(Stdio::piped())\n        .output()\n        .with_context(|| format!(\"query tmux session {session}\"))?;\n    if output.status.success() {\n        return Ok(TmuxSessionState::Present);\n    }","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/lane/src/runtime.rs#L544-L580","documentation":"ensure_tmux_available probes the runtime by running `tmux -V`; a nonzero exit produces this error including the status and trimmed stderr. It runs inside TmuxRuntime::start (unless CODEWHALE_LANE_TMUX_DRY_RUN is set) exactly so a missing or broken tmux fails closed instead of persisting a fictional Running lane — the failure is also recorded as a lane_failed log event and the lane is marked Failed.","triggerScenarios":"TmuxRuntime::start with a tmux binary on PATH that exits nonzero for -V: broken installation, wrapper script erroring, incompatible tmux build, or library loader failures. (A missing executable yields the 'requires the tmux executable' context error instead.)","commonSituations":"Minimal containers/CI images without tmux; an alias or shim named tmux shadowing the real binary; tmux installed but failing to run due to missing libc/terminfo; local bins earlier in PATH containing a broken script.","solutions":["Run `tmux -V` in the same shell/environment to see the exact failure","Install or repair tmux (package manager) and confirm it is the real binary (which tmux)","Use the inline runtime instead when no terminal multiplexer is available","For tests that must not spawn processes, set CODEWHALE_LANE_TMUX_DRY_RUN — but never in production paths"],"exampleFix":"# before\n# container image without tmux; lane start with backend \"tmux\"\n\n# after (Dockerfile)\nRUN apt-get update && apt-get install -y tmux && rm -rf /var/lib/apt/lists/*\n# verify: tmux -V","handlingStrategy":"validation","validationCode":"fn tmux_available() -> bool {\n    std::process::Command::new(\"tmux\")\n        .arg(\"-V\")\n        .output()\n        .map(|o| o.status.success())\n        .unwrap_or(false)\n}\n\nlet backend = if tmux_available() { \"tmux\" } else { \"inline\" };","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Probe `tmux -V` during environment setup, not at lane start","Install tmux in container/CI images explicitly","Reserve CODEWHALE_LANE_TMUX_DRY_RUN for tests; never ship it in production configuration"],"tags":["rust","lane","tmux","runtime","dependency-missing"],"backgroundTag":"runtime-dependency-missing","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}