Skip to main content

Shell Selection & Configuration

Learn about different shells available in Xermius Local Terminal, how to choose the right one, and configure it for your workflow.

What is a Shell?

Simple Explanation: A shell is the program that interprets your commands and talks to the operating system. It's the "language" you use in the terminal.

Analogy:

You → Shell → Operating System → Hardware

Like a translator between you and the computer!

Popular Shells:

  • Bash (most common)
  • Zsh (modern, powerful)
  • Fish (user-friendly)
  • PowerShell (Windows-native)

Available Shells

1. Bash (Bourne Again Shell)

Overview:

✅ Most widely used
✅ Universal compatibility
✅ Huge ecosystem
✅ Default on many systems

Best for:

  • General purpose use
  • Shell scripting
  • Maximum compatibility
  • Learning Unix/Linux

Version check:

bash --version
# GNU bash, version 5.2.15

Key Features:

  • Command history
  • Tab completion
  • Job control
  • Aliases and functions
  • Script automation

Example session:

# Bash prompt
user@computer:~$

# Use wildcards
ls *.txt

# Command substitution
echo "Today is $(date)"

# Pipes and redirection
cat file.txt | grep "search" > results.txt

2. Zsh (Z Shell)

Overview:

✅ Enhanced features
✅ Better autocomplete
✅ Plugin ecosystem (oh-my-zsh)
✅ Default on macOS (since Catalina)

Best for:

  • Power users
  • Advanced customization
  • Plugin lovers
  • Modern development

Version check:

zsh --version
# zsh 5.9

Key Features:

  • Advanced tab completion
  • Spelling correction
  • Theme support
  • Plugin system (oh-my-zsh)
  • Better globbing
  • Shared history

Example session:

# Zsh prompt (with oh-my-zsh)
➜ ~

# Advanced completion
git che<TAB>
# Shows: checkout, cherry, cherry-pick

# Spelling correction
$ mkdri newdir
zsh: correct 'mkdri' to 'mkdir' [nyae]?

