Skip to content

Instantly share code, notes, and snippets.

@meowoodie
Last active September 23, 2015 08:03
Show Gist options
  • Save meowoodie/ed107ba606e9b8812286 to your computer and use it in GitHub Desktop.
Save meowoodie/ed107ba606e9b8812286 to your computer and use it in GitHub Desktop.

Change my default shell to zsh

Yesterday, I tried to change my default shell from bash to zsh on my mac. I installed zsh by running:

brew install zsh

Then I installed oh-my-zsh according to the guide from github. It's an open source framework for managing zsh configuration. It would save much of your time in configuring zsh. Here was a problem I have met that I cannot change my default shell after I ran:

chsh -s /bin/zsh

Then I found this page on stackoverflow and the description about chsh on linux man page. The description is as follows:

However, it will issue a warning if the shell is not listed in the /etc/shells file. On the other hand, it can also be configured such that it will only accept shells listed in this file, unless you are root.

It means that if the shell you specified is not in that file, it won't be considered a standard shell. So, it was necessary to add zsh to /etc/shells. Then the problem was solved.

Here is a digression

zsh has a lot of themes which provides varies of beautiful prompt. All what you need to do is editing your ~/.zshrc, and modifying the environment vairiable, $ZSH_THEME. I prefer "aussiegeek", it provides an explicit format of my current directory and timestamp of commands.

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