Skip to content

Instantly share code, notes, and snippets.

@billchurch
Last active May 27, 2025 16:28
Show Gist options
  • Save billchurch/029f75bfbdf5725a6a16e2906f9a572c to your computer and use it in GitHub Desktop.
Save billchurch/029f75bfbdf5725a6a16e2906f9a572c to your computer and use it in GitHub Desktop.
Switch from zsh to bash in macOS Sequoia

Switching from zsh to bash on macOS Sequoia (or newer)

This is what I did in macOS to switch the shell shell from zsh to bash, restoring Homebrew paths, and enabling Colima command-line completion.

1. Change the Default Shell to Bash

First, check your current shell:

echo $SHELL

If it still shows /bin/zsh, change it:

Using the system bash:

chsh -s /bin/bash

Or using Homebrew’s newer bash (recommended):

brew install bash
sudo bash -c 'echo /opt/homebrew/bin/bash >> /etc/shells'
chsh -s /opt/homebrew/bin/bash

Then restart Terminal.

2. Update ~/.bash_profile

Create or update your ~/.bash_profile with items from .zshrc. There may be some zsh specific commands that you'll need to account for

3. Restore Homebrew PATH in Bash

Homebrew wasn't setup in my bash environment so I had to add it:

Apple Silicon:

# Add to ~/.bash_profile or ~/.bashrc
eval "$(/opt/homebrew/bin/brew shellenv)"

Intel Macs:

# Add to ~/.bash_profile or ~/.bashrc
eval "$(/usr/local/bin/brew shellenv)"

Reload:

source ~/.bash_profile

Verify:

which brew

4. Enable Bash Completion System

Install bash completion:

brew install bash-completion@2

Then add to your ~/.bash_profile or ~/.bashrc:

# Enable Homebrew bash-completion
[[ -r "/opt/homebrew/etc/profile.d/bash_completion.sh" ]] && \
  source "/opt/homebrew/etc/profile.d/bash_completion.sh"

For Intel Macs, replace /opt/homebrew with /usr/local.

5. Enable Colima Command Completion

Generate Colima’s bash completion script:

colima completion bash > ~/.colima_complete

Then add to your ~/.bashrc:

# Colima CLI completion
if [ -f "$HOME/.colima_complete" ]; then
  source "$HOME/.colima_complete"
fi

Reload the shell:

source ~/.bashrc

Now try:

colima [TAB][TAB]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment