You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Introduction

This is a guide for updating to Z Shell on macOS.

Quote

From Wikipedia: https://en.wikipedia.org/wiki/Z_shell

Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.

Announced in June and released in October 2019, macOS Catalina has adopted Zsh as the default shell, replacing Bash.

Command not found

While it's optional to use Z shell if you choose to do so you might hit the following issue when starting a terminal:

/Users/rgange/.mgnl/mgnl:71: command not found: complete

Fix the issue

  1. From the command line, install nvm.

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
  2. Create a copy of your current .bash_profile to create .zprofile.
  3. In the file .zprofile, add the following code before: source ~/.mgnl/mgnl

    export NVM_DIR="$HOME/.nvm"[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
    [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
    
    source ~/.mgnl/mgnl
  4. In the file .zshrc, add the following:

    autoload bashcompinit && bashcompinit
  5. Optional: Display the username, machine name and path at the prompt. In the file .zshrc, add the following:

    export PS1="%n@%m %d %% "
  • No labels