Also don't match the root directory (#216)

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 commit is contained in:
Eric Nielsen authored and GitHub committed 2021-05-26 13:59:50 -04:00
1 parent 61b5c5be69
commit 574f64b84e
1 file changed
+2 -2
+2 -2
View File
@@ -56,8 +56,8 @@ _z() {
if [ "$1" = "--add" ]; then
shift
# $HOME isn't worth matching
[ "$*" = "$HOME" ] && return
# $HOME and / aren't worth matching
[ "$*" = "$HOME" -o "$*" = '/' ] && return
# don't track excluded directory trees
local exclude