Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Empty directories
- X-seq: zsh-users 19190
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Empty directories
- Date: Wed, 01 Oct 2014 14:25:06 +0100
- In-reply-to: <m0gt5k$i0h$1@ger.gmane.org>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <m0gm6c$iq2$1@ger.gmane.org> <m0gmae$iq2$2@ger.gmane.org> <20141001120022.72b2bf53@pwslap01u.europe.root.pri> <m0gt5k$i0h$1@ger.gmane.org>
On Wed, 01 Oct 2014 14:47:48 +0200
Yuri D'Elia <wavexx@xxxxxxxxxx> wrote:
> In normal file completion, prefix<tab> will accept the entire path (if
> unique) and insert a space after it.
>
> $ touch pref1_file pref2_file
> $ rm pref1<tab>
>
> With an empty directory though the path is not accepted even though
> there is nothing more to complete.
>
> It's a minor difference, I know, but I wanted to know why it's there.
Oh.
When you hit tab the first time, it's just looking for something at the
current path level. If it's a directory it just adds it. It has no
idea whether or not it's an empty directory, that's the next level
down.
Then after it's added a / for that directory, you start completing
in that directory and it will now look for whether there's anything
there or not.
To do better, you need a special case in file completion to handle
directory *only* completion. But it's tricky since in principle there
may be a mixture of directories that are empty and directories that
aren't which would need to be grouped differently. There are already
way too many cases no one really understands in _path_files, so this
might need an intermediate level for use by cd, rmdir, etc. This is a
lot of work for something this minor.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author