Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
_files -g <pattern> offers files that don't match the pattern and conversely
- X-seq: zsh-workers 51936
- From: Johan Grande <nahoj@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: _files -g <pattern> offers files that don't match the pattern and conversely
- Date: Sat, 15 Jul 2023 15:31:57 +0200
- Archived-at: <https://zsh.org/workers/51936>
- List-id: <zsh-workers.zsh.org>
Are these bugs or am I misunderstanding how the -g option works?
With zsh 5.8.1 (x86_64-ubuntu-linux-gnu) and an empty .zshrc.
% ls
a b
% _f() { _files -g 'c(.)' }; compdef _f f
% f <tab>
a b # even though 'a' and 'b' don't match the pattern
However,
% _f() { _path_files -g 'c(.)' }; compdef _f f
% f <tab> # nothing
Conversely,
% _f() { _files -g '^(a #)(.)' }; compdef _f f
% f <tab> # nothing, even though 'b' matches the pattern
However,
% _f() { _path_files -g '^(a #)(.)' }; compdef _f f
% f <tab> # becomes
% f b
Also, and this is the same for _files and _path_files:
% f() { echo $@ }
% _f() { _files -g 'c' }; compdef _f f
% f <tab> # becomes
% f c # even though there is no such file
--
Johan Grande
Messages sorted by:
Reverse Date,
Date,
Thread,
Author