New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(eval):15 bad assignment when using '=' as alias #523
Comments
Give the values of $ZSH_VERSION, $ZSH_PATCHLEVEL, $ZSH_HIGHLIGHT_REVISION, and $ZSH_HIGHLIGHT_VERSION; do Can you be a bit clearer about what your setup is and what the result is. Are you saying that with calc and z-sy-h the For reference, with current zsh and z-sy-h — $ zsh -f
% aliases[=]='echo foo'
% source ./zsh-syntax-highlighting.zsh
./zsh-syntax-highlighting.zsh:31: invalid alias '=' encountered while printing aliases |
Excuse brevity. |
My current set-up is the following:
Running on Bash for Windows with Ubuntu 16.04.5 LTS With z-sy-h, but without the calc plugin:
With z-sy-h and the calc plugin:
Without z-sy-h but with calc:
|
This gives me a different error that you have: zsh -f
SurfacePro3% aliases[=]='echo foo'
SurfacePro3% source ./zsh-syntax-highlighting.zsh
(eval):1: bad assignment |
Workaround is by sourcing manually after z-sy-h is sourced. So in |
The driver has code to undefine and redefine aliases before/after it's sourced. That's needed to be sure user aliases don't take effect in z-sy-h's code. The "redefine" code — zsh-syntax-highlighting/zsh-syntax-highlighting.zsh Lines 435 to 437 in db6cac3
= in them (zsh-users/zsh@a8a00be, see also zsh-users/zsh@3a8727d)
I recommend that you upgrade zsh. (You seem to be on Debian jessie/oldstable. Debian stretch/stable is new enough.) Your workaround is good too. To devs: 1. I'm not sure if calc defines widgets; if it does, the workaround would require redrawhook to be merged for full functionality; 2. if #252 were implemented it would sidestep this class of issues entirely. |
An alternative workaround is to disable the undefine/redefine code: that's the chunk I linked plus the corresponding chunk at the top of the file that does |
It's just a simple wrapper function around I was on Ubuntu/xenial but might be about time I switch to bionic. That'll update zsh as well. Will close the issue if that removes the issue :) |
Sorry, but the issue tracker is our todo list, and I don't want to clutter it with open, inactionable issues. I'll close this issue now, but feel free to reopen if it occurs on zsh that has the aforementioned fixes (>=5.3.1) or if you have a patch to add support for older zsh's. |
This is similar to #263 but I get a different error:
As a result, all plugin aliases are gone.
I'm using the zsh calc plugin, which aliases the
=
. When I remove this plugin, I get no errors and got all plugin aliases.How can I best debug to provide more info?
The text was updated successfully, but these errors were encountered: