shellx

ShellX Shell Compatibility Guide

Overview

ShellX is designed to work with Bash 4.0+, Zsh 4.0+, and Fish 3.2+. Bash and Zsh are natively supported. Fish Shell is supported via a dedicated shellx.fish bootstrap file.

Supported Shells

✅ Bash 4.0 or Higher

✅ Zsh 4.0 or Higher

✅ Fish 3.2 or Higher

Fish Setup

  1. Add SHELLX_HOME and source shellx.fish in ~/.config/fish/config.fish:

    set -gx SHELLX_HOME /path/to/.shellx
    source $SHELLX_HOME/shellx.fish
    
  2. (Optional) Install bass for full environment propagation:

    # With Fisher
    fisher install edc/bass
    
  3. To silence the basic-mode notice without installing bass:

    set -gx SHELLX_FISH_QUIET 1
    

Partially Supported / Unsupported Shells

⚠️ POSIX sh

❌ Ksh (Korn Shell)

Why Bash/Zsh?

ShellX uses several advanced shell features that are only available in Bash 4+ and Zsh:

  1. Associative Arrays: For managing plugin metadata and configuration
    • Bash: declare -A my_array
    • Zsh: typeset -A my_array
    • POSIX sh: ❌ Not available
  2. Array Operations: For iterating and manipulating plugin lists
    • Bash: for item in "${array[@]}"; do ...
    • Zsh: for item in "${array[@]}"; do ...
    • POSIX sh: ❌ Not available
  3. String Parameter Expansion: Advanced variable manipulation
    • Bash/Zsh: Full support for ${var:offset:length}, ${var//pattern/replacement}, etc.
    • POSIX sh: Limited support

Checking Your Shell Compatibility

Check Your Current Shell

echo $SHELL
# or
echo $0

Check Your Shell Version

# Bash
bash --version

# Zsh
zsh --version

# Fish
fish --version

Test ShellX Compatibility

When ShellX loads, it will check your shell automatically:

# If using a non-compatible shell, you'll see:
# ShellX: WARNING - This shell may not be fully compatible with ShellX.
# ShellX: Requires Bash 4+ or Zsh for full functionality.
# ShellX: Current shell: /bin/sh

# If Fish is detected on a wrong entrypoint, you'll see:
# ShellX: Fish Shell detected. Source shellx.fish instead of shellx.sh.
# ShellX: Add to ~/.config/fish/config.fish:
# ShellX:   source /path/to/.shellx/shellx.fish

Linux

macOS

# Install Bash 4+ on macOS
brew install bash

# Add to ~/.zshrc or ~/.bashrc
export SHELL=$(which bash)  # if using Bash

Migration from Unsupported Shells

If you’re currently using an unsupported shell:

  1. Switch to Bash, Zsh, or Fish:
    chsh -s /bin/zsh                   # Set default shell to Zsh
    # or
    chsh -s /usr/local/bin/bash        # Set default shell to Bash (Homebrew)
    # or
    chsh -s /usr/local/bin/fish        # Set default shell to Fish (Homebrew)
    
  2. Restart your terminal for changes to take effect

  3. Source ShellX in your new shell’s rc file:
    • Bash: add source /path/to/shellx.sh to .bashrc
    • Zsh: add source /path/to/shellx.sh to .zshrc
    • Fish: add source /path/to/shellx.fish to ~/.config/fish/config.fish

Troubleshooting

“ShellX: WARNING - This shell may not be fully compatible”

Plugin features not working

ShellX loads but no plugins appear

Future Compatibility Plans

ShellX may consider alternative data storage mechanisms (YAML, JSON files) to reduce array dependency, but this would require significant refactoring and is not planned in the near term.