I've posted about this before, but only recently narrowed the problem down to a specific cause.
Ok, first of all, the behavior:
It occurs when autocompletion brings up its list (not when there is only a single option). Basically, if I were to type, say,
cd ~/<TAB>
I would get something like:
cd ~cd ~/.FontForge/
Where FontForge is the first item in my list, and the first "cd ~/" is duplicated (but it doesn't affect the command and it can't be deleted either).
Incidentally, I have noticed the problem goes away when using a TERM other than xterm-color.
However, I have determined what is causing the issue with xterm-color. Specifically, my prompt is set up as follows:
local smiley="%(?,%{$fg[green]%}:%)%{$reset_color%},%{$fg[red]%}:(%{$reset_color%})"
PS1="[$PR_LIGHT_MAGENTA%n$PR_NO_COLOR@$PR_GREEN%U%m%u$PR_NO_COLOR:$PR_RED%2c$PR_NO_COLOR]
[ ${smiley} ] %(!.#.$) "
RPS1="$PR_LIGHT_YELLOW(%D{%m-%d %H:%M})$PR_NO_COLOR"
I chipped away at that, eventually character by character, until I discovered that the "" and "" character combos are to blame (any of those characters seems to be sufficient to cause the issue). Removing those 4 characters resolves the issue.
The thing is, I like those characters in my prompt.
So, does anybody have any idea what's going on here?
Incidentally, I am running Mac OS X (Lion, although this problem goes back at least to snow leopard) and zsh 4.2.7.