shellx

ShellX Shell Compatibility Guide

Overview

ShellX is designed to work with Bash 4.0+ and Zsh 4.0+. While basic sourcing of ShellX may work in other shells, full functionality requires one of these supported shells.

Supported Shells

✅ Bash 4.0 or Higher

✅ Zsh 4.0 or Higher

Partially Supported / Unsupported Shells

⚠️ POSIX sh

❌ Fish Shell

❌ 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

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

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 or Zsh:
    chsh -s /bin/zsh      # Set default shell to Zsh
    # or
    chsh -s /usr/local/bin/bash  # Set default shell to Bash (if Homebrew installed)
    
  2. Restart your terminal for changes to take effect

  3. Source ShellX in your new shell’s rc file (.bashrc or .zshrc)

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.