# Better globbing
ls **/*.js # Recursive search

# Plugin features (with oh-my-zsh)
gst # Alias for git status
gaa # Alias for git add --all

oh-my-zsh:

# Install oh-my-zsh (in local terminal)
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Edit config
nano ~/.zshrc

# Change theme
ZSH_THEME="agnoster"

# Enable plugins
plugins=(git node npm docker kubectl)

# Reload
source ~/.zshrc

3. Fish (Friendly Interactive Shell)

Overview:

✅ Very user-friendly
✅ Syntax highlighting
✅ Autosuggestions
✅ Web-based configuration

Best for:

  • Beginners
  • Interactive use
  • Modern UX
  • Visual feedback

Version check:

fish --version
# fish, version 3.6.1

Key Features:

  • Syntax highlighting (colors)
  • Autosuggestions from history
  • Tab completions from man pages
  • Web-based configuration
  • No configuration needed

Example session:

# Fish prompt
user@computer ~>

# Syntax highlighting (colors as you type)
$ ls -la
↑ Command turns green (valid)

$ lss -la
↑ Command turns red (invalid)

# Autosuggestions (gray text from history)
$ git commit█
$ git commit -m "Update feature"
↑ Suggestion appears as you type
Press → to accept

# Web configuration
$ fish_config
# Opens browser with GUI configuration

Fish configuration:

# Edit config
nano ~/.config/fish/config.fish

# Add alias
alias ll='ls -la'

# Add function
function mkcd
mkdir -p $argv
cd $argv
end

# Save and reload
source ~/.config/fish/config.fish

4. PowerShell

Overview:

✅ Windows-native
✅ Object-based (not text)
✅ .NET integration
✅ Cross-platform (Core)

Best for:

  • Windows users
  • .NET development
  • Windows automation
  • System administration

Version check:

$PSVersionTable.PSVersion
# Major Minor Build Revision
# 7 3 4 0

Key Features:

  • Object pipelines
  • Cmdlets (verb-noun commands)
  • Tab completion
  • Script automation
  • .NET framework access

Example session:

# PowerShell prompt
PS C:\Users\user>

# Object-based commands
Get-Process | Where-Object CPU -gt 100
Get-ChildItem -Recurse -Filter *.txt

# Cmdlet pattern
Get-Help Get-Process
Set-Location C:\Projects
New-Item -Type Directory -Name NewFolder

# Aliases for familiar commands
ls # Alias for Get-ChildItem
pwd # Alias for Get-Location
cd # Alias for Set-Location

Comparison Table

FeatureBashZshFishPowerShell
Ease of Use⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Compatibility⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐ (Windows)
Customization⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Autocomplete⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Speed⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Scripting⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Plugins⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Learning CurveEasyMediumVery EasyMedium
Default OnLinuxmacOS-Windows

Selecting Your Shell

In Xermius Settings

Change default shell:

1. Settings → Terminal → Default Shell
2. Choose from dropdown:
- System Default (recommended)
- Bash
- Zsh
- Fish
- PowerShell
- Custom Path...
3. Save

New local terminals will use selected shell

Per-Terminal Selection

Override for single terminal:

1. New Local Terminal → More Options
2. Select Shell:
- [System Default]
- [Bash]
- [Zsh]
- [Fish]
- [PowerShell]
3. Open

This terminal uses selected shell only

System Default Shell

Check system default:

macOS/Linux:

echo $SHELL
# /bin/bash or /bin/zsh

Change system default (macOS/Linux):

# Change to Zsh
chsh -s /bin/zsh

# Change to Bash
chsh -s /bin/bash

# Change to Fish
chsh -s /usr/local/bin/fish

# Takes effect after logout/login

Windows:

# PowerShell is default
# Can change in Windows Terminal settings

Shell Configuration

Bash Configuration

Config files:

~/.bashrc       # Interactive shells
~/.bash_profile # Login shells (macOS)
~/.bash_aliases # Aliases

Basic configuration:

# Edit ~/.bashrc
nano ~/.bashrc

# Add customizations:

# Prompt
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

# Aliases
alias ll='ls -la'
alias ..='cd ..'
alias gs='git status'

# PATH additions
export PATH="$HOME/.local/bin:$PATH"

# History settings
export HISTSIZE=10000
export HISTFILESIZE=20000

# Save and reload
source ~/.bashrc

Useful additions:

# Colorful ls
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced

# Better history
shopt -s histappend
PROMPT_COMMAND='history -a'

# Case-insensitive completion
bind 'set completion-ignore-case on'

Zsh Configuration

Config file:

~/.zshrc  # Main config

Basic configuration:

# Edit ~/.zshrc
nano ~/.zshrc

# Prompt
PROMPT='%F{green}%n@%m%f:%F{blue}%~%f$ '

# Aliases (same as Bash)
alias ll='ls -la'
alias ..='cd ..'
alias gs='git status'

# Auto-correction
setopt CORRECT
setopt CORRECT_ALL

# History
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.zsh_history

# Save and reload
source ~/.zshrc

With oh-my-zsh:

# Already installed during oh-my-zsh setup
nano ~/.zshrc

# Choose theme
ZSH_THEME="robbyrussell" # Default
# Or: agnoster, powerlevel10k, spaceship, etc.

# Enable plugins
plugins=(
git
docker
kubectl
npm
node
python
vscode
zsh-autosuggestions
zsh-syntax-highlighting
)

# Custom settings
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'

source ~/.zshrc

Fish Configuration

Config file:

~/.config/fish/config.fish

Basic configuration:

# Edit config
nano ~/.config/fish/config.fish

# Aliases
alias ll='ls -la'
alias ..='cd ..'
alias gs='git status'

# Functions
function mkcd
mkdir -p $argv
cd $argv
end

# Environment variables
set -x PATH $HOME/.local/bin $PATH

# Save and reload
source ~/.config/fish/config.fish

Web configuration:

# Open GUI configuration
fish_config

# Configure:
- Theme
- Prompt
- Colors
- Variables
- Functions
- Abbreviations

# Changes saved automatically

PowerShell Configuration

Config file:

$PROFILE  # Shows path
# Usually: C:\Users\user\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

Basic configuration:

# Edit profile
notepad $PROFILE

# Add customizations:

# Aliases
Set-Alias ll Get-ChildItem
Set-Alias g git

# Functions
function mkcd($path) {
New-Item -Type Directory -Path $path
Set-Location $path
}

# Prompt customization
function prompt {
"$env:USERNAME@$env:COMPUTERNAME:$(Get-Location)> "
}

# Save and reload
. $PROFILE

Shell-Specific Tips

Bash Tips

1. Keyboard shortcuts:

Ctrl+A  # Start of line
Ctrl+E # End of line
Ctrl+R # Reverse search
Ctrl+W # Delete word
Ctrl+K # Delete to end

2. Parameter expansion:

# Remove extension
filename="document.pdf"
echo ${filename%.pdf} # document

# Default value
echo ${VAR:-default} # Use default if VAR empty

# String replacement
text="hello world"
echo ${text/world/bash} # hello bash

3. Here documents:

cat << EOF > file.txt
Line 1
Line 2
Line 3
EOF

Zsh Tips

1. Advanced globbing:

# Recursive search
ls **/*.js

