You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Z shell (zsh) is a Unix shell [...]. Zsh can be thought of as an extended Bourne shell with a large number of improvements, including some features of bash, ksh, and tcsh.
Some Linux systems come preloaded with zsh. You can check if it exists as well as its version by writing zsh --versionin a terminal window. In case this zsh version is ok for you, you're done now!
Determine on which Linux distribution your system is based on. See List of Linux distributions – Wikipedia for a list. Most Linux systems – including Ubuntu – are Debian-based.
Debian-based linux systems
Open a terminal window. Copy & paste the following into the terminal window and hit Return. You may be prompted to enter your password.
OS X comes preloaded with zsh. You can check its version by writing zsh --versionin a terminal window. In case this zsh version is ok for you, you're done now!
If you want the latest and greatest, use Homebrew: Proceed with the following steps to install a recent version.
Copy & paste the following into the terminal window and hit Return.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
You will be requested to install the Command Line Developer Tools from Apple. Confirm by clicking Install. After the installation finished, continue installing Homebrew by hitting Return again.
Step 2 – Install zsh
Copy & paste the following into the terminal window and hit Return.
brew install zsh
You can use zsh now.
Optional step 3 – default shell
To set zsh as your default shell, execute the following.
@e-beach @zhilevan
I encountered that very same issue! For me, it was quickly resolved, though:
Prior to pasting the above into the terminal, I had used: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-- meaning I had installed Homebrew according to the instructions on their actual site. It appears that version and the version instructed above are just two different roads leading to the same destination. As was the case for me, there's a chance you may already have a version of Homebrew installed.
I have only been diving into the dev game since the start of the year (and until today was only familiar setting things up on PC/Linux), so rather than potentially leading you astray, I suggest you check out https://brew.sh/ for guidance on all things Homebrew.
Or, if you are the reckless or impatient sort, you can do what I did and press on by entering brew doctor into the terminal. If you have Homebrew already, it should be immediately evident. Boom.
**ATTN: I am no seasoned vet, and I hope those more knowledgable will correct any misinformation I have supplied & elaborate on the rest!
Install Brew (https://brew.sh)
Double check it before, but as of now the command is: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Third Step on Mac gives error of: zsh
/bin/bash: echo /usr/local/bin/zsh >> /etc/shells: No such file or directory
Just to be clear I know that I have it installed, I was just trying to make sure that it is the default.
Try
sudo sh -c 'echo /usr/local/bin/zsh >> /etc/shells'
Thanks @agueroveraalvaro
Your command worked for me and the /etc/shells file shows the new entry for /usr/local/bin/zsh
Also i executed chsh -s /usr/local/bin/zsh command
But echo $SHELL still shows me /bin/zsh instead of /usr/local/bin/zsh
Can you please help?
Third Step on Mac gives error of: zsh
/bin/bash: echo /usr/local/bin/zsh >> /etc/shells: No such file or directory
Just to be clear I know that I have it installed, I was just trying to make sure that it is the default.
Try
sudo sh -c 'echo /usr/local/bin/zsh >> /etc/shells'
Thanks @agueroveraalvaro
Your command worked for me and the /etc/shells file shows the new entry for /usr/local/bin/zsh
Also i executed chsh -s /usr/local/bin/zsh command
But echo $SHELL still shows me /bin/zsh instead of /usr/local/bin/zsh
Can you please help?
I had the same issue on Mojave 10.14.5, this was resolved for me by using the answer provided by @XerxesNoble above: chsh -s /bin/zsh
// register our zsh to the shells, idk why "sudo -s" is showing not below error on my mojave:
/bin/bash: echo /usr/local/bin/zsh >> /etc/shells: No such file or directory
// instead do register below to also avoid: "chsh: /usr/bin/zsh: non-standard shell"
sudo sh -c "echo $(which zsh) >> /etc/shells" && chsh -s $(which zsh)
Also, don't forget to re-open your terminal and re-setup all "recommended" zsh option.
Or if you want to re-configure/forgot to configure it, you run this command below:
The function will not be run in future, but you can run
it yourself as follows:
autoload -Uz zsh-newuser-install
zsh-newuser-install -f
Your brew executable is not in your $PATH. I can see that you tried to add it, but it seems like something didn't work. Also, whenever you adapt .zshrc, you need to evaluate it again using source ~/.zshrc or (better) start a new shell/terminal. Did you even have zsh installed at that point? Because you try to install it below.
Homebrew/brew couldn't download ncurses (which I think is required for zsh) because the SSL/TLS versions seem to mismatch. Make sure you have an up-to-date computer.
@vanessarowe Hm, it seems your system is a bit broken as well. The error message is not related to ZSH itself but to Oh my ZSH which is a plugin system for ZSH.
Because it complains about .oh-my-zsh missing in your home directory, I assume that you don't have Oh my ZSH installed but a reference to it in the ZSH config file .zshrc.
You could remove the Oh my ZSH reference from line 75 of .zshrc in your home directory and try again.
use
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
instead.