← Back to blog

Bash REPL Tools: Comparing Shells and Enhancements

· 5 min read · Stew Team
bashreplshellzshfish

The default bash REPL is powerful, but alternatives and enhancements can boost productivity. This comparison helps you choose the right interactive shell setup.

For bash REPL fundamentals, see our complete bash REPL guide.

Bash: The Standard

Bash is the default REPL on most Linux systems.

Strengths

  • Universal: Available everywhere
  • Scripting compatibility: Scripts work as expected
  • Stable: Decades of production use
  • Documentation: Extensive resources

Default Features

# Tab completion
ls /etc/sys<TAB>

# History search
Ctrl+R

# Command editing
Ctrl+A, Ctrl+E, Ctrl+K

# Job control
Ctrl+Z, bg, fg

Limitations

  • Basic autosuggestions
  • Limited out-of-box completion
  • Dated syntax for some features

Zsh: Bash Enhanced

Zsh is bash-compatible with better interactive features.

Key Improvements

# Better globbing
ls **/*.json  # Recursive

# Spelling correction
$ gti status
# zsh: correct 'gti' to 'git'? [y/n]

# Extended history
setopt EXTENDED_HISTORY
setopt SHARE_HISTORY

# Right-side prompt
RPROMPT='%T'  # Shows time on right

Oh My Zsh

Popular framework for zsh configuration:

# Install
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Enable plugins in ~/.zshrc
plugins=(git docker kubectl aws)
PluginPurpose
zsh-autosuggestionsFish-like suggestions
zsh-syntax-highlightingCommand highlighting
zsh-completionsExtra completions
fzf-tabFuzzy tab completion

Zsh Configuration

# ~/.zshrc
# History
HISTSIZE=50000
SAVEHIST=50000
setopt HIST_IGNORE_DUPS
setopt HIST_FIND_NO_DUPS

# Completion
autoload -Uz compinit && compinit
zstyle ':completion:*' menu select

# Key bindings (emacs style)
bindkey -e

Fish: Modern Interactive Shell

Fish prioritizes interactive use over POSIX compatibility.

Standout Features

# Autosuggestions (built-in, no plugin)
# Type partial command, see gray suggestion
# Press → to accept

# Syntax highlighting (built-in)
# Valid commands: blue
# Invalid commands: red

# Web-based configuration
fish_config

Smart Completions

# Parses man pages automatically
git checkout <TAB>
# Shows branches with descriptions

# Understands command options
rsync --<TAB>
# Shows all options with help text

Fish Syntax Differences

# Variables
set MY_VAR "value"  # Not MY_VAR="value"

# Conditionals
if test -f file.txt
    echo "exists"
end

# Command substitution
set files (ls)  # Not $(ls)

Fisher Plugin Manager

# Install fisher
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher

# Popular plugins
fisher install jethrokuan/z        # Directory jumping
fisher install PatrickF1/fzf.fish  # Fzf integration

When to Avoid Fish

  • Scripts must be fish-specific
  • Some tools assume bash
  • Muscle memory from bash/zsh

Enhancement Tools

These work with any shell.

Fzf: Fuzzy Finder

Transform your REPL with fuzzy finding:

# Install
brew install fzf  # or apt install fzf

# Enable key bindings
$(brew --prefix)/opt/fzf/install

# Now available:
Ctrl+R  # Fuzzy history search
Ctrl+T  # Fuzzy file finder
Alt+C   # Fuzzy directory jump

Starship: Universal Prompt

Fast, customizable prompt for any shell:

# Install
curl -sS https://starship.rs/install.sh | sh

# Enable in ~/.bashrc
eval "$(starship init bash)"

# Or ~/.zshrc
eval "$(starship init zsh)"

# Or ~/.config/fish/config.fish
starship init fish | source

Zoxide: Smarter cd

Jump to directories by frecency:

# Install
curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash

# Usage
z project  # Jump to most used directory matching "project"
zi         # Interactive selection with fzf

Atuin: Better History

Sync and search shell history across machines:

# Install
curl https://raw.githubusercontent.com/atuinsh/atuin/main/install.sh | bash

# Features
# - Full-text search
# - Sync across machines
# - Statistics
# - Context (directory, exit code, duration)

Comparison Table

FeatureBashZshFish
POSIX compatible
UbiquitousCommonRare
AutosuggestionsPluginPluginBuilt-in
Syntax highlightingPluginPluginBuilt-in
Tab completionBasicGoodExcellent
Learning curveBaselineLowMedium
ScriptingStandardStandardDifferent

Minimalist (Bash + Enhancements)

# ~/.bashrc
eval "$(starship init bash)"
eval "$(zoxide init bash)"
source /usr/share/fzf/key-bindings.bash

Power User (Zsh + Oh My Zsh)

# ~/.zshrc
plugins=(git docker kubectl fzf zsh-autosuggestions zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
eval "$(starship init zsh)"
eval "$(zoxide init zsh)"

Modern (Fish)

# ~/.config/fish/config.fish
starship init fish | source
zoxide init fish | source

# Plugins via fisher
fisher install jethrokuan/z
fisher install PatrickF1/fzf.fish

The REPL Limitation

Regardless of shell, the REPL has the same problem: sessions are ephemeral. Your carefully crafted commands disappear when you close the terminal.

Beyond the REPL: Executable Documentation

Stew captures your REPL workflows as permanent, executable documentation. Whatever shell you use locally, your runbooks become shareable team knowledge.

# Server Diagnostics

## Check system load
​```bash
uptime
​```

## Memory usage
​```bash
free -h
​```

## Disk space
​```bash
df -h
​```

Run commands with a click. See output inline. Share across your team.

Join the waitlist and make your REPL work permanent.