{"record":{"id":"275e2860dd5dc622","repo":"herdrdev/herdr","slug":"login-shell-shell-was-not-found-on-path","errorCode":null,"errorMessage":"login shell {shell:?} was not found on PATH","messagePattern":"login shell (.+?) was not found on PATH","errorType":"error_code","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"src/pane.rs","lineNumber":1469,"sourceCode":"        return is_executable_file(path)\n            .then(|| shell.to_string())\n            .ok_or_else(|| {\n                io::Error::new(\n                    io::ErrorKind::NotFound,\n                    format!(\"login shell {shell:?} is not executable\"),\n                )\n            });\n    }\n\n    std::env::var_os(\"PATH\")\n        .and_then(|path| {\n            std::env::split_paths(&path)\n                .map(|dir| dir.join(shell))\n                .find(|candidate| is_executable_file(candidate))\n        })\n        .and_then(|path| path.into_os_string().into_string().ok())\n        .ok_or_else(|| {\n            io::Error::new(\n                io::ErrorKind::NotFound,\n                format!(\"login shell {shell:?} was not found on PATH\"),\n            )\n        })\n}\n\n/// Sourced via `-NoExit -Command` when launching PowerShell on Windows. It\n/// wraps whatever `prompt` function the user's profile left behind so each\n/// prompt render appends the cwd as OSC 9;9 — the sequence Windows Terminal\n/// and ConEmu standardized for shell integration. PowerShell never updates\n/// its Win32 process cwd on `Set-Location`, so the prompt hook updates it when\n/// possible before reporting the cwd.\n///\n/// The snippet must not contain double quotes: powershell.exe parses its\n/// command line with its own rules that disagree with the ArgvQuote escaping\n/// portable-pty applies, and embedded `\\\"` sequences get corrupted in\n/// transit. Single-quoted strings and `[char]` codes keep the round-trip\n/// byte-exact, and the OSC 9;9 payload is emitted unquoted (the original","sourceCodeStart":1451,"sourceCodeEnd":1487,"githubUrl":"https://github.com/herdrdev/herdr/blob/f457cff4f2648eee85d176f8a41861241d4e8428/src/pane.rs#L1451-L1487","documentation":"Herdr resolves the login-mode shell by name using PATH when the shell string has no path separator. If no directory on PATH contains an executable with that name, this NotFound error is raised. It means the shell binary itself cannot be located anywhere in the environment Herdr runs in.","triggerScenarios":"Shell resolution with a bare name like \"zsh\" or \"fish\" while no directory in $PATH (as seen by the Herdr process) contains an executable file of that name. Common when Herdr is launched from an environment (launchd, systemd, a GUI) whose PATH differs from an interactive shell's PATH.","commonSituations":"Shell installed in a nonstandard prefix (/opt/homebrew/bin, ~/.nix-profile/bin) not on the daemon's PATH; Herdr server started at login with a minimal PATH; shell name misspelled in config; shell not installed on the machine at all.","solutions":["Confirm the shell is installed and find it: command -v zsh from a normal terminal","Use the absolute path to the shell in your Herdr/login-shell configuration instead of the bare name","Add the shell's install directory to PATH for the environment that launches Herdr (launchd.plist, systemd unit, shell profile)","Install the missing shell if it is genuinely absent"],"exampleFix":"// before\nlogin_shell = \"fish\"\n// after\nlogin_shell = \"/opt/homebrew/bin/fish\"","handlingStrategy":"validation","validationCode":"fn shell_on_path(shell: &str) -> Option<std::path::PathBuf> {\n    std::env::var_os(\"PATH\")?.into_iter()\n        .flat_map(std::env::split_paths)\n        .map(|dir| dir.join(shell))\n        .find(|p| p.is_file())\n}\nif shell_on_path(shell).is_none() {\n    // refuse or fall back before calling the API\n}","typeGuard":null,"tryCatchPattern":"Err(e) if e.kind() == std::io::ErrorKind::NotFound && e.to_string().contains(\"was not found on PATH\") => {\n    // suggest absolute path or fall back to default shell\n}","preventionTips":["Prefer absolute shell paths in configuration over bare names","Ensure the launching environment (launchd/systemd/GUI) has a full PATH","Warn at startup if the configured shell cannot be resolved"],"tags":["shell","path-lookup","environment","login","not-found"],"backgroundTag":"command-not-found-on-path","analyzedSha":"f457cff4f2648eee85d176f8a41861241d4e8428","analyzedAt":"2026-08-28T15:41:09.197Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}