Skip to content

Shell Detection for Non-POSIX Shells (Nushell, Fish) #51

@ramarivera

Description

@ramarivera

Summary

ClaudeBar's binary locator should support users whose default shell is Nushell, Fish, or other non-POSIX shells.

Problem

BinaryLocator currently assumes POSIX shell syntax when running which and reading $PATH. Users with Nushell as their login shell experience failures because:

  • Nushell's built-in which outputs tables instead of plain paths
  • Nushell uses $env.PATH (a list) instead of $PATH (a colon-separated string)

This prevents ClaudeBar from finding CLI tools installed via nix-darwin, Homebrew, or other package managers for Nushell users.

Proposed Solution

Introduce a Shell enum that encapsulates shell-specific behavior:

  1. Detect shell type from $SHELL environment variable
  2. Generate appropriate which command syntax per shell
  3. Generate appropriate PATH retrieval command per shell
  4. Parse shell-specific output formats

Supported Shells

Shell which Command PATH Command
POSIX (bash, zsh) which <tool> echo $PATH
Fish which <tool> echo $PATH
Nushell ^which <tool> $env.PATH | str join ':'

Acceptance Criteria

  • Shell type detected from $SHELL environment variable
  • Nushell users can locate CLI tools correctly
  • Fish users can locate CLI tools correctly
  • POSIX shells continue to work as before
  • Unknown shells default to POSIX behavior
  • Unit tests cover all shell types and parsing scenarios

🤖 This issue was generated with AI assistance using Claude Opus 4.5 (latest).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions