I'm new to zsh and have discovered some strange behavior, but this tops it all.
I just came across this extremely strange behavior when declaring a local array in a zsh function that I was writing for my .zshrc file. When I declared a local array it caused my prompt to go crazy. I eventually traced it back to two very strange functions that randomly got created. I reduced it to a simple case:
% function () { local foobar=(); echo frog; }
% echo ${functions[foobar=]}
echo frog
% echo ${functions[local]}
echo frog
The first strange thing is that frog
never gets printed from the anonymous function. But the really strange thing is that instead two functions named foobar=
and local
get created.
This causes all kinds of problems for my zsh prompt. Whenever the local
keyword is used it printed frog
.
I am really wondering what on earth caused zsh to create those functions.
I am using zsh 5.0.2