Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit e3587bc

Browse files
authored
Fix compatibility with zsh 5.4.1
Since version 5.4.1, zsh won't allow the definition of functions using the `name()` syntax if `name` is an alias. In many zsh setups `cd` is probably an alias, causing an error when avn.sh is sourced. 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.
1 parent 24e1b1d commit e3587bc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bin/avn.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export -a chpwd_functions;
111111
# https://github.com/mpapis/bash_zsh_support/blob/master/LICENSE
112112
#
113113

114-
__zsh_like_cd()
114+
function __zsh_like_cd()
115115
{
116116
\typeset __zsh_like_cd_hook
117117
if
@@ -131,7 +131,7 @@ __zsh_like_cd()
131131

132132
[[ -n "${ZSH_VERSION:-}" ]] ||
133133
{
134-
cd() { __zsh_like_cd cd "$@" ; }
135-
popd() { __zsh_like_cd popd "$@" ; }
136-
pushd() { __zsh_like_cd pushd "$@" ; }
137-
}
134+
function cd() { __zsh_like_cd cd "$@" ; }
135+
function popd() { __zsh_like_cd popd "$@" ; }
136+
function pushd() { __zsh_like_cd pushd "$@" ; }
137+
}

0 commit comments

Comments
 (0)