{"record":{"id":"dac1bb13b7d9253e","repo":"jdx/mise","slug":"windows-script-interpreter-interpreter-must-b","errorCode":null,"errorMessage":"windows_script_interpreter: {interpreter:?} must be a plain executable name","messagePattern":"windows_script_interpreter: (.+?) must be a plain executable name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/http.rs","lineNumber":1043,"sourceCode":"            );\n            return None;\n        }\n        let file_algo = crate::backend::asset_matcher::detect_checksum_algorithm(\n            &get_filename_from_url(&checksum_url),\n        );\n        fetch_checksum_from_file(&checksum_url, &file_algo).await\n    }\n}\n\n#[cfg(any(windows, test))]\nfn windows_script_launcher(script: &Path, interpreter: &str) -> Result<(PathBuf, String)> {\n    ensure_plain_bin_name(\"windows_script_interpreter\", interpreter)?;\n    if interpreter.is_empty()\n        || !interpreter\n            .chars()\n            .all(|ch| ch.is_ascii_alphanumeric() || matches!(ch, '.' | '_' | '-'))\n    {\n        eyre::bail!(\"windows_script_interpreter: {interpreter:?} must be a plain executable name\");\n    }\n    let filename = script\n        .file_name()\n        .and_then(|filename| filename.to_str())\n        .ok_or_else(|| eyre::eyre!(\"Windows script launcher requires a UTF-8 file name\"))?;\n    ensure_plain_bin_name(\"windows script\", filename)?;\n    if filename.is_empty()\n        || !filename\n            .chars()\n            .all(|ch| ch.is_ascii_alphanumeric() || matches!(ch, '.' | '_' | '-'))\n    {\n        eyre::bail!(\"Windows script file name {filename:?} contains unsupported characters\");\n    }\n    let launcher = script.with_file_name(format!(\"{filename}.cmd\"));\n    let body = format!(\"@echo off\\r\\n{interpreter} \\\"%~dp0{filename}\\\" %*\\r\\n\");\n    Ok((launcher, body))\n}\n","sourceCodeStart":1025,"sourceCodeEnd":1061,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/http.rs#L1025-L1061","documentation":"The windows_script_interpreter setting names the executable that will head a generated .cmd launcher on Windows. It must be a bare executable name (ASCII alphanumerics, `.`, `_`, `-` only) because it is written directly into the launcher body; anything else (paths, flags, quoting) is rejected to avoid producing a broken or unsafe command line.","triggerScenarios":"Setting windows_script_interpreter to a path like `C:/tools/python/python.exe`, arguments like `python -u`, or non-ASCII names, then writing a Windows script launcher (install or the launcher tests).","commonSituations":"Copying a full interpreter path from a working config; trying to pass interpreter flags through the setting; Unicode executable names.","solutions":["Set windows_script_interpreter to a bare name resolvable on PATH, e.g. `python` or `node`","Move flags into the script itself or env config, not the interpreter setting","Remove path components; rely on mise-managed PATH for resolution"],"exampleFix":"// before\nwindows_script_interpreter = \"C:/Program Files/Python/python.exe\"\n// after\nwindows_script_interpreter = \"python\"","handlingStrategy":"validation","validationCode":"// bash: reject interpreter settings that aren't a plain executable name\n[[ \"$windows_script_interpreter\" =~ ^[A-Za-z0-9._-]+$ ]] || { echo 'use a bare name like python'; exit 1; }","typeGuard":"// rust\nfn is_plain_bin_name(s: &str) -> bool {\n    !s.is_empty() && s.chars().all(|c| c.is_ascii_alphanumeric() || matches!(c, '.' | '_' | '-'))\n}","tryCatchPattern":null,"preventionTips":["Always use bare executable names resolvable via PATH for windows_script_interpreter","Pass interpreter flags via the script's shebang or env, never the interpreter setting","Avoid absolute paths and spaces in the setting"],"tags":["windows","config","validation","http-backend"],"backgroundTag":"invalid-argument-value","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}