besides the `$HOME` directory.
A `z /` call will cd to the root directory anyway, because of how the
code handles completion:
# if we hit enter on a completion just go there
case "$last" in
# completions will always start with /
/*) [ -z "$list" -a -d "$last" ] && builtin cd "$last" && return;;
esac
This change references `$RANDOM` outside the subshell to refresh it for the
next subshell invocation. Otherwise, subsequent runs of the function get the
same value and, if run simultaneously, they may clobber each others' temp .z
files.
This is due to how zsh distributes RANDOM values when running inside a
subshell:
subshells that reference RANDOM will result in identical pseudo-random
values unless the value of RANDOM is referenced or seeded in the parent
shell in between subshell invocations
See: http://zsh.sourceforge.net/Doc/Release/Parameters.html#index-RANDOM
The tab completion for z lists hits in wrong order, not by rank. Switching from "-n" to "-g" for sort (i.e. general numeric) is required for the float rank value.
When Active Directory is used for Mac authentication then the group name could be "MyCompany\Domain Users". This causes an error in z during the chown such as "chown: MyCompany\Domain: illegal group name"
for checking the common root. It is a simpler implementation.
I see a similar logic, still using `~!` comparison exists since initial
commit (9b240f3):
} else for( i in a ) if( shortest !~ a[i] ) x = 1
Rename parameters in `output` function to avoid using multiple names for
the same domains. Use the same names as in other functions.
* Check intended exit code. Fixes#177.
Use PIPESTATUS rather than $? to check last program in a pipeline.
* Avoid PIPESTATUS/pipestatus entirely.
Use process substitution to obtain input and sidestep the
question of where the exit code is.
-l lists and does not cd, but has enough extra stuff going on to make
it a bit of a pain if you want to parse out just the best match for
your own nefarious purposes - therefore this.
h/t @synthetiv. Closes#161