Zsh Mailing List Archive
Messages sorted by:
Case-insensitive completion (Re: tab completion bug?)
- X-seq: zsh-workers 33525
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Case-insensitive completion (Re: tab completion bug?)
- Date: Fri, 24 Oct 2014 08:20:04 -0700
- Cc: TJ Luoma <luomat@xxxxxxxxx>
- In-reply-to: <CADjGqHtrkip-x82=zA7m0gE9R6zeN6VV3-fkpYUua4dt3KVemA@mail.gmail.com>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CADjGqHubg=UK+0awfnrr48YFLRy1gPC+44q7GscMM0rADMmemail@example.com> <firstname.lastname@example.org> <CADjGqHueO7-=ty3f8FcUTZ_8ESTOwJCqgWe+ZfSqpRBf3gQ+4Q@mail.gmail.com> <email@example.com> <CADjGqHumk0T0c-FOa7at99t1bEh9qrd8rikZSa5ph=PNM4i0PQ@mail.gmail.com> <141023192353.ZM19606@torch.brasslantern.com> <CADjGqHtrkip-x82=zA7m0gE9R6zeN6VV3-fkpYUua4dt3KVemA@mail.gmail.com>
[redirect to -workers and Cc TJ in case he's not on that list]
On Oct 24, 7:59am, TJ Luoma wrote:
} On Thu, Oct 23, 2014 at 10:23 PM, Bart Schaefer
} <schaefer@xxxxxxxxxxxxxxxx> wrote:
} > On Oct 23, 9:26am, TJ Luoma wrote:
} > }
} > } I would still suggest that the original behavior which left me with
} > } "cd $sites//Users/luomat/Dropbox/Sites/" is a zsh bug, but I will
} > } leave that decision to those more qualified to answer.
} > I'm not able to reproduce this behavior ... I get the correct set of
} > completions even when capitals in $sites do not match the filesystem.
} > There must be something else going on with your configuration.
} setopt no_case_glob # set ignore case for ls etc
That's the one. With no_case_glob set I am able to reproduce the error:
torch% setopt nocaseglob
torch% cd $sites//usr/src/local/zsh/zsh-5.0-build/Src/
The setting of nocaseglob is tested at line 139 of _path_files and has
the effect of changing the matcher setting, which is passed down to
compfiles at line 463 and sends _path_files into this branch:
# A little extra hack: if we were completing `foo/<TAB>' and `foo'
# contains no files, this will normally produce no matches and other
# completers might think that's it's their time now. But if the next
# completer is _correct or something like that, this will result in
# an attempt to correct a valid directory name. So we just add the
# original string in such a case so that the command line doesn't
# change but other completers still think there are matches.
The actual culprit is the call to compadd at line 705, which adds the
unexpanded variable as the "original string" but passes the expanded
path prefix (with the inexact capitalization) as the -W option. The
completion internals compare case-sensitively when removing the prefix,
so it doesn't match and the entire expanded path gets treated as if it
were the name of a file inside $sites/.
(It's possible I've got that partly wrong and the prefix isn't removed
because it doesn't match the literal '$sites/' but the end result is the
I'm not sure at this point what to do about it.
Messages sorted by: