{"record":{"id":"b84ca6b3dafb2d5d","repo":"jdx/mise","slug":"failed-to-split-activation-flags","errorCode":null,"errorMessage":"failed to split activation flags","messagePattern":"failed to split activation flags","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/shell/bash.rs","lineNumber":25,"sourceCode":"use crate::env;\nuse crate::shell::{self, ActivateOptions, Shell};\n\n#[derive(Default)]\npub(super) struct Bash {}\n\nimpl Bash {}\n\nfn render_template(template: &str, replacements: &[(&str, &str)]) -> String {\n    let mut out = template.to_owned();\n    for (needle, value) in replacements {\n        out = out.replace(needle, value);\n    }\n    out\n}\n\nfn render_flags_array(value: &str) -> String {\n    shell_words::split(value)\n        .expect(\"failed to split activation flags\")\n        .into_iter()\n        .map(|word| escape(word.into()).to_string())\n        .collect::<Vec<_>>()\n        .join(\" \")\n}\n\nimpl Shell for Bash {\n    fn activate(&self, opts: ActivateOptions) -> String {\n        let exe = opts.exe;\n        let settings = Settings::get();\n\n        let exe = exe.to_string_lossy();\n        let exe = escape(crate::windows_posix::executable_for_shell(&exe));\n        let flags = render_flags_array(&opts.flags);\n\n        let mut out = String::new();\n\n        out.push_str(&shell::build_deactivation_script(self));","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/shell/bash.rs#L7-L43","documentation":"mise panics in bash activation rendering (src/shell/bash.rs render_flags_array) when the configured activation flags string cannot be tokenized by shell_words::split. The flags value is expected to be a shell-parseable list of words; unbalanced quotes or an unterminated escape sequence make it unparseable, so instead of emitting a broken shell snippet, mise fails fast.","triggerScenarios":"MISE_ACTIVATION_FLAGS or the corresponding setting contains unbalanced quotes, trailing backslash, or other input shell_words::split rejects, while rendering the bash activate script.","commonSituations":"Users copy-pasting flags with curly/smart quotes; setting flags like --no-modify-path' without a closing quote; CI env vars interpolated with stray spaces or quotes into the flags value.","solutions":["Fix the activation flags value: ensure balanced quotes and no trailing backslashes (e.g. MISE_ACTIVATION_FLAGS=\"--quiet --no-modify-path\").","Unset the flags variable/setting to fall back to defaults: unset MISE_ACTIVATION_FLAGS or remove it from settings.toml.","Inspect the exact value with echo \"$MISE_ACTIVATION_FLAGS\" | cat -A to reveal hidden or mismatched quote characters."],"exampleFix":"// before\nexport MISE_ACTIVATION_FLAGS=\"--quiet --status'\"\n// after\nexport MISE_ACTIVATION_FLAGS=\"--quiet --status\"","handlingStrategy":"validation","validationCode":"# shell check before exporting\necho \"$MISE_ACTIVATION_FLAGS\" | tr \" '\" '\\n' | awk 'NR%2==0{exit 1}' || echo \"unbalanced quotes\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep MISE_ACTIVATION_FLAGS a simple space-separated list without quotes.","Avoid smart quotes when pasting flags into shell profiles or CI config.","Test activation changes in a fresh shell before committing them to dotfiles."],"tags":["shell","bash","activation","quoting"],"backgroundTag":"invalid-argument-format","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}