{"record":{"id":"fdd03baf2a61f590","repo":"jdx/mise","slug":"install-mise-must-not-contain-a-newline-path","errorCode":null,"errorMessage":"install_mise must not contain a newline: {path:?}","messagePattern":"install_mise must not contain a newline: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote.rs","lineNumber":2216,"sourceCode":"    Ok(command.to_string())\n}\n\nfn validated_remote_command_output(output: &str) -> Result<String> {\n    validated_remote_command(output.strip_suffix('\\n').unwrap_or(output))\n}\n\nfn validated_absolute_remote_path_output(output: &str, kind: &str) -> Result<String> {\n    let path = output.strip_suffix('\\n').unwrap_or(output);\n    if !path.starts_with('/') || path.contains(['\\0', '\\n', '\\r']) {\n        bail!(\"{kind} returned an unsafe absolute path: {path:?}\");\n    }\n    Ok(path.to_string())\n}\n\nfn validate_install_mise_path(path: &str) -> Result<()> {\n    validate_value(\"mise install path\", path)?;\n    if path.contains(['\\n', '\\r']) {\n        bail!(\"install_mise must not contain a newline: {path:?}\");\n    }\n    if !path.starts_with('/') && !path.starts_with(\"~/\") {\n        bail!(\"install_mise must be an absolute path or start with ~/: {path:?}\");\n    }\n    if path.split('/').any(|component| component == \"..\") {\n        bail!(\"install_mise must not contain '..': {path:?}\");\n    }\n    if matches!(\n        path.rsplit('/').next(),\n        None | Some(\"\") | Some(\".\") | Some(\"~\")\n    ) {\n        bail!(\"install_mise must name an executable file: {path:?}\");\n    }\n    Ok(())\n}\n\nfn validate_remote_executable(command: &str) -> Result<()> {\n    validate_value(\"mise command\", command)?;","sourceCodeStart":2198,"sourceCodeEnd":2234,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/remote.rs#L2198-L2234","documentation":"The configured `install_mise` path (where mise should be installed on a remote host) is validated by `validate_install_mise_path`. Because the path is embedded into remote shell commands, any embedded newline or carriage return would break or hijack the command line, so mise rejects it with this error.","triggerScenarios":"`install_mise` in the remote configuration contains a literal '\\n' or '\\r' (multi-line TOML string, accidental line continuation, or CRLF pasted from a Windows editor).","commonSituations":"Hand-edited remote.toml with a wrapped/multi-line path value; config generated by a script joining strings with newline separators; copy-paste from documentation including a line break.","solutions":["Edit the config so install_mise is a single-line path string (use single-quoted TOML literal strings to avoid escape surprises)","Remove trailing whitespace/newlines from the value (e.g. strip the value where it is generated)","Re-run after fixing; the path must be one contiguous line like '/usr/local/bin/mise' or '~/bin/mise'"],"exampleFix":"// before\ninstall_mise = \"\"\"\n/usr/local/bin/mise\n\"\"\"\n// after\ninstall_mise = '/usr/local/bin/mise'","handlingStrategy":"validation","validationCode":"if (/[\\n\\r]/.test(installMise)) throw new Error('install_mise must be a single line');","typeGuard":"const isSingleLinePath = (s: unknown): s is string =>\n  typeof s === 'string' && !/[\\n\\r]/.test(s);","tryCatchPattern":"try {\n  validate_install_mise_path(cfg.install_mise)?;\n} catch (e) {\n  // surface config file + line for the offending multi-line value\n}","preventionTips":["Use single-quoted TOML literal strings for paths","Never build path values by joining strings with newlines","Lint config files for multi-line string values","Paste paths from a terminal, not rich-text editors"],"tags":["config","path","validation"],"backgroundTag":"invalid-config-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"}