{"record":{"id":"1dd98c6a2a0c12e9","repo":"Hmbown/CodeWhale","slug":"tmux-attach-unavailable","errorCode":null,"errorMessage":"tmux attach unavailable","messagePattern":"tmux attach unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":924,"sourceCode":"                return Ok(());\n            }\n            if let Some(session) = lane.tmux_session.as_deref() {\n                let socket = lane\n                    .tmux_socket\n                    .as_deref()\n                    .context(\"tmux lane is missing its pinned server socket\")?;\n                let status = Command::new(\"tmux\")\n                    .arg(\"-S\")\n                    .arg(socket)\n                    .args([\"attach\", \"-t\", session])\n                    .status();\n                match status {\n                    Ok(s) if s.success() => Ok(()),\n                    Ok(s) => bail!(\"tmux attach failed ({s}); command was: {attach}\"),\n                    Err(err) => {\n                        eprintln!(\"could not exec tmux: {err}\");\n                        println!(\"{attach}\");\n                        bail!(\"tmux attach unavailable\");\n                    }\n                }\n            } else {\n                println!(\"{attach}\");\n                Ok(())\n            }\n        }\n        LaneCommand::Logs {\n            lane_id,\n            follow,\n            tail,\n        } => {\n            let reg = LaneRegistry::open_default()?;\n            let lane = reg.load(&lane_id)?;\n            let path = lane.log_path;\n            if !path.exists() {\n                bail!(\"log file missing: {}\", path.display());\n            }","sourceCodeStart":906,"sourceCodeEnd":942,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/cli/src/lib.rs#L906-L942","documentation":"Thrown by `codewhale lane attach` when the CLI cannot exec the external `tmux` binary while trying to attach to a lane's tmux session on its pinned server socket (`tmux -S <socket> attach -t <session>`). The `Command::new(\"tmux\").status()` call itself returned an Err, which on Unix means tmux is not installed, not on PATH, or not executable by this user. Before bailing, Codewhale prints the exact attach command to stdout so you can run it manually.","triggerScenarios":"Running `codewhale lane attach <lane-id>` in an environment where spawning tmux fails (ENOENT/EACCES): tmux not installed, tmux not on PATH for the shell/daemon that launched codewhale, a broken tmux binary, or an environment (minimal container, CI sandbox) that forbids process execution.","commonSituations":"Running lane attach inside a minimal Docker container or CI runner that lacks tmux; SSH session with a stripped-down PATH; headless environments where lanes were created by a service account whose PATH differs from the interactive user; tmux installed via a non-standard location (e.g. homebrew on a non-interpolated PATH).","solutions":["Install tmux (apt/brew/pacman/apk) and confirm `tmux -V` works in the same shell you run codewhale from","Check PATH includes tmux's install directory; use an absolute tmux path in your shell config if needed","Use the fallback: copy the `tmux -S <socket> attach -t <session>` command the error prints to stdout and run it directly","If the lane's pinned server socket is stale, recreate the lane and retry attach"],"exampleFix":"# before: tmux missing\n$ codewhale lane attach my-lane\n# could not exec tmux: No such file or directory\n\n# after\n$ sudo apt install tmux\n$ codewhale lane attach my-lane","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# before: codewhale lane attach my-lane\ncommand -v tmux >/dev/null 2>&1 || { echo \"tmux required for attach\" >&2; exit 1; }\ncodewhale lane attach my-lane","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install tmux and verify `tmux -V` in the exact environment (shell, container, service) that runs codewhale","In containers, add tmux to the image or use `lane logs` instead of attach","Script around the fallback: capture the `tmux -S <socket> attach -t <session>` line codewhale prints and exec it directly"],"tags":["tmux","process-spawn","lane","attach","path"],"backgroundTag":"command-not-found","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}