问题
I recently switched to zsh on my Terminal.app on my OS X machine successfully. The version number of zsh is 4.3.11.
回答1:
If you have Homebrew installed, you can do this.
# check the zsh info
brew info zsh
# install zsh
brew install --without-etcdir zsh
# add shell path
sudo vim /etc/shells
# add the following line into the very end of the file(/etc/shells)
/usr/local/bin/zsh
# change default shell
chsh -s /usr/local/bin/zsh
Hope it helps, thanks.
回答2:
If you're using oh-my-zsh
Type
upgrade_oh_my_zshin the terminal
回答3:
If you're not using Homebrew, this is what I just did on MAC OS X Lion (10.7.5):
Get the latest version of the ZSH sourcecode
Untar the download into its own directory then install:
./configure && make && make test && sudo make installThis installs the the zsh binary at
/usr/local/bin/zsh.You can now use the shell by loading up a new terminal and executing the binary directly, but you'll want to make it your default shell...
To make it your default shell you must first edit
/etc/shellsand add the new path. Then you can either runchsh -s /usr/local/bin/zshor go to System Preferences > Users & Groups > right click your user > Advanced Options... > and then change "Login shell".Load up a terminal and check you're now in the correct version with
echo $ZSH_VERSION. (I wasn't at first, and it took me a while to figure out I'd configured iTerm to use a specific shell instead of the system default).
回答4:
As far as I'm aware, you've got three options to install zsh on Mac OS X:
- Pre-built binary. The only one I know of is the one that ships with OS X; this is probably what you're running now.
- Use a package system (Ports, Homebrew).
- Install from source. Last time I did this it wasn't too difficult (
./configure,make,make install).
来源:https://stackoverflow.com/questions/17648621/how-do-i-update-zsh-to-the-latest-version