Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] edit-command-line breaks arguments with spaces
- X-seq: zsh-workers 41890
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] edit-command-line breaks arguments with spaces
- Date: Sat, 14 Oct 2017 13:57:32 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=OcpsGt Hj+VyzmxsmUrdtPRjbDc4xGk2YwL8dK9H0tlM=; b=L+ENN8CtXduirpQsylT98K +d+2iN28jIM/ksVKGPL3UfqkNGKM7nD3YMCl0O7xFe0GfcR9rrkpv/0u7uQQcAdK QxVms+Nne0PSghE4QrBuVI5Hs/cfdtCYM0e2Yv4iVEgMEdtOXegH3nnQ+sDGMVs6 AMiRuOx4CqbsiOIjI/jg3KCbAKEJyVUyLHR6CxHAAvhc9eBolGMTD8BjGbChRfGB zCK4Ctm1oBg1ZbQ0nIO4LzOieusN2KjGn2HMjzjOIFGHnnTDXXL0mFTtxGu+oiDM Rmh2CABL/Nqs/ntKL/qRQahfAhi91Pedpl6kVbUL9Fj55YliL5F++l1sR/oDD4xw ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=OcpsGt Hj+VyzmxsmUrdtPRjbDc4xGk2YwL8dK9H0tlM=; b=dpNcELSoSdhOK5gci979n0 dI/1jSfVzyKteimoYTZ48miv/0DkFiiYZz7Gw6ooxa9yodiSHMilCU35Uy8yci0D jHY/pqU2xSVkvt4aX78lYYXB8AbCm3kB38J6iPMg5+9gt6tJnBB3U7ncrRgjNoJs IjzTBKuutYZAvTmqLdpJFL4Gb/8rMIWusPRXL3a47EuprD/Jgr2MtN9+gHWlhOd/ +JATV4R7aqeAp7AlF8DPN2wGHXekYvze4NSn/TfxystHGwqYyoHHD18290ZFey4q OKEQCQWCxLwbxUm79iPt3W+SL2zoNws9zIzBOZ0EjxZL76DfFkQIgTAgxZ2nIUgw ==
- In-reply-to: <20171014042152.GA96140@tower.spodhuis.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <4B40504C-14CC-4EE0-8A53-5CF67C67E37E@gmail.com> <1507939677.3717869.1138301848.03470D9F@webmail.messagingengine.com> <171013175555.ZM12982@torch.brasslantern.com> <1507945924.3744661.1138358040.4B6A109D@webmail.messagingengine.com> <20171014042152.GA96140@tower.spodhuis.org>
Phil Pennock wrote on Sat, 14 Oct 2017 00:21 -0400:
> On 2017-10-14 at 01:52 +0000, Daniel Shahaf wrote:
> > If $EDITOR is set to "vim -c ''", then:
> >
> > - current master passes «''» (two characters) for vim's argv[2]
> >
> > - using eval passes the empty string for vim's argv[2]
> >
> > - using ${(Q)} elides the "" entirely
>
> No, the (Q) has nothing to do with it. The problem is that in zsh,
> expanding an unquoted array variable omits empty elements.
>
> So instead of «$editor» it needs to be «"${editor[@]}"» or
> «"${(@)editor}"» to keep the empty elements present at _expansion_ time.
Good point; changing «${(Q)foo}» to «"${(@Q)foo}"» and «$editor» to «"${editor[@]}"»
would also work: the problem wasn't (Q) per se, but the lack of (@).
Between eval and (@Q) I think I'm leaning towards the latter.
Thanks Phil.
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author