Skip to content
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

fix support for zsh 5.4.1 onwards #6

Merged
merged 1 commit into from
Sep 12, 2017

Conversation

aitorciki
Copy link

Since version 5.4.1, zsh won't allow the definition of functions using the name() syntax if name is already an alias.

The recommended way to define functions is to always use the function keyword, as aliases are not expanded afterwards.

See http://zsh.sourceforge.net/releases.html (5.3.1 to 5.4.1) and http://zsh.sourceforge.net/Doc/Release/Options.html#Scripts-and-Functions for more details.

Since version 5.4.1, zsh won't allow the definition of functions using
the `name()` syntax if `name` is already an alias.

The recommended way to define functions is to always use the `function`
keyword, as aliases are not expanded afterwards.

See http://zsh.sourceforge.net/releases.html (5.3.1 to 5.4.1) and
http://zsh.sourceforge.net/Doc/Release/Options.html#Scripts-and-Functions
for more details.
@mpapis
Copy link
Owner

mpapis commented Sep 12, 2017

So I assume you already had an alias for one of the functions? How does the error look like - out of curiosity?

@aitorciki
Copy link
Author

aitorciki commented Sep 12, 2017

Yes, it's very common when using config frameworks for zsh like oh-my-zsh or prezto to have cd and others aliased by default. This is how the error looks like since zsh 5.4.1 (in my case bash_zsh_support is used by avn, an automatic node environment manager):

/Users/aitor/.avn/bin/avn.sh:134: defining function based on alias `cd'
/Users/aitor/.avn/bin/avn.sh:134: parse error near `()'

@mpapis mpapis merged commit 5ad0c92 into mpapis:master Sep 12, 2017
@mpapis
Copy link
Owner

mpapis commented Sep 12, 2017

thank you :)

@aitorciki aitorciki deleted the zsh-5.4.1-support branch September 12, 2017 09:13
@aitorciki
Copy link
Author

Thanks for the fast merge!

mpapis added a commit to rvm/rvm that referenced this pull request Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants