The previous code started a _new_ emulation, which had the side effect
of resetting some options like auto_cd
> If the -R switch is given, all settable options are reset to their default value corresponding to the specified emulation mode, except for certain options describing the interactive environment; **otherwise, only those options likely to cause portability problems in scripts and functions are altered.**
Source : http://zsh.sourceforge.net/Doc/Release/Shell-Builtin-Commands.html#Shell-Builtin-Commands
Some users prefer to unify their bash and zsh profile variables by having .zprofile reference .profile as follows:
> emulate bash
> . $HOME/.profile
> emulate zsh
This causes export_jenv_hook to fail with "unknown condition: -z" as apparently the if clause uses zsh specific syntax.
This commit forces 'emulate zsh' before executing the zsh init, then returns the emulation settings after the zsh commands.
Some users prefer to unify their bash and zsh profile variables by having .zprofile reference .profile as follows:
> emulate bash
> . $HOME/.profile
> emulate zsh
This causes export_jenv_hook to fail with "unknown condition: -z" as apparently the if clause uses zsh specific syntax.
This commit forces 'emulate zsh' before executing the zsh init, then returns the emulation settings after the zsh commands.