mislav/hub · error

hub alias: unsupported shell supported shells: %s

Error message

hub alias: unsupported shell
supported shells: %s

What it means

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.

Source

Thrown at commands/alias.go:64

		cmd := "hub alias <shell>"
		if flagAliasScript {
			cmd = "hub alias -s <shell>"
		}
		utils.Check(fmt.Errorf("Error: couldn't detect shell type. Please specify your shell with `%s`", cmd))
	}

	shells := []string{"bash", "zsh", "sh", "ksh", "csh", "tcsh", "fish", "rc"}
	shell = filepath.Base(shell)
	var validShell bool
	for _, s := range shells {
		if s == shell {
			validShell = true
			break
		}
	}

	if !validShell {
		err := fmt.Errorf("hub alias: unsupported shell\nsupported shells: %s", strings.Join(shells, " "))
		utils.Check(err)
	}

	if flagAliasScript {
		var alias string
		switch shell {
		case "csh", "tcsh":
			alias = "alias git hub"
		case "rc":
			alias = "fn git { builtin hub $* }"
		default:
			alias = "alias git=hub"
		}

		ui.Println(alias)
	} else {
		var profile string
		switch shell {

View on GitHub (pinned to 5c547ed804)

Solutions

  1. 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.
  2. If your shell is bash-compatible, generate bash output and source it: eval "$(hub alias -s bash)".
  3. Define the alias manually in your shell's config: alias git=hub (plus shell-specific completion setup).

Example fix

// before (nushell)
hub alias nu   # unsupported shell
// after — use bash-compatible output and translate
hub alias -s bash
Defensive patterns

Strategy: validation

Validate before calling

supported="bash zsh sh ksh csh tcsh fish rc"
sh=$(basename "${SHELL:-bash}")
echo "$supported" | grep -qw "$sh" || sh=bash
eval "$(hub alias -s "$sh")"

Prevention

When it happens

Trigger: 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.

Common situations: 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`.

Related errors


AI-assisted analysis of mislav/hub@5c547ed804 (2026-09-01). Data as JSON: /api/errors/fcb8af00f621ae78. Report an issue: GitHub.