Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Inconsistent tab completion with 'autocd' option and with 'cd' command



On Jun 26,  2:55pm, Patrick Palka wrote:
}
} In particular I am not a fan of the completion results of the 'autocd'
} variant.  It would be nice if the two completion results were
} consistent.  Hope this "bug report" is clear and helpful :)

Hmm.  So far, analysis without suggested alteration:

_cd says:

    # Don't complete local directories in command position, that's
    # already handled by _command_names (see _autocd)

_command_names uses:

    _path_files -/g \*\(-\*\)

This will follow ".." literally up to z/a rather than symbolically
up to z, so ../c is not a possible path.

Whereas _cd uses:

    _path_files $tmpWpath -/

where $tmpWpath is computed by a messy hack that forks a subshell to
actually preflight the "cd" to be sure CHASE_LINKS etc. is properly
managed.

This makes no difference unless you're using "../" somewhere in the
string in command position *and* there are no executable files in
the directory to which you are attempting to autocd.

Also your specific example is quite often suppressed for "cd" by the
ignore-parents style.



Messages sorted by: Reverse Date, Date, Thread, Author