{"record":{"id":"270d9df9fcdf83dc","repo":"JanDeDobbeleer/oh-my-posh","slug":"unsupported-shell-type-s","errorCode":null,"errorMessage":"unsupported shell type: %s","messagePattern":"unsupported shell type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dsc/shell.go","lineNumber":121,"sourceCode":"\n\t\treturn filepath.Join(home, \".bash_profile\"), nil\n\tcase shell.ZSH:\n\t\treturn filepath.Join(home, \".zshrc\"), nil\n\tcase shell.FISH:\n\t\tconfigDir := filepath.Join(home, \".config\", \"fish\")\n\t\treturn filepath.Join(configDir, \"config.fish\"), nil\n\tcase shell.PWSH:\n\t\treturn cmd.Run(s.Name, \"-NoProfile\", \"-Command\", \"$PROFILE\")\n\tcase shell.NU:\n\t\treturn cmd.Run(\"nu\", \"-c\", \"$nu.config-path\")\n\tcase shell.ELVISH:\n\t\treturn filepath.Join(home, \".elvish\", \"rc.elv\"), nil\n\tcase shell.XONSH:\n\t\treturn filepath.Join(home, \".xonshrc\"), nil\n\tcase shell.YASH:\n\t\treturn filepath.Join(home, \".yashrc\"), nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unsupported shell type: %s\", s.Name)\n\t}\n}\n\nfunc (s *Shell) validateShellConfigPath(configPath string) error {\n\tlog.Debug(\"validating shell config path:\", configPath)\n\n\t_, err := os.Stat(configPath)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\tif !os.IsNotExist(err) {\n\t\treturn nil\n\t}\n\n\tlog.Debug(\"shell config file does not exist\")\n\n\tif err := os.MkdirAll(filepath.Dir(configPath), 0755); err != nil {","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/cli/dsc/shell.go#L103-L139","documentation":"getShellConfigPath falls through to its default branch when the Shell resource's Name does not match any supported shell constant, returning this error. It protects against writing an init line into the wrong file for an unknown shell. The unsupported value is included in the message.","triggerScenarios":"Applying a DSC Shell resource whose `name` field is empty, typoed (\"ZSH \" with whitespace, \"powerShell\", \"cmd\"), or names a shell oh-my-posh does not configure rc files for (e.g. cmd, tcsh).","commonSituations":"Hand-edited DSC documents; uppercase or differently spelled shell names; shells like cmd that have no rc file support; an old DSC document using a shell name that changed between versions.","solutions":["Set `name` to one of the supported values exactly: bash, zsh, fish, pwsh, nu, elvish, xonsh, yash (lowercase, no extra spaces)","If the desired shell has no rc-file support (e.g. cmd), configure it manually instead of via the DSC shell resource","Trim whitespace and normalize case in the DSC document","Check the release notes if a shell name changed between oh-my-posh versions"],"exampleFix":"// before\n{ \"name\": \"PowerShell\", \"command\": \"oh-my-posh init pwsh\" }\n// after\n{ \"name\": \"pwsh\", \"command\": \"oh-my-posh init pwsh\" }","handlingStrategy":"validation","validationCode":"var supported = map[string]bool{\n    \"bash\": true, \"zsh\": true, \"fish\": true, \"pwsh\": true,\n    \"nu\": true, \"elvish\": true, \"xonsh\": true, \"yash\": true,\n}\nname := strings.ToLower(strings.TrimSpace(shellName))\nif !supported[name] {\n    return fmt.Errorf(\"shell %q is not supported; use one of bash, zsh, fish, pwsh, nu, elvish, xonsh, yash\", shellName)\n}","typeGuard":null,"tryCatchPattern":"if err := sh.Apply(); err != nil {\n    if strings.Contains(err.Error(), \"unsupported shell type\") {\n        return fmt.Errorf(\"correct the `name` field in the DSC document: %w\", err)\n    }\n    return err\n}","preventionTips":["Use exact lowercase shell names from oh-my-posh's supported list","Normalize/trim user-supplied shell names before writing them into DSC documents","For shells without rc-file support (e.g. cmd), configure manually instead of using the DSC shell resource","Validate DSC documents against shell.schema.json before applying"],"tags":["validation","dsc","shell","unsupported-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}