# Numeric ranges
ls file<1-10>.txt

# Excluding patterns
ls ^*.txt # All except .txt files

2. Suffix aliases:

# Auto-open files by extension
alias -s js=code
alias -s txt=nano
alias -s pdf=open

# Now just type filename:
document.pdf # Opens with default PDF viewer

3. Global aliases:

alias -g G='| grep'
alias -g L='| less'
alias -g H='| head'
alias -g T='| tail'

# Use anywhere:
ps aux G node # ps aux | grep node
cat file L # cat file | less

Fish Tips

1. Abbreviations:

# Like aliases but expand
abbr -a gco git checkout
abbr -a gcm git commit -m
abbr -a gp git push

# Type 'gco' and space → expands to 'git checkout'

2. Universal variables:

# Set across all sessions
set -U fish_color_command blue
set -U PATH $PATH /new/path

# Persist automatically

3. Event handlers:

# Run on directory change
function on_pwd_change --on-variable PWD
# Auto-activate venv if exists
if test -e venv/bin/activate.fish
source venv/bin/activate.fish
end
end

PowerShell Tips

1. Pipeline objects:

# Select properties
Get-Process | Select-Object Name, CPU

# Where clause
Get-ChildItem | Where-Object Length -gt 1MB

# Sorting
Get-Process | Sort-Object CPU -Descending

2. Modules:

# Import module
Import-Module posh-git

# List modules
Get-Module -ListAvailable

# Install from gallery
Install-Module -Name PSReadLine

3. Profile functions:

# Quick navigation
function dev { Set-Location C:\Dev }
function proj { Set-Location C:\Projects }

# Git shortcuts
function gs { git status }
function ga { git add $args }

Troubleshooting

Shell Not Found

Issue: Selected shell doesn't exist

Solution:

# Check if shell is installed
which bash
which zsh
which fish

# Install if missing (macOS)
brew install zsh
brew install fish

# Install if missing (Linux)
sudo apt install zsh
sudo apt install fish

# Then restart Xermius

Shell Configuration Errors

Issue: Shell won't start or shows errors

Causes:

  • Syntax error in config file
  • Missing command in config
  • Broken plugin

Solutions:

1. Test configuration:

# Bash
bash --norc # Start without config
bash -n ~/.bashrc # Check syntax

# Zsh
zsh -f # Start without config
zsh -n ~/.zshrc # Check syntax

# Fish
fish --no-config
fish -n ~/.config/fish/config.fish

2. Find error:

# Add debug output
set -x # Enable debug mode

# Source config
source ~/.bashrc

# Disable debug
set +x

3. Reset configuration:

# Backup current
cp ~/.bashrc ~/.bashrc.backup

# Use default
cp /etc/skel/.bashrc ~/.bashrc

# Or delete and recreate
mv ~/.bashrc ~/.bashrc.old
# Restart terminal (creates default)

Plugins Not Working

Issue: Shell plugins don't load

Zsh (oh-my-zsh):

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

# Update plugins
cd ~/.oh-my-zsh
git pull

# Check plugin syntax
nano ~/.zshrc
# Ensure: plugins=(git docker ...)

Fish:

# Reinstall Fisher (if used)
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher

# Reinstall plugins
fisher update

Recommendations

For Beginners

Start with: Bash or Fish

Why:

  • Bash: Universal, lots of tutorials
  • Fish: Very user-friendly, helpful hints

Avoid (initially):

  • Zsh with heavy customization (overwhelming)
  • PowerShell (unless Windows-focused)

For Power Users

Choose: Zsh with oh-my-zsh

Why:

  • Maximum customization
  • Huge plugin ecosystem
  • Best autocomplete
  • Active community

Configure:

  • Install oh-my-zsh
  • Choose modern theme (powerlevel10k)
  • Enable useful plugins
  • Custom aliases/functions

For Windows Users

Primary: PowerShell

Why:

  • Native Windows integration
  • Best for Windows administration
  • Object-based (powerful)

Alternative: Git Bash

  • Unix-like commands on Windows
  • Good for cross-platform work

For Scripters

Recommended: Bash

Why:

  • Most portable
  • Widely documented
  • Best compatibility
  • Standard for DevOps scripts

Alternative: Zsh

  • Compatible with Bash scripts (mostly)
  • Additional features for interactive use

Next Steps