azec.me
azec.me

Reputation: 5078

How to update zsh in Mac OSX Sierra?

I am trying to update ZSH in Mac OSX Sierra to 5.3.1 I have used brew to update it with following commands.

$brew install zsh
$sudo dscl . -create /Users/$USER UserShell /usr/local/bin/zsh

Now after rebooting, when I run tests, this is what I have:

$dscl . -read /Users/$USER UserShell
   UserShell: /usr/local/bin/zsh

$which zsh
  /bin/zsh

$zsh --version
  zsh 5.2 (x86_64-apple-darwin16.0)

$echo $SHELL
  /usr/local/bin/zsh

So I don't understand why iTerm2 and my regular Mac terminal won't pickup new location for zsh (/usr/local/bin/zsh), and why is it still showing previous version (5.2). I also run this to confirm brew installed new version.

$ls -la /usr/local/bin/zs*
   lrwxr-xr-x  1 myusername  admin  27 Mar 25 18:48 /usr/local/bin/zsh -> ../Cellar/zsh/5.3.1/bin/zsh
   lrwxr-xr-x  1 myusername  admin  33 Mar 25 18:48 /usr/local/bin/zsh-5.3.1 -> ../Cellar/zsh/5.3.1/bin/zsh-5.3.1

I am also running oh-my-zsh, which I have already updated to the latest version.

Upvotes: 3

Views: 5199

Answers (1)

faffaffaff
faffaffaff

Reputation: 3549

Almost certainly your $PATH does not contain /usr/local/bin, or it has /bin listed before /usr/local/bin, so your "which zsh" and "zsh --version" commands run /bin/zsh. Try adding this to your .zshrc, for example:

export PATH="/usr/local/bin/:$PATH"

You could also try to check the version of zsh in $SHELL:

$SHELL --version

Upvotes: 2

Related Questions