{"record":{"id":"d4e000cb80bb8a24","repo":"jdx/mise","slug":"loads-completions-eagerly-so-mise-cannot-leave","errorCode":null,"errorMessage":"{} loads completions eagerly, so mise cannot leave it a stub; redirect `mise completion {} --tool {tool}` yourself","messagePattern":"(.+?) loads completions eagerly, so mise cannot leave it a stub; redirect `mise completion (.+?) --tool (.+?)` yourself","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/packslip.rs","lineNumber":1769,"sourceCode":"    $global:{loader}_busy = $true\n    try {{\n        $__mise_script = @(& mise completion powershell --tool '{tool}' 2>$null) -join \"`n\"\n        if ($__mise_script) {{\n            Invoke-Expression $__mise_script\n            $__mise_cursor = $cursorPosition - $commandAst.Extent.StartOffset\n            $__mise_line = $commandAst.Extent.Text.PadRight([Math]::Max($commandAst.Extent.Text.Length, $__mise_cursor))\n            (TabExpansion2 -inputScript $__mise_line -cursorColumn $__mise_cursor).CompletionMatches\n        }}\n    }} finally {{\n        Register-ArgumentCompleter -Native -CommandName '{tool}' -ScriptBlock $function:{loader}\n        $global:{loader}_busy = $false\n    }}\n}}\nRegister-ArgumentCompleter -Native -CommandName '{tool}' -ScriptBlock $function:{loader}\n\"#\n        ),\n        _ => bail!(\n            \"{} loads completions eagerly, so mise cannot leave it a stub; redirect `mise completion {} --tool {tool}` yourself\",\n            shell.as_str(),\n            shell.as_str()\n        ),\n    };\n    Ok(stub)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[tokio::test]\n    async fn test_fetch_text_returns_the_body_of_a_reachable_url() {\n        let _config = crate::config::Config::get().await.unwrap();\n        let mut server = mockito::Server::new_async().await;\n        let mock = server\n            .mock(\"GET\", \"/packslip.sigstore.json\")\n            .with_status(200)","sourceCodeStart":1751,"sourceCodeEnd":1787,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/packslip.rs#L1751-L1787","documentation":"mise can emit lazy 'stub' completion scripts that defer to `mise completion` at runtime only for shells it knows how to stub (bash/zsh/fish style deferral). For other shells the packslip tool loads its full completion script eagerly, so mise refuses to install a stub and tells the user to set up the redirect themselves. It is an explicit unsupported-shell guard, not a bug.","triggerScenarios":"Calling `mise completion <shell> --tool <tool>` (or stub installation during tool install) with a shell outside the stub-supported set, e.g. powershell/nushell, where the packslip tool's completions load eagerly.","commonSituations":"Using PowerShell or an exotic shell with a packslip-installed tool; scripted dotfile setup that assumes stubs work everywhere; shell migration where the old shell's stub was auto-generated but the new one is not.","solutions":["Add a redirect in your shell config yourself: alias or function so `<tool>` completion loads via `mise completion <shell> --tool <tool>`","Use a stub-supported shell (bash, zsh, fish) for that tool's completions","Load the tool's native completion script directly in your shell config instead of relying on mise's stub","Check mise docs for the current list of stub-capable shells"],"exampleFix":"// before (PowerShell $PROFILE relying on mise stub)\nmise completion pwsh --tool gh   # errors: cannot leave stub\n// after (register the loader yourself)\nRegister-ArgumentCompleter -Native -CommandName 'gh' -ScriptBlock (mise completion pwsh --tool gh | Out-String | Invoke-Expression)","handlingStrategy":"fallback","validationCode":"case \"$(basename $SHELL)\" in bash|zsh|fish) echo 'stub supported';; *) echo 'manual redirect required';; esac","typeGuard":null,"tryCatchPattern":"match mise::packslip::stub(shell, tool) {\n    Ok(stub) => write_stub(stub),\n    Err(_) => write_manual_redirect(shell, tool), // Register-ArgumentCompleter / equivalent\n}","preventionTips":["Only script stub installation for bash/zsh/fish","For PowerShell/nushell, wire the completion loader in your profile yourself","Keep mise updated — the stub-capable shell set may expand"],"tags":["cli","completions","packslip","shell","unsupported"],"backgroundTag":"unsupported-operation","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"}