Configuration hints for the Z shell (zsh)
How to change the shell
All users get the Z shell (zsh) as their default login shell. Users who would like to work with a different shell (bash in the following example) should append the following lines of code to the end of their
source /usr/local_host/etc/switch_login_shell bash
You also have to add the line
~/.bashrc file in order to activate the modules system, cf. here.
zsh configuration files
zsh has a couple of configuration files. The most important ones are described in the following subsections.
This file is read whenever zsh is started as an interactive shell. Therefore you should use it in order to configure the interactive behaviour of your shell, e.g. for
- environment variables like
$PAGER, extensions to
- shell options (
To switch the command-line mode from 'emacs' (the default) to 'vi' use the following line:
This file is read for every invocation of zsh and should therefore be as short as possible.
~/.zshenv must not contain any output to stdout, otherwise various programs (e.g.
scp) will stop working. Moreover, you must not call any external zsh scripts here. An infinite recursion will occur otherwise.
This file is read whenever a zsh login shell terminates.