This will be a very neat feature to have.  One thing I'm excited about
is the ability to cleanly perform assignments during prompt expansion
(e.g. to capture information during PS0 or PS4 expansion).

Something I suspect people will complain about is that this change
makes some polyglot zsh/bash scripts that were previously
syntactically valid no longer so.  A particularly prominent one is
git-completion.bash [1] distributed with git, which now reports syntax
errors when sourced due to the expansion on line 414:

   413    if [[ -n ${ZSH_VERSION-} ]]; then
   414        unset ${(M)${(k)parameters[@]}:#__gitcomp_builtin_*} 2>/dev/null
   415    else
   416        unset $(compgen -v __gitcomp_builtin_)
   417    fi

Hopefully, there are not too many such scripts and they can just gain
some workarounds (like wrapping the zsh-only code in an eval).

[1]: 
https://github.com/git/git/blob/v2.40.1/contrib/completion/git-completion.bash#L414

Reply via email to