zsh-workers
 help / color / mirror / code / Atom feed
From: "Jun. T" <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: PATCH: Handle completer filenames with funny characters in them
Date: Sat, 8 Jun 2024 22:55:18 +0900	[thread overview]
Message-ID: <0392B2D7-E833-4634-B237-76A833E2BEC8@kba.biglobe.ne.jp> (raw)
In-Reply-To: <20240318151751.1096-1-mikachu@gmail.com>


> 2024/03/19 0:17、Mikael Magnusson <mikachu@gmail.com>のメール:
> 
> 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?

  reply	other threads:[~2024-06-08 13:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 15:17 Mikael Magnusson
2024-06-08 13:55 ` Jun. T [this message]
2024-06-08 15:49   ` Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0392B2D7-E833-4634-B237-76A833E2BEC8@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).