Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Handle completer filenames with funny characters in them
- X-seq: zsh-workers 54034
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Cc: "Jun. T" <takimoto-j@xxxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: PATCH: Handle completer filenames with funny characters in them
- Date: Wed, 05 Nov 2025 01:37:32 +0100
- Archived-at: <https://zsh.org/workers/54034>
- In-reply-to: <CAHYJk3SUz4m=+qbrXBQ+9ps5dq1KboeA5QKU1HUfzWiD7hYZAQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20240318151751.1096-1-mikachu@gmail.com> <0392B2D7-E833-4634-B237-76A833E2BEC8@kba.biglobe.ne.jp> <CAHYJk3SUz4m=+qbrXBQ+9ps5dq1KboeA5QKU1HUfzWiD7hYZAQ@mail.gmail.com>
On 8 Jun 2024, Mikael Magnusson wrote:
> On Sat, Jun 8, 2024 at 3:56 PM Jun. T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
> > > For example, a file called _foo;bar will cause this to happen:
> > > % hello [press tab]zsh: command not found: _foo
> > > zsh: command not found: bar
> >
> > With this patch the following has stopped working:
Mikael reverted his change which handled odd characters in completion
functions by adding quoting such as with (q) flags in several places.
How about the following approach instead which just excludes such files
entirely. Or will this make things slower.
Oliver
diff --git a/Completion/compinit b/Completion/compinit
index 5cb527fac..2bfd30f2e 100644
--- a/Completion/compinit
+++ b/Completion/compinit
@@ -520,7 +520,7 @@ if [[ -z "$_i_done" ]]; then
for _i_dir in $fpath; do
[[ $_i_dir = . ]] && continue
(( $_i_wdirs[(I)$_i_dir] )) && continue
- for _i_file in $_i_dir/^([^_]*|*~|*.zwc)(N); do
+ for _i_file in $_i_dir/^([^_]*|*[\;\|\&]*|*~|*.zwc)(N); do
_i_name="${_i_file:t}"
(( $+_i_test[$_i_name] + $_i_wfiles[(I)$_i_file] )) && continue
_i_test[$_i_name]=yes
Messages sorted by:
Reverse Date,
Date,
Thread,
Author