{"record":{"id":"fcb8af00f621ae78","repo":"mislav/hub","slug":"hub-alias-unsupported-shell-supported-shells-s","errorCode":null,"errorMessage":"hub alias: unsupported shell\nsupported shells: %s","messagePattern":"hub alias: unsupported shell\nsupported shells: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"commands/alias.go","lineNumber":64,"sourceCode":"\t\tcmd := \"hub alias <shell>\"\n\t\tif flagAliasScript {\n\t\t\tcmd = \"hub alias -s <shell>\"\n\t\t}\n\t\tutils.Check(fmt.Errorf(\"Error: couldn't detect shell type. Please specify your shell with `%s`\", cmd))\n\t}\n\n\tshells := []string{\"bash\", \"zsh\", \"sh\", \"ksh\", \"csh\", \"tcsh\", \"fish\", \"rc\"}\n\tshell = filepath.Base(shell)\n\tvar validShell bool\n\tfor _, s := range shells {\n\t\tif s == shell {\n\t\t\tvalidShell = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif !validShell {\n\t\terr := fmt.Errorf(\"hub alias: unsupported shell\\nsupported shells: %s\", strings.Join(shells, \" \"))\n\t\tutils.Check(err)\n\t}\n\n\tif flagAliasScript {\n\t\tvar alias string\n\t\tswitch shell {\n\t\tcase \"csh\", \"tcsh\":\n\t\t\talias = \"alias git hub\"\n\t\tcase \"rc\":\n\t\t\talias = \"fn git { builtin hub $* }\"\n\t\tdefault:\n\t\t\talias = \"alias git=hub\"\n\t\t}\n\n\t\tui.Println(alias)\n\t} else {\n\t\tvar profile string\n\t\tswitch shell {","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/mislav/hub/blob/5c547ed804368763064e51f3990851e267e88edd/commands/alias.go#L46-L82","documentation":"After detecting (or being told) the shell, `hub alias` validates it against a whitelist: bash, zsh, sh, ksh, csh, tcsh, fish, rc (comparing filepath.Base of the shell). If the shell isn't in that list it errors with this message listing the supported shells, then exits via utils.Check.","triggerScenarios":"Running `hub alias <shell>` (or implicit detection via $SHELL) with a shell outside the whitelist, e.g. `hub alias nushell`, or SHELL=/usr/bin/nu / elvish / powershell / xonsh.","commonSituations":"Users of modern shells (nushell, elvish, xonsh, PowerShell) trying to generate the alias; SHELL pointing to a shell with an unusual name or full path whose basename isn't recognized; typos like `hub alias zsh5`.","solutions":["Use one of the supported shells: bash, zsh, sh, ksh, csh, tcsh, fish, or rc — e.g. `hub alias -s bash` and adapt the output.","If your shell is bash-compatible, generate bash output and source it: eval \"$(hub alias -s bash)\".","Define the alias manually in your shell's config: alias git=hub (plus shell-specific completion setup)."],"exampleFix":"// before (nushell)\nhub alias nu   # unsupported shell\n// after — use bash-compatible output and translate\nhub alias -s bash","handlingStrategy":"validation","validationCode":"supported=\"bash zsh sh ksh csh tcsh fish rc\"\nsh=$(basename \"${SHELL:-bash}\")\necho \"$supported\" | grep -qw \"$sh\" || sh=bash\neval \"$(hub alias -s \"$sh\")\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only request alias output for whitelisted shells (bash zsh sh ksh csh tcsh fish rc).","For modern shells (nushell, elvish), hand-write `alias git=hub` using bash output as a base.","Use basename of $SHELL, not the full path."],"tags":["shell","configuration","cli"],"backgroundTag":"unsupported-shell","analyzedSha":"5c547ed804368763064e51f3990851e267e88edd","analyzedAt":"2026-09-01T03:34:15.525Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}