summaryrefslogtreecommitdiff
path: root/plugins/z/z.sh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/z/z.sh')
-rw-r--r--plugins/z/z.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/z/z.sh b/plugins/z/z.sh
index 4fc75dc6a..5fe6d5266 100644
--- a/plugins/z/z.sh
+++ b/plugins/z/z.sh
@@ -222,10 +222,16 @@ if type compctl >/dev/null 2>&1; then
if [ "$_Z_NO_RESOLVE_SYMLINKS" ]; then
_z_precmd() {
(_z --add "${PWD:a}" &)
+ # Reference $RANDOM to refresh its value inside the subshell
+ # Otherwise, multiple runs get the same value
+ : $RANDOM
}
else
_z_precmd() {
(_z --add "${PWD:A}" &)
+ # Reference $RANDOM to refresh its value inside the subshell
+ # Otherwise, multiple runs get the same value
+ : $RANDOM
}
fi
[[ -n "${precmd_functions[(r)_z_precmd]}" ]] || {