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

Re: <Tab> completion does not insert a slash



On Mon, Aug 16, 2021 at 2:40 PM Peter Slížik <peter.slizik@xxxxxxxxx> wrote:
>
> What strikes me is that the completion provides different results depending on whether the final slash is real or "transient" (hopefully I'm using correct terminology).
>
> Maybe the behaviour is expected, but I would expect the transient slash to work exactly the same way a real slash does.

No, it doesn't.  The transient slash is just showing you that this is
in fact a directory.  You still actually have to type either a slash,
or one non-tab character after the slash, to make it "real" before
completion will proceed deeper down the tree, otherwise you're just
cycling the menu at the preceding input position.

> After I've discovered the 'description' zstyle option, I'm observing how the completion works and find it even more confusing.
> [...] trying to complete it in a command position identifies it either as a named directory, or as a parameter. (?!)
>
> % wa<Ctrl+D>
> -- external command --
> -- executable file --
> -- builtin command --
> -- alias --
> -- parameter --
> -- named directory --
> wait         wallpapers/  wapps        watchbm
> wall         wapi         watch        watchgnupg

The descriptions here are showing you every place from which a
completion string was gathered, but then all the completions are
lumped together at the end.  (That is, you get all the descriptions,
and then all the completions.)  If you actually want the completion
strings to appear immediately after each description, you have to add

zstyle ':completion:*' group-name ""




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