Why is ZSH not the standard shell?

As in most distros, bash is the standard shell in Manjaro after installation. Wouldn't a curated ZSH shell be much easier to work with? Auto-completion and auto-suggestion out-of-the-box could lower the bar to interact with this ominous wonder thingy.
For experienced users ZSH doesn't bring any disadvantages, as long as bash is installed and their scripts still work. On the contrary, it might bring them an efficiency boost, out-of-the-box!

1 Like

20.0 should bring zsh by default, however we missed a setting for our installer. Will be fixed in 20.0.1 ISOs.


"Big" changes like that take time to implement. Various community editions have been testing "ZSH by default" for a while.

1 Like

Good to hear! So I was a little to impatient. Thx for the fast response!

Will the ZSH console then simply replace the bash or will it have to be reinstalled?

There really isn't a zsh "console". You will still use whatever terminal program you use. The difference will be that the default shell for newly created users will be zsh. bash will still be installed because lots of things depend on it.

If you prefer to use bash, you can just switch to it.

If you are asking, when I upgrade my system will I be switched over to zsh, I believe the answer to that is "no", zsh being used as the default is for new installs.

If you want to switch your existing system to zsh, you can do that at any time, like this:

pamac install manjaro-zsh-config
cp /etc/skel/.zshrc ~/.
chsh -s /bin/zsh

Fresh installation maybe two months ago. Here is how I changed to zsh.

[keiljr@keil-dt ~]$ cat /etc/lsb-release
[keiljr@keil-dt ~]$ echo $SHELL
[keiljr@keil-dt ~]$ chsh -l
[keiljr@keil-dt ~]$ zsh
[keiljr@keil-dt ~]$ chsh -s $(which zsh)
Changing shell for keiljr.
Shell changed.

Log out and back in.

keil-dt% echo $SHELL

Head on over to https://ohmyz.sh/#install and confirm the following command:

keil-dt% sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Cloning Oh My Zsh...
Cloning into '/home/keiljr/.oh-my-zsh'...
remote: Enumerating objects: 1153, done.
remote: Counting objects: 100% (1153/1153), done.
remote: Compressing objects: 100% (1118/1118), done.
remote: Total 1153 (delta 20), reused 1097 (delta 19), pack-reused 0
Receiving objects: 100% (1153/1153), 772.72 KiB | 8.68 MiB/s, done.
Resolving deltas: 100% (20/20), done.

Looking for an existing zsh config...
Found ~/.zshrc. Backing up to /home/keiljr/.zshrc.pre-oh-my-zsh
Using the Oh My Zsh template file and adding it to ~/.zshrc.

         __                                     __
  ____  / /_     ____ ___  __  __   ____  _____/ /_
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / /
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/
                        /____/                       ....is now installed!

Please look over the ~/.zshrc file to select plugins, themes, and options.

p.s. Follow us on https://twitter.com/ohmyzsh

p.p.s. Get stickers, shirts, and coffee mugs at https://shop.planetargon.com/collections/oh-my-zsh

➜  ~ 
1 Like

Such practices should never be recommended: you're directly executing a script downloaded from $somewhere. At least separate downloading and executing with a hint to please inspect the downloaded script..

It's a link to a file viewable on github. View it if you please. I did before installing.

Not sure how much related is it to this topic but is it a sane idea to change the symlink /bin/sh so it points to /usr/bin/zsh instead of bash? Can a new bash update re-link it back?
I use i3 eddition and by default i3 exec commands pass the arguments to /bin/sh. Since my default (user) shell is already zsh I have all the environment variables, aliases, etc. in .zshrc and not in .bashrc.
Or is it better/safer to just change i3 config file to exec zsh -c <command>?

That is a terrible idea. :wink:

zsh isn't fully compatible with sh. If you change the system sh to be zsh scripts will probably break.

I don't use i3 often enough to truly answer that but it certainly seems like a substantially better idea to me :grin:

That is just a teeny-tiny change. What could possibly go wrong?
By change from bash to zsh I save 1 letter for each executed command. That has to speed up my computer significantly, no?

1 Like

After change to zsh via

pamac install manjaro-zsh-config
cp /etc/skel/.zshrc ~/.
chsh -s /bin/zsh

how does one revert back to bash?

I thought I would give zsh or oh-my-zsh a try but want to be able to get back to 'normal' afterwards in case I don't like it.

If you've installed from one of the newer ISOs and never had bash as your default shell, you'd need to install it first and copy come skeleton files:

pacman -Syu bashrc-manjaro
cp /etc/skel/.bash* ~/.

Last step would be to switch default shell. This would be the only step required if at some point in the past you already had bash as default shell for your user:

chsh -s /bin/bash
1 Like

Scripting differences

Length of an array in bash is from 0 to length-1 whereas it ranges from
1 to length in zsh.

wtf :roll_eyes:

Most scripts continue to be written in bash for broad compatibility. zsh is mostly used interactively although it certainly can be used as a scripting tool if that is your choice.


Yeah i know...

Although ideally it should be improvement over scripting as well, doesn't seem to be the case here (well outside of basic stuff maybe)

Whether you used 0-based arrays or 1-based arrays isn't really something that is good or bad from my perspective. It is just a design choice. If you want zsh to use 0-based arrays you can set an environment variable and it will do so.

1 Like

I don't feel that preinstalling zsh is such a good idea. Bash is good beacuse it's simple and celan. I'm personally not a big of remixes and zsh is only good for those who utilize teminal heavily, for the rest it's a bloat.

1 Like

Especially for inexperienced users ZSH is a great help, because of the auto-completion and the syntax-highlighting. It makes the interaction much more intuitive and straight forward. It's also much easier to pickup and remember IMHO.

Forum kindly sponsored by