{"record":{"id":"4a86151d192a59dd","repo":"can1357/oh-my-pi","slug":"unsupported-shell-shell-shell-su","errorCode":null,"errorMessage":"Unsupported shell${shell ? ` \"${shell}\"` : \"\"}. Supported shells: bash, zsh, fish, PowerShell.","messagePattern":"Unsupported shell(.+?)\"` : \"\"\\}\\. Supported shells: bash, zsh, fish, PowerShell\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/profile-alias.ts","lineNumber":196,"sourceCode":"\treturn \"powershell\";\n}\n\nfunction normalizeShellName(\n\tshellPath: string | undefined,\n\tplatform: NodeJS.Platform,\n\tenv: NodeJS.ProcessEnv,\n): ProfileAliasShell {\n\tconst shell = path\n\t\t.basename(shellPath ?? \"\")\n\t\t.toLowerCase()\n\t\t.replace(/\\.exe$/, \"\");\n\tif (shell === \"zsh\") return \"zsh\";\n\tif (shell === \"bash\") return \"bash\";\n\tif (shell === \"fish\") return \"fish\";\n\tif (shell === \"pwsh\") return \"pwsh\";\n\tif (shell === \"powershell\") return \"powershell\";\n\tif (platform === \"win32\") return detectWindowsPowerShell(env);\n\tthrow new Error(`Unsupported shell${shell ? ` \"${shell}\"` : \"\"}. Supported shells: bash, zsh, fish, PowerShell.`);\n}\n\n/** Resolve the command a generated profile alias should invoke. */\nexport function resolveProfileAliasCommandFromProcess({\n\targv = process.argv,\n\tcwd = process.cwd(),\n\tcompiled = process.env.PI_COMPILED === \"true\",\n}: ProfileAliasProcessOptions = {}): ProfileAliasCommand {\n\tif (compiled) return DEFAULT_ALIAS_COMMAND;\n\n\tconst runtime = argv[0];\n\tconst script = argv[1];\n\tif (!runtime || !script || !/\\.[cm]?[jt]s$/.test(script)) return DEFAULT_ALIAS_COMMAND;\n\n\tconst scriptPath = path.resolve(cwd, script);\n\t// Normalize to forward slashes for POSIX shell fields — bash/zsh/fish\n\t// can't resolve backslash-separated paths, even on Windows (Git Bash, WSL).\n\tconst posixScriptPath = scriptPath.replace(/\\\\/g, \"/\");","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/profile-alias.ts#L178-L214","documentation":"normalizeShellName cannot map the provided shell to a supported profile generator. Supported values are bash, zsh, fish, pwsh, and powershell; on Windows with no explicit shell it auto-detects the PowerShell edition. When the value is missing entirely the message omits the quoted name.","triggerScenarios":"Calling installProfileAlias with --shellPath or $SHELL set to an unsupported shell (e.g. /bin/dash, /usr/bin/nu, cmd.exe), or a non-Windows environment where SHELL is unset/empty and no shell override is provided.","commonSituations":"Users on exotic shells (nushell, elvish, tcsh) or minimal containers/dockers where $SHELL is not exported; Windows users whose SHELL points at a POSIX shell not in the list.","solutions":["Pass an explicit supported shell via the shell option, e.g. `--shell bash` / zsh / fish / pwsh / powershell","Install or point $SHELL at a supported shell before running --alias","On Windows, rely on auto-detection by not overriding the shell, or explicitly use pwsh/powershell","Manually append the generated alias block to your shell config if your shell is genuinely unsupported"],"exampleFix":"// before (SHELL=/usr/bin/fish-like nu)\nomp --profile work --alias work\n// after\nomp --profile work --alias work --shell bash","handlingStrategy":"fallback","validationCode":"const SUPPORTED = new Set([\"bash\", \"zsh\", \"fish\", \"pwsh\", \"powershell\"]);\nconst shell = (shellPath ?? process.env.SHELL ?? \"\").split(\"/\").pop() ?? \"\";\nif (!SUPPORTED.has(shell) && process.platform !== \"win32\") {\n  throw new Error(`Shell \"${shell}\" unsupported; pass --shell bash|zsh|fish|pwsh|powershell`);\n}","typeGuard":"function isSupportedShell(name: string | undefined): boolean {\n  return !!name && [\"bash\", \"zsh\", \"fish\", \"pwsh\", \"powershell\"].includes(name.toLowerCase());\n}","tryCatchPattern":"try {\n  await installProfileAlias(options);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Unsupported shell\")) {\n    // fall back to manual instructions or a supported default\n    console.error(`${err.message}\\nAppending the alias block manually to your shell config instead.`);\n    return;\n  }\n  throw err;\n}","preventionTips":["Export a supported $SHELL in containers/CI images, or pass an explicit --shell value","On Windows, omit the shell override so the tool auto-detects pwsh vs powershell","For unsupported shells (nu, elvish, tcsh), write the alias into your config by hand instead of using --alias"],"tags":["cli","shell","unsupported","environment"],"backgroundTag":"unsupported-shell","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}