Zsh Mailing List Archive
Messages sorted by:
Re: zsh completion for umount
- X-seq: zsh-users 22050
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: zsh completion for umount
- Date: Mon, 31 Oct 2016 00:47:32 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=kMiJSVi/fO849Z1qdnZgR9TtQWXawlkor4TPdNbjV3I=; b=fc1W45XjI+6RQGrBG4mgOKP65j65M3fvJWNCbho/YF/Osf+iLrSwIzF0WexATG9aY9 0VfyEyANAcVZ8Truy5ZFj6oK1z35+QMeXCeaYMdpmSktsEbO2MHCM8dcShneEutlJfWj t5IHQs8F2h5CgN/IsJ4kbRm4l6+93K5t+8c1PD/ERcxZZPwU4DTCVEr3exn+D7xsUJ7e LUrDFMiwh/SlYY+nIfmwqP2LS+xmWjsi39FVcWUkPHI5J2Eap2fIxT65BtkzPAcpjKbx Ilfu5rIOiOoDf8FO+AxGluamIMc9A+0EQvgceNqBhuqz0ELi/86NIDbSlmLRzSMqWaAr lBXQ==
- In-reply-to: <58164C21.email@example.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <5815DDAB.firstname.lastname@example.org> <20161030153537.GB12137@fujitsu.shahaf.local2> <58164C21.email@example.com>
On Oct 30, 8:38pm, Fourhundred Thecat wrote:
} When I remove everything from .zshrc, and only leave following two lines:
} autoload -Uz compinit
} compinit -D
} then completion for mount -o <TAB> starts working, same as you describe.
} That is great progress. But umount m<TAB> still does not complete, nor
} does umount ./m<TAB>
Curious that no one has noticed this before.
Completion for mount / umount works fine as long as you're completing
full paths, either to device files or to mount points.
However, the _canonical_paths function that's used to convert strings
on the command line into the One True Path to either such a device or
mount point, is somewhat deficient when it tries to compare a relative
path to the canonical path, as is necessary to complete the path tail
when the current directory is already part of the canonical path.
I don't have any more time to chase this now, but briefly in case
someone else wants to pick it up:
"_canonical_paths_add_path $PREFIX" is called which, if prefix is not
empty, tries calling zstat to see if it is a real file. Of course
this fails because it's not a file, it's only a prefix of a filename,
so _canonical_paths_get_canonical_path is NOT called, and the path
from the current directory is not discovered. The upshot is that
_canonical_paths_add_path only does anything useful if the prefix
on the command line is either already a device or mountpoint, or is
the name of a directory in the partial path to one.
If you try to trick it as Daniel suggested by adding "./", things
are only slightly better in _canonical_paths, but then go sideways
later: the bug discussed earlier this year, in which the current
prefix is erased but nothing replaces it, affects this completion.
Messages sorted by: