Hmbown/CodeWhale · error

tmux attach unavailable

Error message

tmux attach unavailable

What it means

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.

Source

Thrown at crates/cli/src/lib.rs:924

                return Ok(());
            }
            if let Some(session) = lane.tmux_session.as_deref() {
                let socket = lane
                    .tmux_socket
                    .as_deref()
                    .context("tmux lane is missing its pinned server socket")?;
                let status = Command::new("tmux")
                    .arg("-S")
                    .arg(socket)
                    .args(["attach", "-t", session])
                    .status();
                match status {
                    Ok(s) if s.success() => Ok(()),
                    Ok(s) => bail!("tmux attach failed ({s}); command was: {attach}"),
                    Err(err) => {
                        eprintln!("could not exec tmux: {err}");
                        println!("{attach}");
                        bail!("tmux attach unavailable");
                    }
                }
            } else {
                println!("{attach}");
                Ok(())
            }
        }
        LaneCommand::Logs {
            lane_id,
            follow,
            tail,
        } => {
            let reg = LaneRegistry::open_default()?;
            let lane = reg.load(&lane_id)?;
            let path = lane.log_path;
            if !path.exists() {
                bail!("log file missing: {}", path.display());
            }

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Install tmux (apt/brew/pacman/apk) and confirm `tmux -V` works in the same shell you run codewhale from
  2. Check PATH includes tmux's install directory; use an absolute tmux path in your shell config if needed
  3. Use the fallback: copy the `tmux -S <socket> attach -t <session>` command the error prints to stdout and run it directly
  4. If the lane's pinned server socket is stale, recreate the lane and retry attach

Example fix

# before: tmux missing
$ codewhale lane attach my-lane
# could not exec tmux: No such file or directory

# after
$ sudo apt install tmux
$ codewhale lane attach my-lane
Defensive patterns

Strategy: validation

Validate before calling

#!/usr/bin/env bash
# before: codewhale lane attach my-lane
command -v tmux >/dev/null 2>&1 || { echo "tmux required for attach" >&2; exit 1; }
codewhale lane attach my-lane

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Related errors


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/1dd98c6a2a0c12e9. Report an issue: GitHub.