Generally, you can start zsh
with the parameter -x
for debugging. This will echo any line of shell code run by this shell before it is executed. This helps locating where in your configuration things go awry.
In this case you get an error message from script
because it does not have an option 'G'
in addition to a lists of all available options (try and compare script -G
). Command line tools often differ quite a bit between different Unix derivatives, that includes number and meaning of command line options. Compare man script
between your platforms.
As cd
is an alias for nocorrect cd
, nocorrect
seems to be the most likely culprit. To check, run unalias cd
. If the problem goes away, do a type nocorrect
and go from there.
If the problem persists search your configuration for chpwd
(this may be either a function definition or a line like add-zsh-hook chpwd SOMETHING
).