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 52946
- From: "Jun. T" <takimoto-j@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: PATCH: Handle completer filenames with funny characters in them
- Date: Sat, 8 Jun 2024 22:55:18 +0900
- Archived-at: <https://zsh.org/workers/52946>
- In-reply-to: <20240318151751.1096-1-mikachu@gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20240318151751.1096-1-mikachu@gmail.com>
> 2024/03/19 0:17、Mikael Magnusson <mikachu@xxxxxxxxx>のメール:
>
> 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:
% compdef '_files -g "*.h"' foo
% foo <TAB>
foo (eval):1: command not found: _files -g "*.h"
> @@ -412,7 +412,7 @@ compdef() {
> svc=
> fi
> if [[ -z "$new" || -z "${_comps[$1]}" ]]; then
> - _comps[$cmd]="$func"
> + _comps[$cmd]="${(q)func}"
> [[ -n "$svc" ]] && _services[$cmd]="${1#*\=}"
> fi
I don't know what is the best solution.
Quote only if $func is a single word?,
or quote only the first word of $func?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author